Difference between revisions of "GEPS 002: RelationView Expand and Collapse"

From Gramps
Jump to: navigation, search
(User Contributions)
(Example/Screenshot)
Line 27: Line 27:
  
 
[[Image:expand-3.png|400px]]
 
[[Image:expand-3.png|400px]]
 +
 +
Finally, a work in progress: a non-obtrusive triangle label that acts as a button.
 +
 +
[[Image:expand-4.png|400px]]
  
 
==Code==
 
==Code==

Revision as of 02:24, 5 September 2007

Proposed changes for enhancing RelationView by adding expand/collapse

Introduction

This page proposes and discusses possible changes to the RelationView of the GRAMPS GUI (Relationships).

The first proposed change is the addition of expand/collapse buttons on the Parents and Family lines. This would allow the user to hide the details of the Parents, or a particular Family. This functionality helps a researcher focus their attention on one aspect (family) of the person.

This differs from the "View" -> "Show Siblings" and "Show Details" in a couple of ways:

  1. the expand/collapse is specific to a particular family
  2. only lasts for the current session

The change does remember what families have been collapsed, so when you return to a person, you get the same view as previous view (for this session).

Example/Screenshot

The first screenshot shows the RelationView as normal, but includes the "Collapse" icon (currently a magnifying glass with a minus sign.)

Expand-1.png

The second screenshot shows the RelationView, and now includes the "Expand" icon (currently a magnifying glass with a plus sign.)

Expand-2.png

The third screenshot shows the RelationView with the suggestions made by Anne and Benny: the collapse list is kept based on the active person, and collapsed sections now have a nice summary text.

Expand-3.png

Finally, a work in progress: a non-obtrusive triangle label that acts as a button.

Expand-4.png

Code

The code (version 02) necessary to implement these changes can be found here. This patch can be applied to version gramps30.

Options

The families/parents to expand/collapse are kept in a list which hangs off of a dictionary entry of the active person's handle. The list is only kept during the current session; it will revert to all expanded when restarted.

The icon can be changed to something better. I wanted a triangle like on the people view (">" when collapsed, "V" when expanded) but there wasn't anything like that in stock gtk icons). If someone is skilled in making these (or if you have a better idea) please help.

Impact

Requires three phrases for translation: "Expand/Collapse this section", "(%d children)", and "(%d siblings)".

Has a minimal screen impact.

The handles of families that are collapsed are placed into a list referenced by a dictionary lookup. A substantial number of families per active-person would have to be collapsed for this to have an effect on performance. This is deemed to be unlikely.

The latest version with the summaries per collapsed line was a little more intrusive into existing code. The code that generates the RelationView is a combination of predetermined columns and dynamic rows counted as it generates entries. In a couple of places, the row was advanced in one place, but required a backup to put the summary on that line. I decided to implement it in such a manner as to keep similar logic together (ie, the code to count children is in the same method that prints the children, depending on collapse/expand).

I had to add person as an argument to a few methods. I gave it a None default in case these are called outside of this file (I didn't see any).

Future versions

One could expand/collapse the siblings (which would make it so that the Show Siblings option would not be needed). However, this could make the screen too busy (considering that we would like to add some additional elements to this page).

User Contributions

A discussion of these ideas can be found on the gramps-dev mailing list.