diff --git a/gramps/gui/editors/displaytabs/embeddedlist.py b/gramps/gui/editors/displaytabs/embeddedlist.py index af3cc15c32..95ae1a994e 100644 --- a/gramps/gui/editors/displaytabs/embeddedlist.py +++ b/gramps/gui/editors/displaytabs/embeddedlist.py @@ -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() @@ -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""" diff --git a/gramps/gui/editors/displaytabs/surnametab.py b/gramps/gui/editors/displaytabs/surnametab.py index 258beaae6c..3c16e17a2d 100644 --- a/gramps/gui/editors/displaytabs/surnametab.py +++ b/gramps/gui/editors/displaytabs/surnametab.py @@ -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__( @@ -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)