Browse Source

lightning: improve request tab layout

regtest_lnd
ThomasV 7 years ago
committed by SomberNight
parent
commit
200079dc69
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 31
      electrum/gui/qt/main_window.py

31
electrum/gui/qt/main_window.py

@ -916,19 +916,19 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
grid.setColumnStretch(3, 1)
self.receive_message_e = QLineEdit()
grid.addWidget(QLabel(_('Description')), 1, 0)
grid.addWidget(self.receive_message_e, 1, 1, 1, -1)
grid.addWidget(QLabel(_('Description')), 0, 0)
grid.addWidget(self.receive_message_e, 0, 1, 1, 4)
self.receive_message_e.textChanged.connect(self.update_receive_qr)
self.receive_amount_e = BTCAmountEdit(self.get_decimal_point)
grid.addWidget(QLabel(_('Requested amount')), 2, 0)
grid.addWidget(self.receive_amount_e, 2, 1)
grid.addWidget(QLabel(_('Requested amount')), 1, 0)
grid.addWidget(self.receive_amount_e, 1, 1)
self.receive_amount_e.textChanged.connect(self.update_receive_qr)
self.fiat_receive_e = AmountEdit(self.fx.get_currency if self.fx else '')
if not self.fx or not self.fx.is_enabled():
self.fiat_receive_e.setVisible(False)
grid.addWidget(self.fiat_receive_e, 2, 2, Qt.AlignLeft)
grid.addWidget(self.fiat_receive_e, 1, 2, Qt.AlignLeft)
self.connect_fields(self, self.receive_amount_e, self.fiat_receive_e, None)
self.expires_combo = QComboBox()
@ -941,26 +941,26 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
_('Expired requests have to be deleted manually from your list, in order to free the corresponding Bitcoin addresses.'),
_('The bitcoin address never expires and will always be part of this electrum wallet.'),
])
grid.addWidget(HelpLabel(_('Request expires'), msg), 3, 0)
grid.addWidget(self.expires_combo, 3, 1)
grid.addWidget(HelpLabel(_('Request expires'), msg), 2, 0)
grid.addWidget(self.expires_combo, 2, 1)
self.expires_label = QLineEdit('')
self.expires_label.setReadOnly(1)
self.expires_label.setFocusPolicy(Qt.NoFocus)
self.expires_label.hide()
grid.addWidget(self.expires_label, 3, 1)
grid.addWidget(self.expires_label, 2, 1)
self.receive_type = QComboBox()
self.receive_type.addItems([_('Bitcoin address'), _('Lightning')])
grid.addWidget(QLabel(_('Type')), 4, 0)
grid.addWidget(self.receive_type, 4, 1)
self.receive_type.addItems([_('On-chain'), _('Lightning')])
grid.addWidget(QLabel(_('Type')), 3, 0)
grid.addWidget(self.receive_type, 3, 1)
self.save_request_button = QPushButton(_('Create'))
self.save_request_button = QPushButton(_('Create Request'))
self.save_request_button.clicked.connect(self.create_invoice)
self.receive_buttons = buttons = QHBoxLayout()
buttons.addWidget(self.save_request_button)
buttons.addStretch(1)
grid.addLayout(buttons, 4, 2, 1, 2)
buttons.addWidget(self.save_request_button)
grid.addLayout(buttons, 4, 3, 1, 2)
self.receive_address_e = ButtonsTextEdit()
self.receive_address_e.addCopyButton(self.app)
@ -969,7 +969,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
self.receive_address_e.textChanged.connect(self.update_receive_address_styling)
self.receive_address_e.setFocusPolicy(Qt.ClickFocus)
self.receive_qr = QRCodeWidget(fixedSize=200)
self.receive_qr = QRCodeWidget(fixedSize=230)
self.receive_qr.mouseReleaseEvent = lambda x: self.toggle_qr_window()
self.receive_qr.enterEvent = lambda x: self.app.setOverrideCursor(QCursor(Qt.PointingHandCursor))
self.receive_qr.leaveEvent = lambda x: self.app.setOverrideCursor(QCursor(Qt.ArrowCursor))
@ -990,6 +990,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
hbox = QHBoxLayout()
hbox.addLayout(vbox_g)
hbox.addStretch()
hbox.addLayout(hbox_r)
w = QWidget()

Loading…
Cancel
Save