Skip to content

Resolve "Index autoexpansion makes index cluttered and unusable after prolonged reading."

This MR adds the following features:

  • Remember and restore state for rows that were manually collapsed and expanded by the user. To save that information we use two new metadata keys 'index_expand' and 'index_collapse'.

    Metadata key 'index_expand' is a string containing the GtkTreePath's that the user has explicitly expanded, except those already marked expanded by the pdf producer data. The string is like "|path1|path2|path3|" (starting and ending in pipe). A case with only one element would be "|path1|". Case with no elements would be the empty string "". This is to facilitate the search of the paths.

    Metadata key 'index_collapse' is a string containing the GtkTreePath's that the pdf producer data had them marked as expanded but the user has explicitly collapsed them. The string format is the same as in 'index_expand'.

  • When scrolling through document, take the chance to collapse rows that have been automatically expanded previously. This avoids cluttering the tree view with too many entries when navigating documents that have heavily indexed outlines.

Closes #85 (closed)

[In a future MR, we could add actions "Collapse all" and "Expand all" to the Outline context menu, where currently "Print" is the only action on the context menu]

Edited by Nelson Ben

Merge request reports