Surname Editor, fix fields for better fit in minimum width dialogs

This commit is contained in:
prculley 2018-01-17 16:34:37 -06:00
parent 462b0ea20b
commit 3980fca903
2 changed files with 11 additions and 6 deletions

View File

@ -523,9 +523,12 @@ class EmbeddedList(ButtonTab):
# insert the colum into the tree # insert the colum into the tree
column.set_resizable(True) column.set_resizable(True)
column.set_clickable(True) column.set_clickable(True)
if self._column_names[pair[1]][2] != -1:
column.set_sizing(Gtk.TreeViewColumnSizing.FIXED) column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
#column.set_min_width(self._column_names[pair[1]][2]) #column.set_min_width(self._column_names[pair[1]][2])
column.set_fixed_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]) column.set_sort_column_id(self._column_names[pair[1]][1])
self.columns.append(column) self.columns.append(column)

View File

@ -125,7 +125,7 @@ class SurnameTab(EmbeddedList):
column.set_resizable(True) column.set_resizable(True)
column.set_sort_column_id(self._column_combo[1]) column.set_sort_column_id(self._column_combo[1])
column.set_min_width(self._column_combo[2]) column.set_min_width(self._column_combo[2])
column.set_expand(True) column.set_expand(False)
self.columns.append(column) self.columns.append(column)
self.tree.append_column(column) self.tree.append_column(column)
# toggle box for primary # toggle box for primary
@ -141,7 +141,7 @@ class SurnameTab(EmbeddedList):
column.set_sizing(Gtk.TreeViewColumnSizing.FIXED) column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
column.set_alignment(0.5) column.set_alignment(0.5)
column.set_sort_column_id(self._column_toggle[1]) 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.columns.append(column)
self.tree.append_column(column) self.tree.append_column(column)
@ -249,11 +249,13 @@ class SurnameTab(EmbeddedList):
""" """
self.on_edit_start(cellr, celle, path, colnr) self.on_edit_start(cellr, celle, path, colnr)
#set up autocomplete #set up autocomplete
entry = celle.get_child()
entry.set_width_chars(10)
completion = Gtk.EntryCompletion() completion = Gtk.EntryCompletion()
completion.set_model(self.cmborig) completion.set_model(self.cmborig)
completion.set_minimum_key_length(1) completion.set_minimum_key_length(1)
completion.set_text_column(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) celle.connect('changed', self.on_origcmb_change, path, colnr)