follow-up 842229c
This commit is contained in:
@@ -111,15 +111,14 @@ LN_NUM_PAYMENT_ATTEMPTS = 10
|
|||||||
|
|
||||||
class StatusBarButton(QToolButton):
|
class StatusBarButton(QToolButton):
|
||||||
# note: this class has a custom stylesheet applied in stylesheet_patcher.py
|
# note: this class has a custom stylesheet applied in stylesheet_patcher.py
|
||||||
def __init__(self, icon, tooltip, func, size=0):
|
def __init__(self, icon, tooltip, func, sb_height):
|
||||||
QToolButton.__init__(self)
|
QToolButton.__init__(self)
|
||||||
self.setText('')
|
self.setText('')
|
||||||
self.setIcon(icon)
|
self.setIcon(icon)
|
||||||
self.setToolTip(tooltip)
|
self.setToolTip(tooltip)
|
||||||
self.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
|
self.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
|
||||||
self.setAutoRaise(True)
|
self.setAutoRaise(True)
|
||||||
if not size:
|
size = max(25, round(0.9 * sb_height))
|
||||||
size = max(25, round(1.8 * font_height()))
|
|
||||||
self.setMaximumWidth(size)
|
self.setMaximumWidth(size)
|
||||||
self.clicked.connect(self.onPress)
|
self.clicked.connect(self.onPress)
|
||||||
self.func = func
|
self.func = func
|
||||||
@@ -1528,7 +1527,6 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener):
|
|||||||
font_height = QFontMetrics(self.balance_label.font()).height()
|
font_height = QFontMetrics(self.balance_label.font()).height()
|
||||||
sb_height = max(35, int(2 * font_height))
|
sb_height = max(35, int(2 * font_height))
|
||||||
sb.setFixedHeight(sb_height)
|
sb.setFixedHeight(sb_height)
|
||||||
sb_inner_height = sb.childrenRect().height()
|
|
||||||
|
|
||||||
# remove border of all items in status bar
|
# remove border of all items in status bar
|
||||||
self.setStyleSheet("QStatusBar::item { border: 0px;} ")
|
self.setStyleSheet("QStatusBar::item { border: 0px;} ")
|
||||||
@@ -1548,18 +1546,18 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener):
|
|||||||
self.tasks_label = QLabel('')
|
self.tasks_label = QLabel('')
|
||||||
sb.addPermanentWidget(self.tasks_label)
|
sb.addPermanentWidget(self.tasks_label)
|
||||||
|
|
||||||
self.password_button = StatusBarButton(QIcon(), _("Password"), self.change_password_dialog, sb_inner_height)
|
self.password_button = StatusBarButton(QIcon(), _("Password"), self.change_password_dialog, sb_height)
|
||||||
sb.addPermanentWidget(self.password_button)
|
sb.addPermanentWidget(self.password_button)
|
||||||
|
|
||||||
sb.addPermanentWidget(StatusBarButton(read_QIcon("preferences.png"), _("Preferences"), self.settings_dialog, sb_inner_height))
|
sb.addPermanentWidget(StatusBarButton(read_QIcon("preferences.png"), _("Preferences"), self.settings_dialog, sb_height))
|
||||||
self.seed_button = StatusBarButton(read_QIcon("seed.png"), _("Seed"), self.show_seed_dialog, sb_inner_height)
|
self.seed_button = StatusBarButton(read_QIcon("seed.png"), _("Seed"), self.show_seed_dialog, sb_height)
|
||||||
sb.addPermanentWidget(self.seed_button)
|
sb.addPermanentWidget(self.seed_button)
|
||||||
self.lightning_button = StatusBarButton(read_QIcon("lightning.png"), _("Lightning Network"), self.gui_object.show_lightning_dialog, sb_inner_height)
|
self.lightning_button = StatusBarButton(read_QIcon("lightning.png"), _("Lightning Network"), self.gui_object.show_lightning_dialog, sb_height)
|
||||||
sb.addPermanentWidget(self.lightning_button)
|
sb.addPermanentWidget(self.lightning_button)
|
||||||
self.update_lightning_icon()
|
self.update_lightning_icon()
|
||||||
self.status_button = None
|
self.status_button = None
|
||||||
if self.network:
|
if self.network:
|
||||||
self.status_button = StatusBarButton(read_QIcon("status_disconnected.png"), _("Network"), self.gui_object.show_network_dialog, sb_inner_height)
|
self.status_button = StatusBarButton(read_QIcon("status_disconnected.png"), _("Network"), self.gui_object.show_network_dialog, sb_height)
|
||||||
sb.addPermanentWidget(self.status_button)
|
sb.addPermanentWidget(self.status_button)
|
||||||
run_hook('create_status_bar', sb)
|
run_hook('create_status_bar', sb)
|
||||||
self.setStatusBar(sb)
|
self.setStatusBar(sb)
|
||||||
|
|||||||
Reference in New Issue
Block a user