Fix issue where separator between top and bottom bar of View creeps up. (#1122)

Fixes #11973
This commit is contained in:
Paul Culley 2021-02-19 11:44:32 -06:00 committed by GitHub
parent 9a4adab9d6
commit 1a48e8a03e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 7 deletions

View File

@ -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)

View File

@ -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):
"""