diff --git a/electrum/gui/qt/amountedit.py b/electrum/gui/qt/amountedit.py index d9e47ff28..efd768e5e 100644 --- a/electrum/gui/qt/amountedit.py +++ b/electrum/gui/qt/amountedit.py @@ -7,7 +7,7 @@ from PyQt5.QtCore import pyqtSignal, Qt from PyQt5.QtGui import QPalette, QPainter from PyQt5.QtWidgets import (QLineEdit, QStyle, QStyleOptionFrame) -from .util import char_width_in_lineedit +from .util import char_width_in_lineedit, ColorScheme from electrum.util import (format_satoshis_plain, decimal_point_to_base_unit_name, FEERATE_PRECISION, quantize_feerate) @@ -32,7 +32,6 @@ class AmountEdit(FreezableLineEdit): self.textChanged.connect(self.numbify) self.is_int = is_int self.is_shortcut = False - self.help_palette = QPalette() self.extra_precision = 0 def decimal_point(self): @@ -69,7 +68,7 @@ class AmountEdit(FreezableLineEdit): textRect = self.style().subElementRect(QStyle.SE_LineEditContents, panel, self) textRect.adjust(2, 0, -10, 0) painter = QPainter(self) - painter.setPen(self.help_palette.brush(QPalette.Disabled, QPalette.Text).color()) + painter.setPen(ColorScheme.GRAY.as_color()) painter.drawText(textRect, Qt.AlignRight | Qt.AlignVCenter, self.base_unit()) def get_amount(self) -> Union[None, Decimal, int]: diff --git a/electrum/gui/qt/locktimeedit.py b/electrum/gui/qt/locktimeedit.py index 53232ac2a..525671f5e 100644 --- a/electrum/gui/qt/locktimeedit.py +++ b/electrum/gui/qt/locktimeedit.py @@ -14,7 +14,7 @@ from PyQt5.QtWidgets import (QWidget, QLineEdit, QStyle, QStyleOptionFrame, QCom from electrum.i18n import _ from electrum.bitcoin import NLOCKTIME_MIN, NLOCKTIME_MAX, NLOCKTIME_BLOCKHEIGHT_MAX -from .util import char_width_in_lineedit +from .util import char_width_in_lineedit, ColorScheme class LockTimeEdit(QWidget): @@ -133,7 +133,6 @@ class LockTimeHeightEdit(LockTimeRawEdit): def __init__(self, parent=None): LockTimeRawEdit.__init__(self, parent) self.setFixedWidth(20 * char_width_in_lineedit()) - self.help_palette = QPalette() def paintEvent(self, event): super().paintEvent(event) @@ -142,7 +141,7 @@ class LockTimeHeightEdit(LockTimeRawEdit): textRect = self.style().subElementRect(QStyle.SE_LineEditContents, panel, self) textRect.adjust(2, 0, -10, 0) painter = QPainter(self) - painter.setPen(self.help_palette.brush(QPalette.Disabled, QPalette.Text).color()) + painter.setPen(ColorScheme.GRAY.as_color()) painter.drawText(textRect, Qt.AlignRight | Qt.AlignVCenter, "height") diff --git a/electrum/gui/qt/util.py b/electrum/gui/qt/util.py index bdaed6a34..fcd445db4 100644 --- a/electrum/gui/qt/util.py +++ b/electrum/gui/qt/util.py @@ -870,6 +870,7 @@ class ColorScheme: RED = ColorSchemeItem("#7c1111", "#f18c8c") BLUE = ColorSchemeItem("#123b7c", "#8cb3f2") DEFAULT = ColorSchemeItem("black", "white") + GRAY = ColorSchemeItem("gray", "gray") @staticmethod def has_dark_background(widget):