Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion gramps/gui/editors/displaytabs/embeddedlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ def __init__(
self.col_icons = {}
self.columns = []
self.build_columns()
# restore_column_size() is called here rather than at the end of
# build_columns() because some subclasses (e.g. SurnameTab) append
# additional columns of their own after calling the base
# build_columns(); restoring saved widths must wait until all
# columns exist, or the extra columns never get their sizes back.
self.tree.restore_column_size()

if self._DND_TYPE:
self._set_dnd()
Expand Down Expand Up @@ -562,7 +568,6 @@ def build_columns(self):
self.columns.append(column)
self.tree.append_column(column)
self.track_ref_for_deletion("columns")
self.tree.restore_column_size()

def get_config_name(self):
"""used to associate the selector config name to the PersistentTreeView"""
Expand Down
12 changes: 8 additions & 4 deletions gramps/gui/editors/displaytabs/surnametab.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ class SurnameTab(EmbeddedList):
# index = column in model. Value =
# (name, sortcol in model, width, markup/text
_column_names = [
(_("Prefix"), 0, 150, TEXT_EDIT_COL, -1, None),
(_("Prefix"), 0, 170, TEXT_EDIT_COL, -1, None),
(_("Surname", "Multiple surnames"), 1, -1, TEXT_EDIT_COL, -1, None),
(_("Connector"), 2, 100, TEXT_EDIT_COL, -1, None),
(_("Connector"), 2, 130, TEXT_EDIT_COL, -1, None),
]
_column_combo = (_("Origin"), -1, 150, 3) # name, sort, width, modelcol
_column_combo = (_("Origin"), -1, 160, 3) # name, sort, width, modelcol
_column_toggle = (_("Primary", "Name"), -1, 80, 4)

def __init__(
Expand Down Expand Up @@ -147,7 +147,11 @@ def build_columns(self):
column = Gtk.TreeViewColumn(name, renderer, text=self._column_combo[3])
column.set_resizable(True)
column.set_sort_column_id(self._column_combo[1])
column.set_min_width(self._column_combo[2])
# FIXED sizing (matching the other columns) is required for the
# resize handle to behave predictably; without it GTK falls back to
# GROW_ONLY, which resists shrinking and makes dragging feel stuck.
column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
column.set_fixed_width(self._column_combo[2])
column.set_expand(False)
self.columns.append(column)
self.tree.append_column(column)
Expand Down
Loading