# Editor dialogs not remembering table spacing

**URL:** <https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871>\
**Category:** Development\
**Tags:** hacks\
**Created:** [September 30, 2021, 7:23pm UTC](https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871 "2021-09-30T19:23:05Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![moorob](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/moorob/32/586_2.png) [@moorob](https://gramps.discourse.group/u/moorob)\
**Post date:** [September 30, 2021, 7:23pm UTC](https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871/1 "2021-09-30T19:23:05Z")

</div>

I’ve noticed that in 5.1.4 that any of the edit dialogs like events don’t remember what the spacing is for columns. Every time I open a dialog, it defaults back to the default spacing. Is there a way to have it remember them?

---

<div class="post-metadata">

**Author:** ![DaveSch](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesch/32/40_2.png) [@DaveSch](https://gramps.discourse.group/u/DaveSch)\
**Post date:** [September 30, 2021, 7:50pm UTC](https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871/2 "2021-09-30T19:50:45Z")

</div>

The list and column spacing have never been remembered between opening edit windows. The major Views; People, Families, Events, Places, Sources, Citations, Repositories, Notes, and Media have configurable columns and will remember the spacing allocated by the user.

You can hack the code to allocate more or less space for the various edit windows. Which dialog windows are you most interested in modifying?

---

<div class="post-metadata">

**Author:** ![moorob](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/moorob/32/586_2.png) [@moorob](https://gramps.discourse.group/u/moorob)\
**Post date:** [October 11, 2021, 5:17pm UTC](https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871/3 "2021-10-11T17:17:10Z")

</div>

Sorry getting back so late. In event Reference Editor, Source citations, I would like to have the title about 50 percent wider.

---

<div class="post-metadata">

**Author:** ![DaveSch](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesch/32/40_2.png) [@DaveSch](https://gramps.discourse.group/u/DaveSch)\
**Post date:** [October 11, 2021, 7:12pm UTC](https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871/4 "2021-10-11T19:12:43Z")

</div>

I am not sure which list you are referencing but since you mention the Source Title I will make these assumptions.

All files are in the Gramps program code folder. Edit…

`\gramps\gui\selectors\selectcitation.py` at line 69

```
def get_column_titles(self):
    return [
        (_('Source: Title or Citation: Volume/Page'), 350, BaseSelector.TEXT, 0),
        (_('ID'), 75, BaseSelector.TEXT, 1),
        (_('Last Change'), 150, BaseSelector.TEXT, 6),
        ]

```

To increase **Source: Title…**. change the 350 to maybe 450

Likewise, you may want to edit…

`\gramps\gui\selectors\selectsource.py` at line 64

```
def get_column_titles(self):
    return [
        (_('Title'), 350, BaseSelector.TEXT, 0),
        (_('Author'), 200, BaseSelector.TEXT, 2),
        (_('ID'), 75, BaseSelector.TEXT, 1),
        (_('Last Change'), 150, BaseSelector.TEXT, 7),
        ]

```

To change the column widths of the Tab that display the list of Citations, edit…

`\gramps\gui\editors\displaytabs\citationembedlist.py` at line 79

```
_column_names = [
    (_('Title'), 0, 200, TEXT_COL, -1, None),
    (_('Author'), 1, 125, TEXT_COL, -1, None),
    (_('Page'), 2, 100, TEXT_COL, -1, None),
    (_('ID'), 3, 75, TEXT_COL, -1, None),
    (_('Private'), 4, 30, ICON_COL, -1, 'gramps-lock')
]

```

Some pointers…

The program folders are protected so you will need to edit with administrator rights.

When the next version of Gramps comes out, you will need to make these changes again. The main code will not change column sizes based upon display size considerations. So you need to give yourself a way to remember any changes to the code you make.

When editing the code, make sure to not alter indents. They are important.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [October 11, 2021, 9:27pm UTC](https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871/5 "2021-10-11T21:27:00Z")

</div>

Remember to log any hacks that you do to the layouts. If you do not submit a feature request tweak to the base code that actually gets rolled into an update, you will have to repeat the hack for subsequent releases.

It is handy to manually renumber the original Note ZERO and keep details about hacks in a NEW Note assigned that ID. This makes finding them easier.

---

<div class="post-metadata">

**Author:** ![moorob](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/moorob/32/586_2.png) [@moorob](https://gramps.discourse.group/u/moorob)\
**Post date:** [October 12, 2021, 1:11pm UTC](https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871/6 "2021-10-12T13:11:17Z")

</div>

Thanks, I’ll try that.

---

<div class="post-metadata">

**Author:** ![SNoiraud](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/snoiraud/32/72_2.png) [@SNoiraud](https://gramps.discourse.group/u/SNoiraud)\
**Post date:** [October 14, 2021, 6:25pm UTC](https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871/7 "2021-10-14T18:25:20Z")

</div>

Can you make a feature request for that. I think I have a solution.

---

<div class="post-metadata">

**Author:** ![SNoiraud](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/snoiraud/32/72_2.png) [@SNoiraud](https://gramps.discourse.group/u/SNoiraud)\
**Post date:** [October 15, 2021, 7:51am UTC](https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871/8 "2021-10-15T07:51:36Z")

</div>

You can see the PR: [Column widths in selection dialogs. by SNoiraud · Pull Request #1302 · gramps-project/gramps · GitHub](https://github.com/gramps-project/gramps/pull/1302)

---

<div class="post-metadata">

**Author:** ![DaveSch](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesch/32/40_2.png) [@DaveSch](https://gramps.discourse.group/u/DaveSch)\
**Post date:** [October 15, 2021, 11:52am UTC](https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871/9 "2021-10-15T11:52:01Z")

</div>

Great work. This takes care of remembering previous column widths in Selectors.

Can the same be done for the lists under Tabs? It would be a lot of work. Not just the Tabs in Edit windows but if that can be made to work there would also be all the various gramplet tabs.

---

<div class="post-metadata">

**Author:** ![SNoiraud](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/snoiraud/32/72_2.png) [@SNoiraud](https://gramps.discourse.group/u/SNoiraud)\
**Post date:** [October 15, 2021, 11:56am UTC](https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871/10 "2021-10-15T11:56:22Z")

</div>

I don’t see where you want to have this done.  
can you attach snapshot of these ?

---

<div class="post-metadata">

**Author:** ![DaveSch](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesch/32/40_2.png) [@DaveSch](https://gramps.discourse.group/u/DaveSch)\
**Post date:** [October 15, 2021, 12:16pm UTC](https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871/11 "2021-10-15T12:16:18Z")

</div>

Above

> [@Editor dialogs not remembering table spacing](https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871/4):
>
> I am not sure which list you are referencing but since you mention the Source Title I will make these assumptions. All files are in the Gramps program code folder. Edit… \gramps\gui\selectors\selectcitation.py at line 69 def get\_column\_titles(self): return [(\_('Source: Title or Citation: Volume/Page'), 350, BaseSelector.TEXT, 0), (\_('ID'), 75, BaseSelector.TEXT, 1), (\_('Last Change'), 150, BaseSelector.TEXT, 6),] To increase Source: Title…. change th…

I offered up changing the Source Citations tab in edit windows to give the Title more space. `\gramps\gui\editors\displaytabs\citationembedlist.py`

So it would be remembering the space the user allocates under the various Tabs in the edit windows.

Remembering these tabs would be more important than gramplet tabs but it would create the expectation that all lists would be remembered.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [October 15, 2021, 1:51pm UTC](https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871/12 "2021-10-15T13:51:10Z")

</div>

> [@SNoiraud](#):
>
> Can you make a [feature request [#8767]](https://gramps-project.org/bugs/view.php?id=8767) for that. I think I have a solution.

> [@SNoiraud](#):
>
> You can see the PR: [Column widths in selection dialogs. by SNoiraud · Pull Request #1302 · gramps-project/gramps · GitHub](https://github.com/gramps-project/gramps/pull/1302)

Thank you! This seems like it should be very useful for translation… where different languages might need different widths for the data.

I wonder if there would be a way to manage/distribute persistent localized settings?

---

<div class="post-metadata">

**Author:** ![SNoiraud](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/snoiraud/32/72_2.png) [@SNoiraud](https://gramps.discourse.group/u/SNoiraud)\
**Post date:** [November 2, 2021, 5:14pm UTC](https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871/13 "2021-11-02T17:14:24Z")

</div>

The PR #1302 is replaced by PR [Make the tabs columns resizable: ResizableTreeView by SNoiraud · Pull Request #1306 · gramps-project/gramps · GitHub](https://github.com/gramps-project/gramps/pull/1306).

- All tabs column width are saved (selectors, embedded list, views).
- When you change the font size of gramps with the Themes plugins (Edit-\>Preferences-\>Themes)  
The column width is updated depending on the font size.
- The new sizes will be kept between gramps session.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 8, 2021, 4:20pm UTC](https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871/14 "2021-11-08T16:20:28Z")

</div>

Just want to express my public appreciation to @SNoiraud for this PR.

It involved fussy changes to over 60 files and expands Gramps ability to support many special needs. The work deserves many kudos.

I look forward to experimenting with it for 5.2 ( or are we trending towards 6.0 as the next enhancement release?).

But I’d like to put forward a thought that a spot for a ‘fix’ be reserved for the maintenance release after the changes are rolled into Gramps main.

The ‘bug’ will be in the beta test & feedback cycle rather than the feature per se.

There won’t be enough people testing the changes … because of the extensive number of files being changed. So the default widths for the more than 3 dozen languages across a multitude of dialogs & views will not have have a chance to be integrated.

Like translations, those changes should be fast-tracked & rolled into maintenance instead of the enhancement release cycle. (And these configuration mods might also require a change management feature allowing sets of widths & orders to be distributed.)

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 6, 2024, 7:58pm UTC](https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871/15 "2024-11-06T19:58:34Z")

</div>

The column resizing has a bit of history now.

Have users discovered any other dialogs where columns have been overlooked? I found one so far. (Lost the bug report a couple times due to timeouts. But am about to try again.)

- The Multiple Surname layout of the Person Editor has invalid column widths for Prefix and Connector. Nor does it remember resizing of those columns.

By default, the [Prefix is too narrow and the Surname column is too wide. The (too narrow) Connector column](https://github.com/gramps-project/gramps/blob/5981c63a73578758fa6129513c71461ac12eff84/gramps/gui/editors/displaytabs/surnametab.py#L78C1-L82C6), Origin and Primary columns are too far to the right.

 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/0/007afa264a6279648b2edea0a6c94193d8aea494.png)

After resizing the dialog wider, re-opening the Person Editor remembers the dialog width but none of the column resizings.

 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/e/e168b769bff44baa83501989d1d01172b1322003.png)

### References

Issues in MantisBT:

- [0008767](https://gramps-project.org/bugs/view.php?id=08767): Column widths in selection dialogs
- [0012943](https://gramps-project.org/bugs/view.php?id=12943): View columns self-resize to the header label text width on every view refresh
- [0000407](https://gramps-project.org/bugs/view.php?id=0000407): Column widths not remembered
- [0007961](https://gramps-project.org/bugs/view.php?id=7961): feature - enable each view’s Configure dialog to restore that view’s column defaults
- [0003776](https://gramps-project.org/bugs/view.php?id=03776): feature - Editors-Tabulators: Column widths not remembered

Cross-reference to GitHub Pull Requests:

- Make the tabs columns resizable: ResizableTreeView [#1306](https://github.com/gramps-project/gramps/pull/1306)
- Save column sizes before a rebuild [#1497](https://github.com/gramps-project/gramps/pull/1497)
- (superseded) Make all the tabs columns resizable [#1302](https://github.com/gramps-project/gramps/pull/1302)

Discourse:

- [Editor dialogs not remembering table spacing - #13](https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871/13)

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 7, 2024, 12:37am UTC](https://gramps.discourse.group/t/editor-dialogs-not-remembering-table-spacing/1871/16 "2024-11-07T00:37:53Z")

</div>

> [@emyoulation](#):
>
> The Multiple Surname layout of the Person Editor has invalid column widths for Prefix and Connector. Nor does it remember resizing of those columns.

The `gramps.ini` had something that was causing problems. After making a change to the [`surnametab.py` in Lines78-Lines82](https://github.com/gramps-project/gramps/blob/5981c63a73578758fa6129513c71461ac12eff84/gramps/gui/editors/displaytabs/surnametab.py#L78C1-L82C6) and flushing the **pycache** files, resizing columns on the far right started being remembered and, on successive restarts of Gramps, resizing the next column to the left woould be remembered.

So that points to a corruption in the `person_editor_surnames` array in the `[spacing]` section of `gramps.ini` … so I flushed the whole `[spacing]` section. And the problem has gone away.

Reset Procedure
