Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion electrum/gui/qt/address_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def on_double_click(self, idx):
self.main_window.show_address(addr)

def create_toolbar(self, config: 'SimpleConfig'):
toolbar, menu = self.create_toolbar_with_menu('')
toolbar, menu = self.create_toolbar_with_menu('', 'tab_addresses.png')
self.num_addr_label = toolbar.itemAt(0).widget()
self._toolbar_checkbox = menu.addToggle(_("Show Filter"), lambda: self.toggle_toolbar())
menu.addConfig(config.cv.FX_SHOW_FIAT_BALANCE_FOR_ADDRESSES, callback=self.main_window.app.update_fiat_signal.emit)
Expand Down
2 changes: 1 addition & 1 deletion electrum/gui/qt/channels_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def update_can_send(self, lnworker: LNWallet):
self.can_send_label.setText(msg)

def create_toolbar(self, config):
toolbar, menu = self.create_toolbar_with_menu('')
toolbar, menu = self.create_toolbar_with_menu('', 'lightning.png')
self.can_send_label = toolbar.itemAt(0).widget()
menu.addAction(_('Rebalance channels'), lambda: self.on_rebalance())
menu.addAction(read_QIcon('update.png'), _('Submarine swap'), lambda: self.main_window.run_swap_dialog())
Expand Down
2 changes: 2 additions & 0 deletions electrum/gui/qt/confirm_tx_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,8 @@ def cb():
self.pref_menu.addConfig(self.config.cv.WALLET_COIN_CHOOSER_OUTPUT_ROUNDING, callback=self.trigger_update)
self.pref_button = QToolButton()
self.pref_button.setIcon(read_QIcon("preferences.png"))
self.pref_button.setText(' ' + _('Tools'))
self.pref_button.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonTextBesideIcon)
self.pref_button.setMenu(self.pref_menu)
self.pref_button.setPopupMode(QToolButton.ToolButtonPopupMode.InstantPopup)
self.pref_button.setFocusPolicy(Qt.FocusPolicy.NoFocus)
Expand Down
2 changes: 1 addition & 1 deletion electrum/gui/qt/contact_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def get_edit_key_from_coordinate(self, row, col):
return self.get_role_data_from_coordinate(row, col, role=self.ROLE_CONTACT_KEY)

def create_toolbar(self, config):
toolbar, menu = self.create_toolbar_with_menu('')
toolbar, menu = self.create_toolbar_with_menu('', 'tab_contacts.png')
menu.addAction(_("&New contact"), self.main_window.new_contact_dialog)
menu.addAction(_("Import"), lambda: self.main_window.import_contacts())
menu.addAction(_("Export"), lambda: self.main_window.export_contacts())
Expand Down
2 changes: 1 addition & 1 deletion electrum/gui/qt/history_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ def on_combo(self, x):
self.hide_rows()

def create_toolbar(self, config: 'SimpleConfig'):
toolbar, menu = self.create_toolbar_with_menu('')
toolbar, menu = self.create_toolbar_with_menu('', 'tab_history.png')
self.num_tx_label = toolbar.itemAt(0).widget()
self._toolbar_checkbox = menu.addToggle(_("Filter by Date"), lambda: self.toggle_toolbar())
self.menu_fiat = menu.addConfig(config.cv.FX_HISTORY_RATES, short_desc=_('Show Fiat Values'), callback=self.main_window.app.update_fiat_signal.emit)
Expand Down
10 changes: 5 additions & 5 deletions electrum/gui/qt/my_treeview.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ def _do_toggle_config(
callback()


def create_toolbar_with_menu(config: 'SimpleConfig', title):
def create_toolbar_with_menu(config: 'SimpleConfig', title, icon_name: str = 'preferences.png'):
menu = QMenuWithConfig(config)
toolbar_button = QToolButton()
toolbar_button.setText(_('Tools'))
toolbar_button.setIcon(read_QIcon("preferences.png"))
toolbar_button.setText(' ' + _('Tools'))
toolbar_button.setIcon(read_QIcon(icon_name))
toolbar_button.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonTextBesideIcon)
toolbar_button.setMenu(menu)
toolbar_button.setPopupMode(QToolButton.ToolButtonPopupMode.InstantPopup)
Expand Down Expand Up @@ -418,8 +418,8 @@ def create_toolbar_buttons(self):
self.toolbar_buttons = buttons
return hbox

def create_toolbar_with_menu(self, title):
return create_toolbar_with_menu(self.config, title)
def create_toolbar_with_menu(self, title: str, icon: str):
return create_toolbar_with_menu(self.config, title, icon)

configvar_show_toolbar = None # type: Optional[ConfigVarWithConfig]
_toolbar_checkbox = None # type: Optional[QAction]
Expand Down
2 changes: 1 addition & 1 deletion electrum/gui/qt/receive_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def on_receive_swap():
from .request_list import RequestList
self.request_list = RequestList(self)
# toolbar
self.toolbar, menu = self.request_list.create_toolbar_with_menu('')
self.toolbar, menu = self.request_list.create_toolbar_with_menu('', 'tab_receive.png')

self.toggle_qr_button = QPushButton('')
self.toggle_qr_button.setIcon(get_icon_qrcode())
Expand Down
2 changes: 1 addition & 1 deletion electrum/gui/qt/send_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def reset_max(text):

self.invoices_label = QLabel(_('Invoices'))
self.invoice_list = InvoiceList(self)
self.toolbar, menu = self.invoice_list.create_toolbar_with_menu('')
self.toolbar, menu = self.invoice_list.create_toolbar_with_menu('', 'tab_send.png')

add_input_actions_to_context_menu(self.payto_e, menu)
self.paytomany_menu = menu.addToggle(_("&Pay to many"), self.toggle_paytomany)
Expand Down
2 changes: 1 addition & 1 deletion electrum/gui/qt/utxo_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(self, main_window: 'ElectrumWindow'):
self.setSortingEnabled(True)

def create_toolbar(self, config):
toolbar, menu = self.create_toolbar_with_menu('')
toolbar, menu = self.create_toolbar_with_menu('', 'tab_coins.png')
self.num_coins_label = toolbar.itemAt(0).widget()
menu.addAction(_('Coin control'), lambda: self.add_selection_to_coincontrol())

Expand Down