Handle no-rows-yet case

windows_fixes_yo
Tyler Goodlet 2022-02-10 14:35:11 -05:00
parent 890ffc76cf
commit 86b1316691
1 changed files with 5 additions and 2 deletions

View File

@ -183,8 +183,11 @@ class CompleterView(QTreeView):
# TODO: probably make this more general / less hacky
# we should figure out the exact number of rows to allow
# inclusive of search bar and header "rows", in pixel terms.
window_h = self.window().height()
rows = ceil(window_h / row_px) - 2
if row_px > 0:
window_h = self.window().height()
rows = ceil(window_h / row_px) - 2
else:
rows = 16
# TODO: the problem here is that this view widget is **not**
# resizing/scaling when the parent layout is adjusted, not sure