From 3980fca903afd1315a17c516dfd68a4b71217586 Mon Sep 17 00:00:00 2001 From: prculley Date: Wed, 17 Jan 2018 16:34:37 -0600 Subject: [PATCH] Surname Editor, fix fields for better fit in minimum width dialogs --- gramps/gui/editors/displaytabs/embeddedlist.py | 9 ++++++--- gramps/gui/editors/displaytabs/surnametab.py | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/gramps/gui/editors/displaytabs/embeddedlist.py b/gramps/gui/editors/displaytabs/embeddedlist.py index 9929967ad..7bbeaf0a3 100644 --- a/gramps/gui/editors/displaytabs/embeddedlist.py +++ b/gramps/gui/editors/displaytabs/embeddedlist.py @@ -523,9 +523,12 @@ class EmbeddedList(ButtonTab): # insert the colum into the tree column.set_resizable(True) column.set_clickable(True) - column.set_sizing(Gtk.TreeViewColumnSizing.FIXED) - #column.set_min_width(self._column_names[pair[1]][2]) - column.set_fixed_width(self._column_names[pair[1]][2]) + if self._column_names[pair[1]][2] != -1: + column.set_sizing(Gtk.TreeViewColumnSizing.FIXED) + #column.set_min_width(self._column_names[pair[1]][2]) + column.set_fixed_width(self._column_names[pair[1]][2]) + else: + column.set_expand(True) column.set_sort_column_id(self._column_names[pair[1]][1]) self.columns.append(column) diff --git a/gramps/gui/editors/displaytabs/surnametab.py b/gramps/gui/editors/displaytabs/surnametab.py index bcf8b3111..86c3b1c0d 100644 --- a/gramps/gui/editors/displaytabs/surnametab.py +++ b/gramps/gui/editors/displaytabs/surnametab.py @@ -125,7 +125,7 @@ class SurnameTab(EmbeddedList): column.set_resizable(True) column.set_sort_column_id(self._column_combo[1]) column.set_min_width(self._column_combo[2]) - column.set_expand(True) + column.set_expand(False) self.columns.append(column) self.tree.append_column(column) # toggle box for primary @@ -141,7 +141,7 @@ class SurnameTab(EmbeddedList): column.set_sizing(Gtk.TreeViewColumnSizing.FIXED) column.set_alignment(0.5) column.set_sort_column_id(self._column_toggle[1]) - column.set_min_width(self._column_toggle[2]) + column.set_max_width(self._column_toggle[2]) self.columns.append(column) self.tree.append_column(column) @@ -249,11 +249,13 @@ class SurnameTab(EmbeddedList): """ self.on_edit_start(cellr, celle, path, colnr) #set up autocomplete + entry = celle.get_child() + entry.set_width_chars(10) completion = Gtk.EntryCompletion() completion.set_model(self.cmborig) completion.set_minimum_key_length(1) completion.set_text_column(1) - celle.get_child().set_completion(completion) + entry.set_completion(completion) # celle.connect('changed', self.on_origcmb_change, path, colnr)