From 1a48e8a03e7252d60ba5eeb329ef297a33003f04 Mon Sep 17 00:00:00 2001 From: Paul Culley Date: Fri, 19 Feb 2021 11:44:32 -0600 Subject: [PATCH] Fix issue where separator between top and bottom bar of View creeps up. (#1122) Fixes #11973 --- gramps/gui/viewmanager.py | 3 ++- gramps/gui/views/pageview.py | 20 ++++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py index 545204a2f..6bce9ade2 100644 --- a/gramps/gui/viewmanager.py +++ b/gramps/gui/viewmanager.py @@ -295,7 +295,7 @@ class ViewManager(CLIManager): vbox.pack_end(self.statusbar, False, True, 0) vbox.pack_start(toolbar, False, True, 0) vbox.pack_end(self.hpane, True, True, 0) - vbox.show() + vbox.show_all() self.uistate = DisplayState(self.window, self.statusbar, self.uimanager, self) @@ -835,6 +835,7 @@ class ViewManager(CLIManager): hbox.add(Gtk.Label(label=pdata.name)) hbox.show_all() page_num = self.notebook.append_page(page.get_display(), hbox) + self.active_page.post_create() if not self.file_loaded: self.uimanager.set_actions_visible(self.actiongroup, False) self.uimanager.set_actions_visible(self.readonlygroup, False) diff --git a/gramps/gui/views/pageview.py b/gramps/gui/views/pageview.py index 7961ec56f..966a6ec0d 100644 --- a/gramps/gui/views/pageview.py +++ b/gramps/gui/views/pageview.py @@ -138,6 +138,7 @@ class PageView(DbGUIElement, metaclass=ABCMeta): self.sidebar = None self.bottombar = None self.widget = None + self.vpane = None DbGUIElement.__init__(self, dbstate.db) @@ -154,18 +155,20 @@ class PageView(DbGUIElement, metaclass=ABCMeta): self.ident + "_bottombar", defaults[1]) hpane = Gtk.Paned() - vpane = Gtk.Paned(orientation=Gtk.Orientation.VERTICAL) - hpane.pack1(vpane, resize=True, shrink=False) + self.vpane = Gtk.Paned(orientation=Gtk.Orientation.VERTICAL) + hpane.pack1(self.vpane, resize=True, shrink=False) hpane.pack2(self.sidebar, resize=False, shrink=False) hpane.show() - vpane.show() + self.vpane.show() self.widget = self.build_widget() self.widget.show_all() self.widget.set_name('view') - vpane.pack1(self.widget, resize=True, shrink=False) - vpane.pack2(self.bottombar, resize=False, shrink=True) - self._setup_slider_config(vpane, 'vpane.slider-position') + self.vpane.pack1(self.widget, resize=True, shrink=False) + self.vpane.pack2(self.bottombar, resize=False, shrink=True) + self.vpane.show_all() + self._config.register('vpane.slider-position', -1) + self.vpane.set_position(self._config.get('vpane.slider-position')) self.sidebar_toggled(self.sidebar.get_property('visible')) self.hpane_sig = hpane.connect("draw", self.set_page_slider) @@ -343,6 +346,11 @@ class PageView(DbGUIElement, metaclass=ABCMeta): self.bottombar.set_inactive() self.active = False + def post_create(self): + if self.vpane: + self._setup_slider_config(self.vpane, 'vpane.slider-position') + self.vpane = None + @abstractmethod def build_tree(self): """