From 1c430a6b91e8c78aff51d08c01cc5ab25966d8bf Mon Sep 17 00:00:00 2001 From: MJBMZ Date: Thu, 26 Jul 2018 09:41:17 +0200 Subject: [PATCH] Replace rounded corners checkbox by dropdown It now allows rounded corners to be set more explicitly for different genders (None/Male/Female/Both). --- gramps/plugins/graph/gvfamilylines.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gramps/plugins/graph/gvfamilylines.py b/gramps/plugins/graph/gvfamilylines.py index 71b2ba1d3..40c8f1de4 100644 --- a/gramps/plugins/graph/gvfamilylines.py +++ b/gramps/plugins/graph/gvfamilylines.py @@ -79,6 +79,11 @@ _ARROWS = [ { 'name' : _("Descendants <- Ancestors"), 'value' : 'd' }, { 'name' : _("Descendants <-> Ancestors"), 'value' : 'da' }, { 'name' : _("Descendants - Ancestors"), 'value' : '' }] +_CORNERS = [ { 'name' : _("None"), 'value' : '' }, + { 'name' : _("Female"), 'value' : 'f' }, + { 'name' : _("Male"), 'value' : 'm' }, + { 'name' : _("Both"), 'value' : 'fm' }] + #------------------------------------------------------------------------ # # A quick overview of the classes we'll be using: @@ -151,9 +156,11 @@ class FamilyLinesOptions(MenuReportOptions): "is unknown it will be shown with gray.")) add_option("color", color) - roundedcorners = BooleanOption(_('Use rounded corners'), False) - roundedcorners.set_help( - _("Use rounded corners to differentiate between women and men.")) + roundedcorners = EnumeratedListOption(_("Rounded corners"), '') + for i in range( 0, len(_CORNERS) ): + roundedcorners.add_item(_CORNERS[i]["value"], _CORNERS[i]["name"]) + roundedcorners.set_help(_("Use rounded corners e.g. to differentiate " + "between women and men.")) add_option("useroundedcorners", roundedcorners) stdoptions.add_gramps_id_option(menu, category_name, ownline=True) @@ -910,7 +917,9 @@ class FamilyLinesReport(Report): border = "" fill = "" - if gender == person.FEMALE and self._useroundedcorners: + if gender == person.FEMALE and ("f" in self._useroundedcorners): + style = "rounded" + elif gender == person.MALE and ("m" in self._useroundedcorners): style = "rounded" elif gender == person.UNKNOWN: shape = "hexagon"