#main_window
{
- background-image: url(background.png);
+ background: qlineargradient(x1: 0, y1: 0, x2:0,y2:1, stop: 0 white , stop: 1 #E8E8E8);
+}
+
+MiniWindow QPushButton {
+ color: #777;
+ border: 1px solid #CCC;
+ border-radius: 0px;
+ background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 white, stop: 1 #E6E6E6);
+ min-height: 25px;
+ min-width: 30px;
+}
+
+
+#send_button{
+ color: #E5F2FF;
+ border: 1px solid #3786E6;
+ border-radius: 4px;
+ background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #72B2F8, stop: 1 #3484E6);
+ min-width: 80px;
+ min-height: 23px;
+ padding: 2px;
+}
+
+#send_button:disabled{
+ color: #D3E8FE;
+ border: 1px solid #6DAEF7;
+ border-radius: 4px;
+ background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+ stop: 0 #A5CFFA, stop: 1 #72B2F8);
+ min-width: 80px;
+ min-height: 23px;
+ padding: 2px;
}
#address_input[readOnly=true], #amount_input[readOnly=true]
{
- font: italic;
- color: gray;
+ color: #ABABAB;
+ padding: 5px;
+ border-radius: 4px;
+ border: 1px solid #AAA9A9;
+ width: 225px;
+ margin-top: 4px;
}
#address_input[readOnly=false], #amount_input[readOnly=false]
{
+ padding: 2px;
+ border: 1px solid #AAA9A9;
font: normal;
- color: black;
-}
-
-#valid_address::indicator
-{
- width: 24px;
- height: 24px;
+ color: #424242;
+ border-radius: 4px;
+ font-size: 95%;
+ width: 225px;
+ margin-top: 4px;
}
-#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
{
- color: white;
+ color: #333;
}
-
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")
amount_layout.addWidget(self.amount_input)
amount_layout.addStretch()
- send_button = QPushButton(_("&Send"))
- send_button.setObjectName("send_button")
- self.connect(send_button, SIGNAL("clicked()"), self.send)
+ self.send_button = QPushButton(_("&Send"))
+ self.send_button.setObjectName("send_button")
+ self.send_button.setDisabled(True);
+ self.connect(self.send_button, SIGNAL("clicked()"), self.send)
main_layout = QGridLayout(self)
main_layout.addWidget(self.address_input, 1, 0, 1, -1)
main_layout.addLayout(amount_layout, 2, 0)
- main_layout.addWidget(send_button, 2, 1)
+ main_layout.addWidget(self.send_button, 2, 1)
menubar = QMenuBar()
file_menu = menubar.addMenu(_("&File"))
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)
self.setWindowTitle("Electrum - %s BTC" % btc_balance)
def amount_input_changed(self, amount_text):
+ self.check_button_status()
+
try:
amount = D(str(amount_text))
except decimal.InvalidOperation:
self.address_input.become_inactive()
self.amount_input.become_inactive()
+ def check_button_status(self):
+ if self.amount_input.text() != _("... and amount") and len(self.amount_input.text()) != 0:
+ self.send_button.setDisabled(False)
+ else:
+ self.send_button.setDisabled(True)
+
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)
def set_balance_text(self, btc_balance, quote_text):
if self.state == self.SHOW_CONNECTING:
self.state = self.SHOW_BALANCE
- self.balance_text = "<span style='font-size: 16pt'>%s</span> <span style='font-size: 10pt'>BTC</span> <span style='font-size: 10pt'>%s</span>" % (btc_balance, quote_text)
+ self.balance_text = "<span style='font-size: 18pt'>%s</span> <span style='font-size: 10pt'>BTC</span> <span style='font-size: 10pt'>%s</span>" % (btc_balance, quote_text)
if self.state == self.SHOW_BALANCE:
self.setText(self.balance_text)