Skip to content

Commit

Permalink
Save column sizes before a rebuild
Browse files Browse the repository at this point in the history
To prevent overriding the defaults, don't save sizes before
the initial build.

Save column sizes as floats rather than integers. This prevents
seeing a slight column resize after a rebuild.

Fixes #12943.
  • Loading branch information
Nick-Hall committed Aug 11, 2023
1 parent 66c46ab commit 878ce2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions gramps/gui/views/listview.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ def set_inactive(self):
self.uistate.viewmanager.tags.tag_disable()

def build_tree(self, force_sidebar=False, preserve_col=True):
if self.list.get_columns()[0].get_width() > 0:
self.list.save_column_info(self.list)
if self.active:
cput0 = perf_counter()
if not self.search_bar.is_visible():
Expand Down
2 changes: 1 addition & 1 deletion gramps/gui/widgets/persistenttreeview.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def get_columns_size(self):
# Don't resize the icons
size = 2
else:
size = int(column.get_width() / char_width) + 1
size = column.get_width() / char_width
size = 2 if size < 2 else size
newsize.append(size)
nbc += 1
Expand Down

0 comments on commit 878ce2c

Please sign in to comment.