Skip to content

Commit

Permalink
Visual fixes in the payment window.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertrand256 committed May 14, 2018
1 parent f1adcd3 commit ad4f448
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 21 deletions.
5 changes: 1 addition & 4 deletions doc/build-dmt-windows.md
Expand Up @@ -59,11 +59,8 @@ The final step of the DMT build process compresses the executable file created d

### Install *Visual C++ 2015 Build Tools*

* Open your preferred web browser and go to http://landinghub.visualstudio.com/visual-cpp-build-tools
* Download the installer from http://go.microsoft.com/fwlink/?LinkId=691126:

* Download the installer:

![Install Visual C++ 2015 Build Tools](img/build-dmt/bwin-install-vstools-1.jpg)

* Run the installer with the *Default* option selected and click the *Install* button:

Expand Down
9 changes: 3 additions & 6 deletions src/send_funds_widgets.py
Expand Up @@ -54,7 +54,7 @@ def setupUi(self, Form):
self.main_layout.addWidget(self.lbl_dest_address, self.row_number, 0)

self.edt_dest_address = QLineEdit(Form)
self.edt_dest_address.setFixedWidth(self.address_widget_width)
self.edt_dest_address.setMinimumWidth(self.address_widget_width)
self.main_layout.addWidget(self.edt_dest_address, self.row_number, 1)

self.lbl_amount = QLabel(Form)
Expand Down Expand Up @@ -357,7 +357,6 @@ def setupUi(self, Form):
self.lay_addresses.setSpacing(3)
self.lay_addresses.setContentsMargins(0, 0, 0, 0)
self.lay_scroll_area.addLayout(self.lay_addresses)
self.lay_scroll_area.addStretch(0)

# controls for the 'change' address/amount (it's placed in the last row of the addresses grid layout):
self.lbl_change_address = QLabel(self.scroll_area_widget)
Expand All @@ -369,7 +368,7 @@ def setupUi(self, Form):
width = self.cbo_change_address.fontMetrics().width('XvqNXF23dRBksxjW3VQGrBtJw7vkhWhenQ')
self.address_widget_width = width + 40
# combobox width on macos needs to be tweaked:
self.cbo_change_address.setFixedWidth(self.address_widget_width + {'darwin': 5}.get(sys.platform, 0))
self.cbo_change_address.setMinimumWidth(self.address_widget_width + {'darwin': 5}.get(sys.platform, 0))
self.lay_addresses.addWidget(self.cbo_change_address, 0, 1)
self.lbl_change_amount = QLabel(self.scroll_area_widget)
self.set_change_value_label()
Expand All @@ -385,9 +384,7 @@ def setupUi(self, Form):
self.lbl_second_unit.setTextInteractionFlags(
QtCore.Qt.LinksAccessibleByMouse | QtCore.Qt.TextSelectableByMouse)
self.lay_addresses.addWidget(self.lbl_second_unit, 0, 4)
# spacer
spacer = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.lay_addresses.addItem(spacer, 0, 6)
self.lay_addresses.setColumnStretch(6, 1)

# the last row of the grid layout is dedicated to 'fee' controls
self.lbl_fee = QLabel(self.scroll_area_widget)
Expand Down
19 changes: 14 additions & 5 deletions src/transaction_dlg.py
Expand Up @@ -2,6 +2,8 @@
# -*- coding: utf-8 -*-
# Author: Bertrand256
# Created on: 2018-03
import sys

import re
from typing import Optional
import simplejson
Expand Down Expand Up @@ -157,26 +159,33 @@ def get_vout_value(vout: dict):
url = url.replace('%TXID%', self.tx_id)
send_tx_row = f'<tr><td class="lbl"><p class="lbl">Transaction ID:</p></td><td><a href="{url}">{self.tx_id}</a></td></tr>'

if sys.platform in ('win32', 'linux'):
base_font_size = '11'
title_font_size = '17'
else:
base_font_size = '13'
title_font_size = '20'

if self.transaction_sent:
title = 'Transaction summary - sent'
subtitle = '<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; ' \
'margin-right:0px; -qt-block-indent:0; text-indent:0px; ' \
'background-color:#2eb82e;color:white; padding: 1px 3px 1px 3px; ' \
'border-radius: 3px;"><span style=" font-size:14pt;">' \
f'border-radius: 3px;"><span style=" font-size:{base_font_size}pt;">' \
'Transaction successfully sent...</span></p>'
else:
title = 'Transaction summary - ready to send'
subtitle = '<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; ' \
'margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=' \
'"font-size:14pt;">Click the <b>&lt;Send transaction&gt;</b> button to ' \
f'"font-size:{base_font_size}pt;">Click the <b>&lt;Send transaction&gt;</b> button to ' \
'broadcast the transaction.</span></p>'

summary = f"""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
td.lbl{{text-align: right;vertical-align: top}} p.lbl{{margin: 0 5px 0 0; font-weight: bold}} p.val{{margin: 0 0 0 8px; color: navy}}
</style></head><body style=" font-family:'.SF NS Text'; font-size:13pt; font-weight:400; font-style:normal; margin-left:10px;margin-right:10px;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:20pt; font-weight:600;">{title}</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:14pt;"><br /></p>
</style></head><body style="font-size:{base_font_size}pt; font-weight:400; font-style:normal; margin-left:10px;margin-right:10px;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:{title_font_size}pt; font-weight:600;">{title}</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:{base_font_size}pt;"><br /></p>
{subtitle}
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
<table>
Expand Down
6 changes: 3 additions & 3 deletions src/ui/ui_config_dlg.py
Expand Up @@ -142,13 +142,13 @@ def setupUi(self, ConfigDlg):
self.layHardwareWallet.addWidget(self.label_3)
self.chbHwTrezor = QtWidgets.QRadioButton(self.tabMisc)
self.chbHwTrezor.setMinimumSize(QtCore.QSize(60, 0))
self.chbHwTrezor.setMaximumSize(QtCore.QSize(70, 16777215))
self.chbHwTrezor.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.chbHwTrezor.setChecked(True)
self.chbHwTrezor.setObjectName("chbHwTrezor")
self.layHardwareWallet.addWidget(self.chbHwTrezor)
self.chbHwKeepKey = QtWidgets.QRadioButton(self.tabMisc)
self.chbHwKeepKey.setMinimumSize(QtCore.QSize(70, 0))
self.chbHwKeepKey.setMaximumSize(QtCore.QSize(90, 16777215))
self.chbHwKeepKey.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.chbHwKeepKey.setObjectName("chbHwKeepKey")
self.layHardwareWallet.addWidget(self.chbHwKeepKey)
self.chbHwLedgerNanoS = QtWidgets.QRadioButton(self.tabMisc)
Expand Down Expand Up @@ -228,7 +228,7 @@ def setupUi(self, ConfigDlg):
self.verticalLayout.addWidget(self.buttonBox)

self.retranslateUi(ConfigDlg)
self.tabWidget.setCurrentIndex(0)
self.tabWidget.setCurrentIndex(1)
self.buttonBox.accepted.connect(ConfigDlg.accept)
self.buttonBox.rejected.connect(ConfigDlg.reject)
QtCore.QMetaObject.connectSlotsByName(ConfigDlg)
Expand Down
6 changes: 3 additions & 3 deletions src/ui/ui_config_dlg.ui
Expand Up @@ -32,7 +32,7 @@
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tabDashd">
<attribute name="title">
Expand Down Expand Up @@ -344,7 +344,7 @@
</property>
<property name="maximumSize">
<size>
<width>70</width>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
Expand All @@ -366,7 +366,7 @@
</property>
<property name="maximumSize">
<size>
<width>90</width>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
Expand Down
1 change: 1 addition & 0 deletions src/ui/ui_transaction_dlg.py
Expand Up @@ -49,6 +49,7 @@ def setupUi(self, TransactionDlg):
self.stacket_widget.addWidget(self.page_2)
self.verticalLayout.addWidget(self.stacket_widget)
self.gridLayout = QtWidgets.QGridLayout()
self.gridLayout.setContentsMargins(6, 2, 6, 6)
self.gridLayout.setSpacing(0)
self.gridLayout.setObjectName("gridLayout")
self.btn_details = QtWidgets.QPushButton(TransactionDlg)
Expand Down
12 changes: 12 additions & 0 deletions src/ui/ui_transaction_dlg.ui
Expand Up @@ -118,6 +118,18 @@ p, li { white-space: pre-wrap; }
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<property name="spacing">
<number>0</number>
</property>
Expand Down

0 comments on commit ad4f448

Please sign in to comment.