From 4c2eab727e8634c3fee3f4560dbe8af521b05c18 Mon Sep 17 00:00:00 2001 From: Hydrus Network Developer Date: Wed, 21 Aug 2024 15:24:35 -0500 Subject: [PATCH] A touch more anti-flicker --- .../client/gui/pages/ClientGUIManagementPanels.py | 4 ++-- hydrus/client/gui/pages/ClientGUIPages.py | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hydrus/client/gui/pages/ClientGUIManagementPanels.py b/hydrus/client/gui/pages/ClientGUIManagementPanels.py index 66d1766fe..d520cd5f9 100644 --- a/hydrus/client/gui/pages/ClientGUIManagementPanels.py +++ b/hydrus/client/gui/pages/ClientGUIManagementPanels.py @@ -351,9 +351,9 @@ def CleanBeforeDestroy( self ): pass - def GetDefaultEmptyMediaPanel( self ) -> ClientGUIResults.MediaPanel: + def GetDefaultEmptyMediaPanel( self, win: QW.QWidget ) -> ClientGUIResults.MediaPanel: - panel = ClientGUIResults.MediaPanelThumbnails( self._page, self._page_key, self._management_controller, [] ) + panel = ClientGUIResults.MediaPanelThumbnails( win, self._page_key, self._management_controller, [] ) status = self._GetDefaultEmptyPageStatusOverride() diff --git a/hydrus/client/gui/pages/ClientGUIPages.py b/hydrus/client/gui/pages/ClientGUIPages.py index 3f327ed8e..cf9d21c70 100644 --- a/hydrus/client/gui/pages/ClientGUIPages.py +++ b/hydrus/client/gui/pages/ClientGUIPages.py @@ -471,7 +471,7 @@ def __init__( self, parent, controller, management_controller: ClientGUIManageme self._management_panel.locationChanged.connect( self._preview_canvas.SetLocationContext ) - self._media_panel = self._management_panel.GetDefaultEmptyMediaPanel() + self._media_panel = self._management_panel.GetDefaultEmptyMediaPanel( self._management_media_split ) self._management_media_split.addWidget( self._search_preview_split ) self._management_media_split.addWidget( self._media_panel ) @@ -481,12 +481,6 @@ def __init__( self, parent, controller, management_controller: ClientGUIManageme vbox = QP.VBoxLayout( margin = 0 ) - QP.AddToLayout( vbox, self._management_media_split, CC.FLAGS_EXPAND_SIZER_BOTH_WAYS ) - - self.setLayout( vbox ) - - vbox = QP.VBoxLayout( margin = 0 ) - QP.AddToLayout( vbox, self._preview_canvas, CC.FLAGS_EXPAND_SIZER_BOTH_WAYS ) self._preview_panel.setLayout( vbox ) @@ -503,6 +497,12 @@ def __init__( self, parent, controller, management_controller: ClientGUIManageme self._search_preview_split.setStretchFactor( 0, 1 ) self._search_preview_split.setStretchFactor( 1, 0 ) + vbox = QP.VBoxLayout( margin = 0 ) + + QP.AddToLayout( vbox, self._management_media_split, CC.FLAGS_EXPAND_SIZER_BOTH_WAYS ) + + self.setLayout( vbox ) + self._handle_event_filter = QP.WidgetEventFilter( self._management_media_split.handle( 1 ) ) self._handle_event_filter.EVT_LEFT_DCLICK( self.EventUnsplit )