From 16d5dfff095d9f734d0020110d35d826b8c2539a Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Tue, 15 Apr 2014 23:01:35 +0100 Subject: [PATCH] Keep button active if current category is clicked --- gramps/plugins/sidebar/categorysidebar.py | 6 +++--- gramps/plugins/sidebar/dropdownsidebar.py | 6 +++--- gramps/plugins/sidebar/expandersidebar.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gramps/plugins/sidebar/categorysidebar.py b/gramps/plugins/sidebar/categorysidebar.py index f4fa51913..d9785edfc 100644 --- a/gramps/plugins/sidebar/categorysidebar.py +++ b/gramps/plugins/sidebar/categorysidebar.py @@ -150,9 +150,9 @@ class CategorySidebar(BaseSidebar): """ Called when a button causes a category change. """ - # Make the button inactive. It will be set to active in the - # view_changed method if the change was successful. - button.set_active(False) + # Make the button active. If it was already active the category will + # not change. + button.set_active(True) self.viewmanager.goto_page(cat_num, None) def __make_sidebar_button(self, use_text, index, page_title, page_stock): diff --git a/gramps/plugins/sidebar/dropdownsidebar.py b/gramps/plugins/sidebar/dropdownsidebar.py index 0364c619b..d56f554de 100644 --- a/gramps/plugins/sidebar/dropdownsidebar.py +++ b/gramps/plugins/sidebar/dropdownsidebar.py @@ -113,9 +113,9 @@ class DropdownSidebar(BaseSidebar): """ Called when a category button is clicked. """ - # Make the button inactive. It will be set to active in the - # view_changed method if the change was successful. - button.set_active(False) + # Make the button active. If it was already active the category will + # not change. + button.set_active(True) self.viewmanager.goto_page(cat_num, None) def __view_clicked(self, button, cat_num): diff --git a/gramps/plugins/sidebar/expandersidebar.py b/gramps/plugins/sidebar/expandersidebar.py index 50b8b0993..d9683b2f5 100644 --- a/gramps/plugins/sidebar/expandersidebar.py +++ b/gramps/plugins/sidebar/expandersidebar.py @@ -149,9 +149,9 @@ class ExpanderSidebar(BaseSidebar): """ Called when a category button is clicked. """ - # Make the button inactive. It will be set to active in the - # view_changed method if the change was successful. - button.set_active(False) + # Make the button active. If it was already active the category will + # not change. + button.set_active(True) self.viewmanager.goto_page(cat_num, None) def __view_clicked(self, button, cat_num, view_num):