From 6eba926a70ed98b03201e07eee218ebb2e8fa2b8 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 10 Feb 2013 20:08:37 +0100 Subject: [PATCH] improved hide menu behaviour --- openlp/core/ui/slidecontroller.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 4424081df..540b1f563 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -602,10 +602,14 @@ class SlideController(DisplayController): Change layout of display control buttons on controller size change """ if self.isLive: - if width > 300 and self.hideMenu.isVisible(): + # Space used by the toolbar. + used_space = self.toolbar.size().width() + self.hideMenu.size().width() + # The + 40 is needed to prevent flickering. This can be considered a "buffer". + if width > used_space + 40 and self.hideMenu.isVisible(): self.toolbar.setWidgetVisible(self.hideMenuList, False) self.toolbar.setWidgetVisible(self.wideMenu) - elif width < 300 and not self.hideMenu.isVisible(): + # The - 40 is needed to prevent flickering. This can be considered a "buffer". + elif width < used_space - 40 and not self.hideMenu.isVisible(): self.toolbar.setWidgetVisible(self.wideMenu, False) self.toolbar.setWidgetVisible(self.hideMenuList)