Skip to content

Commit

Permalink
Fix sizing of shared information in the reference editors
Browse files Browse the repository at this point in the history
Sets the packing of the expander widget to depend on whether or not
it is expanded.

Fixes #13030.
  • Loading branch information
Nick-Hall committed Sep 19, 2023
1 parent 2a8a1d4 commit 238d3b3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions gramps/gui/editors/editreference.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@ def enable_warnbox(self):

def define_expander(self, expander):
expander.set_expanded(True)
expander.connect("activate", self.__on_expand)

def __on_expand(self, expander):
"""
Sets the packing of the expander widget to depend on whether or not
it is expanded.
"""
state = not expander.get_expanded()
parent = expander.get_parent()
parent.set_child_packing(expander, state, state, 0, Gtk.PackType.START)
expander.set_vexpand(state)

def _post_init(self):
"""
Expand Down
2 changes: 2 additions & 0 deletions gramps/gui/glade/editeventref.glade
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
<object class="GtkNotebook" id="notebook_ref">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="vexpand">True</property>
<property name="border_width">6</property>
<child>
<object class="GtkGrid" id="table64">
Expand Down Expand Up @@ -207,6 +208,7 @@
<object class="GtkNotebook" id="notebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="vexpand">True</property>
<property name="show_border">False</property>
<child>
<object class="GtkGrid" id="table62">
Expand Down
2 changes: 2 additions & 0 deletions gramps/gui/glade/editplaceref.glade
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
<object class="GtkNotebook" id="notebook_ref">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="vexpand">True</property>
<property name="border_width">6</property>
<child>
<object class="GtkGrid" id="table64">
Expand Down Expand Up @@ -185,6 +186,7 @@
<object class="GtkNotebook" id="notebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="vexpand">True</property>
<property name="show_border">False</property>
<child>
<object class="GtkGrid" id="table62">
Expand Down
1 change: 1 addition & 0 deletions gramps/gui/glade/editreporef.glade
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
<object class="GtkNotebook" id="notebook_ref">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="vexpand">True</property>
<property name="border_width">6</property>
<child>
<object class="GtkGrid" id="table70">
Expand Down

0 comments on commit 238d3b3

Please sign in to comment.