From 33a84f6be5c0e1ef80ebfd29a392992089ee3852 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Wed, 15 Mar 2023 11:27:05 +0100 Subject: [PATCH] view menu: use checkable actions --- electrum/gui/qt/main_window.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py index af381fb5f..4954f6260 100644 --- a/electrum/gui/qt/main_window.py +++ b/electrum/gui/qt/main_window.py @@ -341,8 +341,6 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener): def toggle_tab(self, tab): show = not self.config.get('show_{}_tab'.format(tab.tab_name), False) self.config.set_key('show_{}_tab'.format(tab.tab_name), show) - item_text = (_("Hide {}") if show else _("Show {}")).format(tab.tab_description) - tab.menu_action.setText(item_text) if show: # Find out where to place the tab index = len(self.tabs) @@ -701,8 +699,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener): def add_toggle_action(view_menu, tab): is_shown = self.config.get('show_{}_tab'.format(tab.tab_name), False) - item_name = (_("Hide {}") if is_shown else _("Show {}")).format(tab.tab_description) - tab.menu_action = view_menu.addAction(item_name, lambda: self.toggle_tab(tab)) + tab.menu_action = view_menu.addAction(tab.tab_description, lambda: self.toggle_tab(tab)) + tab.menu_action.setCheckable(True) + tab.menu_action.setChecked(is_shown) view_menu = menubar.addMenu(_("&View")) add_toggle_action(view_menu, self.addresses_tab)