Skip to content

Commit

Permalink
Merge pull request #5284 from devos50/reset_stack
Browse files Browse the repository at this point in the history
Click on menu items again now resets the view
  • Loading branch information
devos50 authored Apr 6, 2020
2 parents 634a432 + 041b1dd commit 01d196d
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/tribler-gui/tribler_gui/tribler_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,22 +984,31 @@ def deselect_all_menu_buttons(self, except_select=None):
button.setChecked(False)

def clicked_menu_button_search(self):
self.deselect_all_menu_buttons(self.left_menu_button_search)
self.deselect_all_menu_buttons()
self.left_menu_button_search.setChecked(True)
if self.stackedWidget.currentIndex() == PAGE_SEARCH_RESULTS:
self.search_results_page.go_back_to_level(0)
self.stackedWidget.setCurrentIndex(PAGE_SEARCH_RESULTS)
self.search_results_page.content_table.setFocus()
self.navigation_stack = []
self.hide_left_menu_playlist()

def clicked_menu_button_discovered(self):
self.deselect_all_menu_buttons(self.left_menu_button_discovered)
self.deselect_all_menu_buttons()
self.left_menu_button_discovered.setChecked(True)
if self.stackedWidget.currentIndex() == PAGE_DISCOVERED:
self.discovered_page.go_back_to_level(0)
self.stackedWidget.setCurrentIndex(PAGE_DISCOVERED)
self.discovered_page.reset_view()
self.discovered_page.content_table.setFocus()
self.navigation_stack = []
self.hide_left_menu_playlist()

def clicked_menu_button_my_channel(self):
self.deselect_all_menu_buttons(self.left_menu_button_my_channel)
self.deselect_all_menu_buttons()
self.left_menu_button_my_channel.setChecked(True)
if self.stackedWidget.currentIndex() == PAGE_EDIT_CHANNEL:
self.personal_channel_page.go_back_to_level(0)
self.stackedWidget.setCurrentIndex(PAGE_EDIT_CHANNEL)
self.personal_channel_page.reset_view()
self.personal_channel_page.content_table.setFocus()
Expand Down Expand Up @@ -1032,7 +1041,10 @@ def clicked_menu_button_debug(self):
self.debug_window.show()

def clicked_menu_button_subscriptions(self):
self.deselect_all_menu_buttons(self.left_menu_button_subscriptions)
self.deselect_all_menu_buttons()
self.left_menu_button_subscriptions.setChecked(True)
if self.stackedWidget.currentIndex() == PAGE_SUBSCRIBED_CHANNELS:
self.subscribed_channels_page.go_back_to_level(0)
self.stackedWidget.setCurrentIndex(PAGE_SUBSCRIBED_CHANNELS)
self.subscribed_channels_page.reset_view()
self.subscribed_channels_page.content_table.setFocus()
Expand Down

0 comments on commit 01d196d

Please sign in to comment.