From 42f52cc300cc380bbc891319ffc56babc421b2f9 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 5 Apr 2013 12:50:10 +0200 Subject: [PATCH] Separate blank buttons don't hide on resizing (bug #1164925) Fixes: https://launchpad.net/bugs/1164925 --- openlp/core/ui/slidecontroller.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index f0c5aa170..4893e62f4 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -588,12 +588,14 @@ class SlideController(DisplayController): if self.is_live: # Space used by the toolbar. used_space = self.toolbar.size().width() + self.hide_menu.size().width() - # The + 40 is needed to prevent flickering. This can be considered a "buffer". - if width > used_space + 40 and self.hide_menu.isVisible(): + # Threshold which has to be trespassed to toggle. + threshold = 27 + # Add the threshold to prevent flickering. + if width > used_space + threshold and self.hide_menu.isVisible(): self.toolbar.set_widget_visible(self.narrow_menu, False) self.toolbar.set_widget_visible(self.wide_menu) - # The - 40 is needed to prevent flickering. This can be considered a "buffer". - elif width < used_space - 40 and not self.hide_menu.isVisible(): + # Take away a threshold to prevent flickering. + elif width < used_space - threshold and not self.hide_menu.isVisible(): self.toolbar.set_widget_visible(self.wide_menu, False) self.toolbar.set_widget_visible(self.narrow_menu)