From 86b131669136c882e60b6b296d0047302a7b1536 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 10 Feb 2022 14:35:11 -0500 Subject: [PATCH] Handle no-rows-yet case --- piker/ui/_search.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/piker/ui/_search.py b/piker/ui/_search.py index fcb5bba5..739a29ab 100644 --- a/piker/ui/_search.py +++ b/piker/ui/_search.py @@ -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