From 7682f00fb559ae41b8fa397ade7fb19d91ba2251 Mon Sep 17 00:00:00 2001 From: Maran Date: Tue, 31 Jul 2012 18:13:37 +0200 Subject: [PATCH] Removed the valid icon and make the text green or red instead --- data/style.css | 16 +++++----------- lib/gui_lite.py | 18 ++++++++++-------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/data/style.css b/data/style.css index 2f3a3f2..2ce441d 100644 --- a/data/style.css +++ b/data/style.css @@ -56,20 +56,14 @@ MiniWindow QPushButton { width: 225px; margin-top: 4px; } - -#valid_address::indicator -{ - width: 24px; - height: 24px; - margin-top: 2px; -} -#valid_address::indicator:checked +#address_input[isValid=true] { - image: url(icons/confirmed.png); + color: #4D9948 } -#valid_address::indicator:unchecked + +#address_input[isValid=false] { - image: url(icons/unconfirmed.png); + color: #CE4141 } #balance_label diff --git a/lib/gui_lite.py b/lib/gui_lite.py index 93fcd6b..321fd86 100644 --- a/lib/gui_lite.py +++ b/lib/gui_lite.py @@ -167,14 +167,8 @@ class MiniWindow(QDialog): address_completer.setModel(self.address_completions) self.address_input.setCompleter(address_completer) - self.valid_address = QCheckBox() - self.valid_address.setObjectName("valid_address") - self.valid_address.setEnabled(False) - self.valid_address.setChecked(False) - address_layout = QHBoxLayout() address_layout.addWidget(self.address_input) - address_layout.addWidget(self.valid_address) self.amount_input = TextedLineEdit(_("... and amount")) self.amount_input.setObjectName("amount_input") @@ -220,6 +214,10 @@ class MiniWindow(QDialog): self.layout().setSizeConstraint(QLayout.SetFixedSize) self.setObjectName("main_window") self.show() + + def recompute_style(self): + qApp.style().unpolish(self) + qApp.style().polish(self) def closeEvent(self, event): super(MiniWindow, self).closeEvent(event) @@ -311,11 +309,15 @@ class MiniWindow(QDialog): def address_field_changed(self, address): if self.actuator.is_valid(address): - self.valid_address.setChecked(True) self.check_button_status() + self.address_input.setProperty("isValid", True) + self.style().unpolish(self.address_input) + self.style().polish(self.address_input) else: - self.valid_address.setChecked(False) self.send_button.setDisabled(True) + self.address_input.setProperty("isValid", False) + self.style().unpolish(self.address_input) + self.style().polish(self.address_input) def copy_address(self): receive_popup = ReceivePopup(self.receive_button) -- 1.7.1