From 2c9bad61080d6fb311e2840406788c6b641ddb0c Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Fri, 9 Dec 2016 19:47:26 -0800 Subject: [PATCH] make report dialog height less than 600, for smaller displays [SC] --- gramps/plugins/drawreport/statisticschart.py | 23 ++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/gramps/plugins/drawreport/statisticschart.py b/gramps/plugins/drawreport/statisticschart.py index a72887011..2be3cff79 100644 --- a/gramps/plugins/drawreport/statisticschart.py +++ b/gramps/plugins/drawreport/statisticschart.py @@ -1058,17 +1058,19 @@ class StatisticsChartOptions(MenuReportOptions): # ------------------------------------------------- # List of available charts on separate option tabs idx = 0 - half = len(_Extract.extractors) // 2 + third = (len(_Extract.extractors) + 1) // 3 chart_types = [] for (chart_opt, ctuple) in _Extract.extractors.items(): chart_types.append((_(ctuple[1]), chart_opt, ctuple)) sorted_chart_types = sorted(chart_types, key=lambda x: glocale.sort_key(x[0])) for (translated_option_name, opt_name, ctuple) in sorted_chart_types: - if idx <= half: - category_name = _("Charts 1") - else: + if idx >= (third * 2): + category_name = _("Charts 3") + elif idx >= third: category_name = _("Charts 2") + else: + category_name = _("Charts 1") opt = BooleanOption(translated_option_name, False) opt.set_help(_("Include charts with indicated data.")) menu.add_option(category_name, opt_name, opt) @@ -1087,8 +1089,8 @@ class StatisticsChartOptions(MenuReportOptions): person = self.__db.get_person_from_gramps_id(gid) nfv = self._nf.get_value() filter_list = utils.get_person_filters(person, - include_single=False, - name_format=nfv) + include_single=False, + name_format=nfv) self.__filter.set_filters(filter_list) def __filter_changed(self): @@ -1097,12 +1099,11 @@ class StatisticsChartOptions(MenuReportOptions): disable the person option """ filter_value = self.__filter.get_value() - if filter_value in [1, 2, 3, 4]: - # Filters 1, 2, 3 and 4 rely on the center person - self.__pid.set_available(True) - else: - # The rest don't + if filter_value == 0: # "Entire Database" (as "include_single=False") self.__pid.set_available(False) + else: + # The other filters need a center person (assume custom ones do) + self.__pid.set_available(True) def make_default_style(self, default_style): """Make the default output style for the Statistics report."""