Keep button active if current category is clicked

This commit is contained in:
Nick Hall 2014-04-15 23:01:35 +01:00
parent 4e239310a1
commit 16d5dfff09
3 changed files with 9 additions and 9 deletions

View File

@ -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):

View File

@ -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):

View File

@ -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):