Fixes some fonts, introduces a new checkbox and fixes 0 amount history entries

This commit is contained in:
Sander Ferdinand 2018-01-28 00:14:42 +01:00 committed by moneromooo-monero
parent 53b5b7a5c7
commit 4977049425
15 changed files with 213 additions and 69 deletions

99
components/CheckBox2.qml Normal file
View file

@ -0,0 +1,99 @@
// Copyright (c) 2014-2015, The Monero Project
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other
// materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be
// used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.0
import QtQuick.Layouts 1.1
import "." 1.0
RowLayout {
id: checkBox
property alias text: label.text
property string checkedIcon: "../images/checkedIcon-black.png"
property string uncheckedIcon
property bool checked: false
property string background: "backgroundRect.color"
property int fontSize: 14 * scaleRatio
property alias fontColor: label.color
property int textMargin: 8 * scaleRatio
signal clicked()
height: 25 * scaleRatio
function toggle(){
checkBox.checked = !checkBox.checked
checkBox.clicked()
}
RowLayout {
Layout.fillWidth: true
Rectangle{
height: label.height
width: (label.width + indicatorRect.width + checkBox.textMargin)
color: "transparent"
anchors.left: parent.left
Text {
id: label
font.family: Style.fontLight
font.pixelSize: checkBox.fontSize
color: Style.defaultFontColor
wrapMode: Text.Wrap
Layout.fillWidth: true
anchors.left: parent.left
}
Rectangle {
id: indicatorRect
width: indicatorImage.width
height: label.height
anchors.left: label.right
anchors.leftMargin: textMargin
color: "transparent"
Image {
id: indicatorImage
anchors.centerIn: parent
source: "../images/whiteDropIndicator.png"
rotation: checkBox.checked ? 180 * scaleRatio : 0
verticalAlignment: parent.verticalCenter
}
}
MouseArea{
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
toggle();
}
}
}
}
}

View file

@ -73,9 +73,9 @@ Item {
anchors.top: parent.top
anchors.topMargin: 2
anchors.left: parent.left
font.family: Style.fontRegular.name
font.family: Style.fontLight
font.pixelSize: 14
font.bold: true
font.bold: false
textFormat: Text.RichText
color: Style.defaultFontColor

View file

@ -156,7 +156,7 @@ ListView {
id: txrxLabel
anchors.left: arrowImage.right
anchors.leftMargin: 18 * scaleRatio
font.family: Style.fontRegular.name
font.family: Style.fontLight.name
font.pixelSize: 14 * scaleRatio
text: isOut ? "Sent" : "Received"
color: "#808080"
@ -195,7 +195,22 @@ ListView {
font.family: Style.fontBold.name
font.pixelSize: 18 * scaleRatio
font.bold: true
text: { return (displayAmount * 1) + " XMR" } // hack, removes trailing zeros
text: {
// hack, removes trailing zeros
var amount = (displayAmount * 1);
// sometimes, displayAmount is 0 - no idea why.
// in that case, we try to get the amount from
// the `destinations` string.
if(amount === 0){
amount = destinations.split(" ")[0].split(":")[0];
amount = (amount *1);
}
// sometimes this destinations string also shows 0,
// at which point we run out of options.
return amount + " XMR";
}
color: isOut ? "white" : "#2eb358"
}

View file

@ -35,14 +35,21 @@ import "." 1.0
TextArea {
property bool error: false
property bool addressValidation: false
property bool wrapAnywhere: true
id: textArea
font.family: Style.fontRegular.name
font.pixelSize: 18 * scaleRatio
font.bold: true
font.bold: false
horizontalAlignment: TextInput.AlignLeft
selectByMouse: true
color: Style.defaultFontColor
wrapMode: Text.WrapAnywhere
wrapMode: {
if(wrapAnywhere){
return Text.WrapAnywhere;
} else {
return Text.WordWrap;
}
}
onTextChanged: {
if(addressValidation){
// js replacement for `RegExpValidator { regExp: /[0-9A-Fa-f]{95}/g }`

View file

@ -40,12 +40,10 @@ Item {
property int fontSize: 16 * scaleRatio
property bool fontBold: false
property string fontColor: Style.defaultFontColor
property string fontFamily: Style.fontRegular.name
property string fontFamily: ""
property alias wrapMode: label.wrapMode
property alias horizontalAlignment: label.horizontalAlignment
signal linkActivated()
// width: icon.x + icon.width * scaleRatio
// height: icon.height * scaleRatio
height: label.height * scaleRatio
width: label.width * scaleRatio
Layout.topMargin: 10 * scaleRatio
@ -55,7 +53,13 @@ Item {
anchors.bottom: parent.bottom
anchors.bottomMargin: 2 * scaleRatio
anchors.left: parent.left
font.family: fontFamily
font.family: {
if(fontFamily){
return fontFamily;
} else {
return Style.fontLight;
}
}
font.pixelSize: fontSize
font.bold: fontBold
color: fontColor

View file

@ -53,17 +53,16 @@ Item {
property bool borderDisabled: false
property int fontSize: 18 * scaleRatio
property bool showBorder: true
property bool fontBold: true
property bool fontBold: false
property alias fontColor: input.color
property bool error: false
property alias labelText: inputLabel.text
property alias labelColor: inputLabel.color
property alias labelTextFormat: inputLabel.textFormat
property string labelFontFamily: Style.fontRegular.name
property string backgroundColor: "transparent"
property string tipText: ""
property int labelFontSize: 14 * scaleRatio
property bool labelFontBold: true
property bool labelFontBold: false
property alias labelWrapMode: inputLabel.wrapMode
property alias labelHorizontalAlignment: inputLabel.horizontalAlignment
property bool showingHeader: inputLabel.text !== "" || copyButton
@ -100,7 +99,7 @@ Item {
anchors.top: parent.top
anchors.left: parent.left
anchors.topMargin: 2 * scaleRatio
font.family: labelFontFamily
font.family: Style.fontLight
font.pixelSize: labelFontSize
font.bold: labelFontBold
textFormat: Text.RichText
@ -132,7 +131,7 @@ Item {
id: inputItem
height: inputHeight * scaleRatio
anchors.top: showingHeader ? inputLabel.bottom : parent.top
anchors.topMargin: showingHeader ? 6 * scaleRatio : 2
anchors.topMargin: showingHeader ? 12 * scaleRatio : 2
width: parent.width
Text {
@ -189,7 +188,7 @@ Item {
anchors.fill: parent
anchors.leftMargin: inlineIcon.visible ? 38 : 0
font.pixelSize: item.fontSize
font.bold: fontBold
font.bold: item.fontBold
onEditingFinished: item.editingFinished()
onAccepted: item.accepted();
onTextChanged: item.textUpdated()

View file

@ -39,9 +39,10 @@ ColumnLayout {
property alias readOnly: multiLine.readOnly
property alias addressValidation: multiLine.addressValidation
property alias labelButtonText: labelButton.text
property bool labelFontBold: true
property bool labelFontBold: false
property bool labelButtonVisible: false
property bool copyButton: false
property bool wrapAnywhere: true
signal labelButtonClicked();
signal inputLabelLinkActivated();
@ -56,7 +57,7 @@ ColumnLayout {
id: inputLabel
anchors.top: parent.top
anchors.left: parent.left
font.family: Style.fontRegular.name
font.family: Style.fontLight
font.pixelSize: 14 * scaleRatio
font.bold: labelFontBold
textFormat: Text.RichText
@ -94,6 +95,7 @@ ColumnLayout {
Layout.fillWidth: true
topPadding: 10 * scaleRatio
bottomPadding: 10 * scaleRatio
wrapAnywhere: parent.wrapAnywhere
Text {
id: placeholderLabel

View file

@ -39,12 +39,12 @@ Item {
property string textColor: "#FFFFFF"
property alias currentIndex: column.currentIndex
property bool expanded: false
property int dropdownHeight: 40
property int dropdownHeight: 42
property int fontHeaderSize: 16 * scaleRatio
property int fontItemSize: 14 * scaleRatio
property string colorHeaderBackground: "transparent"
property bool headerBorder: true
property bool headerFontBold: true
property bool headerFontBold: false
height: dropdownHeight
@ -90,7 +90,7 @@ Item {
anchors.left: parent.left
anchors.leftMargin: 12 * scaleRatio
elide: Text.ElideRight
font.family: Style.fontRegular.name
font.family: Style.fontRegular
font.bold: dropdown.headerFontBold
font.pixelSize: dropdown.fontHeaderSize
color: "#FFFFFF"

View file

@ -219,7 +219,6 @@ Rectangle {
Layout.minimumWidth: 120 * scaleRatio
text: qsTr("Sort") + translationManager.emptyString
fontSize: 14
fontBold: true
}
ListModel {

View file

@ -31,73 +31,76 @@ import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2
import "../version.js" as Version
import "../components"
import moneroComponents.Clipboard 1.0
import "../version.js" as Version
import "../components"
import "." 1.0
Rectangle {
property bool viewOnly: false
id: page
color: "#F0EEEE"
color: "transparent"
Clipboard { id: clipboard }
ColumnLayout {
id: mainLayout
anchors.margins: 17 * scaleRatio
anchors.left: parent.left
anchors.top: parent.top
anchors.right: parent.right
spacing: 20 * scaleRatio
anchors.margins: (isMobile)? 17 : 20
anchors.topMargin: 40 * scaleRatio
spacing: 30 * scaleRatio
Layout.fillWidth: true
//! Manage wallet
ColumnLayout {
Layout.fillWidth: true
Label {
Layout.fillWidth: true
fontSize: 22 * scaleRatio
Layout.topMargin: 10 * scaleRatio
text: qsTr("Mnemonic seed") + translationManager.emptyString
}
Rectangle {
Layout.fillWidth: true
height: 1
color: "#DEDEDE"
height: 2
color: Style.dividerColor
opacity: Style.dividerOpacity
Layout.bottomMargin: 10 * scaleRatio
}
TextEdit {
LineEditMulti{
id: seedText
wrapMode: TextEdit.Wrap
Layout.fillWidth: true;
font.pixelSize: 14 * scaleRatio
spacing: 0
copyButton: true
addressValidation: false
readOnly: true
MouseArea {
anchors.fill: parent
onClicked: {
appWindow.showStatusMessage(qsTr("Double tap to copy"),3)
}
onDoubleClicked: {
parent.selectAll()
parent.copy()
parent.deselect()
console.log("copied to clipboard");
appWindow.showStatusMessage(qsTr("Seed copied to clipboard"),3)
}
}
wrapAnywhere: false
}
}
ColumnLayout {
Layout.fillWidth: true
Label {
Layout.fillWidth: true
fontSize: 22 * scaleRatio
Layout.topMargin: 10 * scaleRatio
text: qsTr("Keys") + translationManager.emptyString
}
Rectangle {
Layout.fillWidth: true
height: 1
color: "#DEDEDE"
height: 2
color: Style.dividerColor
opacity: Style.dividerOpacity
Layout.bottomMargin: 10 * scaleRatio
}
TextEdit {
id: keysText
@ -106,6 +109,7 @@ Rectangle {
font.pixelSize: 14 * scaleRatio
textFormat: TextEdit.RichText
readOnly: true
color: Style.defaultFontColor
MouseArea {
anchors.fill: parent
onClicked: {
@ -124,21 +128,26 @@ Rectangle {
ColumnLayout {
Layout.fillWidth: true
Label {
Layout.fillWidth: true
fontSize: 22 * scaleRatio
Layout.topMargin: 10 * scaleRatio
text: qsTr("Export wallet") + translationManager.emptyString
}
Rectangle {
Layout.fillWidth: true
height: 1
color: "#DEDEDE"
height: 2
color: Style.dividerColor
opacity: Style.dividerOpacity
Layout.bottomMargin: 10 * scaleRatio
}
RowLayout {
StandardButton {
enabled: !fullWalletQRCode.visible
id: showFullQr
small: true
text: qsTr("Spendable Wallet") + translationManager.emptyString
onClicked: {
viewOnlyQRCode.visible = false
@ -147,6 +156,7 @@ Rectangle {
StandardButton {
enabled: fullWalletQRCode.visible
id: showViewOnlyQr
small: true
text: qsTr("View Only Wallet") + translationManager.emptyString
onClicked: {
viewOnlyQRCode.visible = true
@ -155,7 +165,6 @@ Rectangle {
Layout.bottomMargin: 30 * scaleRatio
}
Image {
visible: !viewOnlyQRCode.visible
id: fullWalletQRCode

View file

@ -34,7 +34,7 @@ import moneroComponents.Wallet 1.0
Rectangle {
id: root
color: "#F0EEEE"
color: "transparent"
property var currentHashRate: 0
/* main layout */
@ -74,13 +74,16 @@ Rectangle {
text: qsTr("Mining with your computer helps strengthen the Monero network. The more that people mine, the harder it is for the network to be attacked, and every little bit helps.<br> <br>Mining also gives you a small chance to earn some Monero. Your computer will create hashes looking for block solutions. If you find a block, you will get the associated reward. Good luck!") + translationManager.emptyString
wrapMode: Text.Wrap
Layout.fillWidth: true
font.family: Style.fontRegular
font.pixelSize: 14 * scaleRatio
color: Style.defaultFontColor
}
RowLayout {
id: soloMinerThreadsRow
Label {
id: soloMinerThreadsLabel
color: "#4A4949"
color: Style.defaultFontColor
text: qsTr("CPU threads") + translationManager.emptyString
fontSize: 16
Layout.preferredWidth: 120
@ -122,7 +125,7 @@ Rectangle {
RowLayout {
Label {
id: manageSoloMinerLabel
color: "#4A4949"
color: Style.defaultFontColor
text: qsTr("Manage miner") + translationManager.emptyString
fontSize: 16
}
@ -165,6 +168,7 @@ Rectangle {
Text {
id: statusText
text: qsTr("Status: not mining")
color: Style.defaultFontColor
textFormat: Text.RichText
wrapMode: Text.Wrap
}

View file

@ -239,6 +239,9 @@ Rectangle {
Layout.minimumWidth: 100 * scaleRatio
daemonAddrLabelText: qsTr("Address")
daemonPortLabelText: qsTr("Port")
lineEditBackgroundColor: "transparent"
lineEditFontColor: "white"
lineEditBorderColor: Qt.rgba(255, 255, 255, 0.35)
daemonAddrText: persistentSettings.remoteNodeAddress.split(":")[0].trim()
daemonPortText: (persistentSettings.remoteNodeAddress.split(":")[1].trim() == "") ? "18081" : persistentSettings.remoteNodeAddress.split(":")[1]
onEditingFinished: {

View file

@ -120,7 +120,7 @@ Rectangle {
anchors.top: parent.top
anchors.right: parent.right
spacing: 26 * scaleRatio
spacing: 30 * scaleRatio
GridLayout {
columns: (isMobile)? 1 : 2
@ -160,8 +160,9 @@ Rectangle {
Layout.fillWidth: true
Label {
id: transactionPriority
Layout.topMargin: 14
text: qsTr("Transaction priority") + translationManager.emptyString
fontBold: true
fontBold: false
fontSize: 14
}
// Note: workaround for translations in listElements
@ -185,6 +186,7 @@ Rectangle {
StandardDropdown {
Layout.fillWidth: true
id: priorityDropdown
Layout.topMargin: 6
shadowReleasedColor: "#FF4304"
shadowPressedColor: "#B32D00"
releasedColor: "#363636"
@ -278,8 +280,7 @@ Rectangle {
StandardButton {
id: sendButton
rightIcon: "../images/rightIcon.png"
Layout.bottomMargin: 17 * scaleRatio
Layout.topMargin: 17 * scaleRatio
Layout.topMargin: 4 * scaleRatio
text: qsTr("Send") + translationManager.emptyString
enabled : !appWindow.viewOnly && pageRoot.checkInformation(amountLine.text, addressLine.text, paymentIdLine.text, appWindow.persistentSettings.testnet)
onClicked: {
@ -317,7 +318,7 @@ Rectangle {
} // pageRoot
Rectangle {
id:desaturate
id: desaturate
color:"black"
anchors.fill: parent
opacity: 0.1
@ -329,18 +330,18 @@ Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: (isMobile)? 17 : 20
anchors.topMargin: 40 * scaleRatio
anchors.topMargin: 32 * scaleRatio
spacing: 26 * scaleRatio
enabled: !viewOnly || pageRoot.enabled
RowLayout {
CheckBox {
CheckBox2 {
id: showAdvancedCheckbox
checked: persistentSettings.transferShowAdvanced
onClicked: {
persistentSettings.transferShowAdvanced = !persistentSettings.transferShowAdvanced
}
text: qsTr("Show advanced options") + translationManager.emptyString
text: qsTr("Advanced options") + translationManager.emptyString
}
}
@ -401,6 +402,7 @@ Rectangle {
id: sweepUnmixableButton
text: qsTr("Sweep Unmixable") + translationManager.emptyString
enabled : pageRoot.enabled
small: true
onClicked: {
console.log("Transfer: sweepUnmixableClicked")
root.sweepUnmixableClicked()
@ -412,6 +414,7 @@ Rectangle {
text: qsTr("Create tx file") + translationManager.emptyString
visible: appWindow.viewOnly
enabled: pageRoot.checkInformation(amountLine.text, addressLine.text, paymentIdLine.text, appWindow.persistentSettings.nettype)
small: true
onClicked: {
console.log("Transfer: saveTx Clicked")
var priority = priorityModelV5.get(priorityDropdown.currentIndex).priority
@ -428,6 +431,7 @@ Rectangle {
StandardButton {
id: signTxButton
text: qsTr("Sign tx file") + translationManager.emptyString
small: true
visible: !appWindow.viewOnly
onClicked: {
console.log("Transfer: sign tx clicked")
@ -438,6 +442,7 @@ Rectangle {
StandardButton {
id: submitTxButton
text: qsTr("Submit tx file") + translationManager.emptyString
small: true
visible: appWindow.viewOnly
enabled: pageRoot.enabled
onClicked: {
@ -446,12 +451,8 @@ Rectangle {
}
}
}
}
//SignTxDialog
FileDialog {
id: signTxDialog

View file

@ -201,5 +201,6 @@
<file>images/downArrow.png</file>
<file>images/historyBorderRadius.png</file>
<file>components/HistoryTableInnerColumn.qml</file>
<file>components/CheckBox2.qml</file>
</qresource>
</RCC>

View file

@ -144,6 +144,7 @@ ColumnLayout {
Layout.fillWidth: true
Layout.topMargin: 20 * scaleRatio
fontSize: 14 * scaleRatio
fontColor: "black"
text: qsTr("Blockchain location") + translationManager.emptyString
}
LineEdit {