From 868fbe2f2d19681c84c432b472e86328c7c6e61d Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Thu, 7 Dec 2017 17:33:46 +0100 Subject: [PATCH] Move default font color to Style.qml --- components/Input.qml | 3 +-- components/InputMulti.qml | 2 +- components/Label.qml | 6 ++++-- components/LineEdit.qml | 2 +- components/Style.qml | 3 +++ components/TextBlock.qml | 4 ++++ pages/Transfer.qml | 21 +++------------------ 7 files changed, 17 insertions(+), 24 deletions(-) diff --git a/components/Input.qml b/components/Input.qml index 55a9cde5..c168e8e6 100644 --- a/components/Input.qml +++ b/components/Input.qml @@ -29,7 +29,6 @@ import QtQuick.Controls 2.2 import QtQuick 2.10 import "." 1.0 -import "../components" TextField { @@ -38,7 +37,7 @@ TextField { font.bold: true horizontalAlignment: TextInput.AlignLeft selectByMouse: true - color: "white" + color: Style.defaultFontColor background: Rectangle { color: "transparent" diff --git a/components/InputMulti.qml b/components/InputMulti.qml index 3bc194fd..0f030f2d 100644 --- a/components/InputMulti.qml +++ b/components/InputMulti.qml @@ -41,7 +41,7 @@ TextArea { font.bold: true horizontalAlignment: TextInput.AlignLeft selectByMouse: true - color: "white" + color: Style.defaultFontColor wrapMode: Text.WrapAnywhere onTextChanged: { if(addressValidation){ diff --git a/components/Label.qml b/components/Label.qml index 3de0eadb..86618c9e 100644 --- a/components/Label.qml +++ b/components/Label.qml @@ -29,6 +29,8 @@ import QtQuick 2.0 import QtQuick.Layouts 1.1 +import "." 1.0 + Item { id: item property alias text: label.text @@ -49,10 +51,10 @@ Item { anchors.bottom: parent.bottom anchors.bottomMargin: 2 * scaleRatio anchors.left: parent.left - font.family: "Arial" + font.family: Style.fontRegular.name font.pixelSize: fontSize font.bold: fontBold - color: "white" + color: Style.defaultFontColor onLinkActivated: item.linkActivated() } diff --git a/components/LineEdit.qml b/components/LineEdit.qml index debc396d..b1ef6ee6 100644 --- a/components/LineEdit.qml +++ b/components/LineEdit.qml @@ -95,7 +95,7 @@ Item { font.pixelSize: labelFontSize font.bold: labelFontBold textFormat: Text.RichText - color: "white" + color: Style.defaultFontColor onLinkActivated: item.labelLinkActivated() MouseArea { diff --git a/components/Style.qml b/components/Style.qml index 2cab3cfe..b7077095 100644 --- a/components/Style.qml +++ b/components/Style.qml @@ -8,6 +8,7 @@ QtObject { property QtObject fontLight: FontLoader { id: _fontLight; source: "qrc:/fonts/SFUIDisplay-Light.otf"; } property QtObject fontRegular: FontLoader { id: _fontRegular; source: "qrc:/fonts/SFUIDisplay-Regular.otf"; } + property string defaultFontColor: "white" property string inputBoxBackground: "black" property string inputBoxBackgroundError: "#FFDDDD" property string inputBoxColor: "white" @@ -15,4 +16,6 @@ QtObject { property string buttonBackgroundColorDisabled: "#3B3B3B" property string buttonTextColor: "white" property string buttonTextColorDisabled: "black" + property string dividerColor: "white" + property real dividerOpacity: 0.25 } diff --git a/components/TextBlock.qml b/components/TextBlock.qml index 684b6240..875a4bf7 100644 --- a/components/TextBlock.qml +++ b/components/TextBlock.qml @@ -1,6 +1,10 @@ import QtQuick 2.0 +import "." 1.0 + TextEdit { + color: Style.defaultFontColor + font.family: Style.fontRegular.name wrapMode: Text.Wrap readOnly: true selectByMouse: true diff --git a/pages/Transfer.qml b/pages/Transfer.qml index 7296d190..80604763 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -213,7 +213,7 @@ Rectangle { font.pixelSize: 16 * scaleRatio font.bold: labelFontBold textFormat: Text.RichText - color: "white" + color: Style.defaultFontColor onLinkActivated: { appWindow.showPageRequest("AddressBook") } text: qsTr("\ Address ( Address book )") @@ -292,10 +292,6 @@ Rectangle { StandardButton { id: qrfinderButton text: qsTr("QR Code") + translationManager.emptyString - shadowReleasedColor: "#FF4304" - shadowPressedColor: "#B32D00" - releasedColor: "#FF6C3C" - pressedColor: "#FF4304" visible : appWindow.qrScannerEnabled enabled : visible width: visible ? 60 * scaleRatio : 0 @@ -398,7 +394,8 @@ Rectangle { visible: persistentSettings.transferShowAdvanced Layout.fillWidth: true height: 1 - color: "#DEDEDE" + color: Style.dividerColor + opacity: Style.dividerOpacity Layout.bottomMargin: 30 * scaleRatio } @@ -450,10 +447,6 @@ Rectangle { StandardButton { id: sweepUnmixableButton text: qsTr("Sweep Unmixable") + translationManager.emptyString - shadowReleasedColor: "#FF4304" - shadowPressedColor: "#B32D00" - releasedColor: "#FF6C3C" - pressedColor: "#FF4304" enabled : pageRoot.enabled onClicked: { console.log("Transfer: sweepUnmixableClicked") @@ -464,10 +457,6 @@ Rectangle { StandardButton { id: saveTxButton text: qsTr("Create tx file") + translationManager.emptyString - shadowReleasedColor: "#FF4304" - shadowPressedColor: "#B32D00" - releasedColor: "#FF6C3C" - pressedColor: "#FF4304" visible: appWindow.viewOnly enabled: pageRoot.checkInformation(amountLine.text, addressLine.text, paymentIdLine.text, appWindow.persistentSettings.nettype) onClicked: { @@ -486,10 +475,6 @@ Rectangle { StandardButton { id: signTxButton text: qsTr("Sign tx file") + translationManager.emptyString - shadowReleasedColor: "#FF4304" - shadowPressedColor: "#B32D00" - releasedColor: "#FF6C3C" - pressedColor: "#FF4304" visible: !appWindow.viewOnly onClicked: { console.log("Transfer: sign tx clicked")