diff options
Diffstat (limited to 'components')
| -rw-r--r-- | components/DatePicker.qml | 95 | ||||
| -rw-r--r-- | components/InlineButton.qml | 5 | ||||
| -rw-r--r-- | components/Label.qml | 7 | ||||
| -rw-r--r-- | components/LanguageSidebar.qml | 70 | ||||
| -rw-r--r-- | components/LineEdit.qml | 212 | ||||
| -rw-r--r-- | components/LineEditMulti.qml | 5 | ||||
| -rw-r--r-- | components/QRCodeScanner.qml | 3 | ||||
| -rw-r--r-- | components/RemoteNodeEdit.qml | 8 | ||||
| -rw-r--r-- | components/RemoteNodeList.qml | 23 | ||||
| -rw-r--r-- | components/Slider.qml | 4 | ||||
| -rw-r--r-- | components/StandardButton.qml | 1 | ||||
| -rw-r--r-- | components/StandardDropdown.qml | 100 | ||||
| -rw-r--r-- | components/TitleBar.qml | 1 | ||||
| -rw-r--r-- | components/TxConfirmationDialog.qml | 2 |
14 files changed, 311 insertions, 225 deletions
diff --git a/components/DatePicker.qml b/components/DatePicker.qml index 8a79b2e8..1df7d38a 100644 --- a/components/DatePicker.qml +++ b/components/DatePicker.qml @@ -32,6 +32,7 @@ import QtQuick.Controls 2.2 as QtQuickControls2 import QtQuick.Layouts 1.2 import QtGraphicalEffects 1.0 import QtQuick.Controls.Styles 1.2 +import FontAwesome 1.0 import "." as MoneroComponents import "effects/" as MoneroEffects @@ -91,8 +92,8 @@ Item { anchors.left: parent.left anchors.right: parent.right height: parent.height - 1 - anchors.leftMargin: datePicker.expanded ? 1 : 0 - anchors.rightMargin: datePicker.expanded ? 1 : 0 + anchors.leftMargin: 0 + anchors.rightMargin: 0 radius: 4 y: 1 color: datePicker.backgroundColor @@ -221,21 +222,18 @@ Item { Layout.fillWidth: true color: "transparent" - Image { + MoneroEffects.ImageMask { id: button anchors.right: parent.right anchors.rightMargin: 10 anchors.verticalCenter: parent.verticalCenter - source: "qrc:///images/whiteDropIndicator.png" - visible: false - } - - ColorOverlay { - source: button - anchors.fill: button + image: "qrc:///images/whiteDropIndicator.png" + height: 8 + width: 12 + fontAwesomeFallbackIcon: FontAwesome.arrowDown + fontAwesomeFallbackSize: 14 color: MoneroComponents.Style.defaultFontColor rotation: datePicker.expanded ? 180 : 0 - opacity: 1 } MouseArea { @@ -252,12 +250,16 @@ Item { id: popup padding: 0 closePolicy: QtQuickControls2.Popup.CloseOnEscape | QtQuickControls2.Popup.CloseOnPressOutsideParent + onOpened: { + calendar.visibleMonth = currentDate.getMonth(); + calendar.visibleYear = currentDate.getFullYear(); + } Rectangle { id: calendarRect width: head.width x: head.x - y: head.y + head.height + 10 + y: head.y + head.height - 2 color: MoneroComponents.Style.middlePanelBackgroundColor border.width: 1 @@ -266,11 +268,16 @@ Item { clip: true Behavior on height { - NumberAnimation { duration: 100; easing.type: Easing.InQuad } + NumberAnimation { duration: 150; easing.type: Easing.InQuad } } MouseArea { anchors.fill: parent + scrollGestureEnabled: false + onWheel: { + if (wheel.angleDelta.y > 0) return calendar.showPreviousMonth(); + if (wheel.angleDelta.y < 0) return calendar.showNextMonth(); + } } Rectangle { @@ -305,11 +312,6 @@ Item { id: dayRect anchors.fill: parent radius: parent.implicitHeight / 2 - color: { - if(dayArea.pressed && styleData.visibleMonth) - return MoneroComponents.Style.blackTheme ? "#20FFFFFF" : "#10000000" - return "transparent"; - } } MoneroComponents.TextPlain { @@ -327,19 +329,32 @@ Item { text: styleData.date.getDate() themeTransition: false color: { - if(!styleData.visibleMonth) return MoneroComponents.Style.lightGreyFontColor - if(dayArea.pressed) return MoneroComponents.Style.defaultFontColor - if(styleData.today) return MoneroComponents.Style.orange - return MoneroComponents.Style.defaultFontColor + if (currentDate.toDateString() === styleData.date.toDateString()) { + if (dayArea.containsMouse) { + dayRect.color = MoneroComponents.Style.buttonBackgroundColorHover; + } else { + dayRect.color = MoneroComponents.Style.buttonBackgroundColor; + } + } else { + if (dayArea.containsMouse) { + dayRect.color = MoneroComponents.Style.blackTheme ? "#20FFFFFF" : "#10000000" + } else { + dayRect.color = "transparent"; + } + } + if(!styleData.valid) return "transparent" + if(styleData.date.toDateString() === (new Date()).toDateString()) return "#FFFF00" + if(!styleData.visibleMonth) return MoneroComponents.Style.lightGreyFontColor + if(dayArea.pressed) return MoneroComponents.Style.defaultFontColor + return MoneroComponents.Style.defaultFontColor } } MouseArea { id: dayArea anchors.fill: parent + visible: styleData.valid hoverEnabled: true - onEntered: dayRect.color = MoneroComponents.Style.blackTheme ? "#20FFFFFF" : "#10000000" - onExited: dayRect.color = "transparent" cursorShape: Qt.PointingHandCursor onClicked: { if(styleData.visibleMonth) { @@ -397,18 +412,15 @@ Item { anchors.bottom: parent.bottom width: height - Image { + MoneroEffects.ImageMask { id: prevMonthIcon anchors.centerIn: parent - source: "qrc:///images/prevMonth.png" - visible: false - } - - ColorOverlay { - source: prevMonthIcon - anchors.fill: prevMonthIcon + image: "qrc:///images/prevMonth.png" + height: 8 + width: 12 + fontAwesomeFallbackIcon: FontAwesome.arrowLeft + fontAwesomeFallbackSize: 14 color: MoneroComponents.Style.defaultFontColor - opacity: 0.5 } MouseArea { @@ -426,19 +438,16 @@ Item { anchors.bottom: parent.bottom width: height - Image { + MoneroEffects.ImageMask { id: nextMonthIcon anchors.centerIn: parent - source: "qrc:///images/prevMonth.png" - visible: false - } - - ColorOverlay { - source: nextMonthIcon - anchors.fill: nextMonthIcon - color: MoneroComponents.Style.defaultFontColor - opacity: 0.5 + image: "qrc:///images/prevMonth.png" + height: 8 + width: 12 rotation: 180 + fontAwesomeFallbackIcon: FontAwesome.arrowLeft + fontAwesomeFallbackSize: 14 + color: MoneroComponents.Style.defaultFontColor } MouseArea { diff --git a/components/InlineButton.qml b/components/InlineButton.qml index 8e0d278b..09d3aadf 100644 --- a/components/InlineButton.qml +++ b/components/InlineButton.qml @@ -95,7 +95,10 @@ Item { cursorShape: rect.enabled ? Qt.PointingHandCursor : Qt.ArrowCursor hoverEnabled: true anchors.fill: parent - onClicked: doClick() + onClicked: { + tooltip.text ? tooltip.tooltipPopup.close() : "" + doClick() + } onEntered: { tooltip.text ? tooltip.tooltipPopup.open() : "" rect.color = buttonColor ? buttonColor : "#707070"; diff --git a/components/Label.qml b/components/Label.qml index 261c02a5..c4a967ec 100644 --- a/components/Label.qml +++ b/components/Label.qml @@ -37,6 +37,7 @@ Item { property alias tooltip: label.tooltip property alias tooltipIconVisible: label.tooltipIconVisible property alias color: label.color + property alias labelMouseArea: labelMouseArea property int textFormat: Text.PlainText property string tipText: "" property int fontSize: 16 @@ -72,9 +73,13 @@ Item { onLinkActivated: item.linkActivated() textFormat: parent.textFormat MouseArea { + id: labelMouseArea anchors.fill: parent + hoverEnabled: true acceptedButtons: Qt.NoButton - cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor + cursorShape: parent.hoveredLink || (tooltip && !tooltipIconVisible) ? Qt.PointingHandCursor : Qt.ArrowCursor + onEntered: tooltip && !tooltipIconVisible ? parent.tooltipPopup.open() : undefined + onExited: tooltip && !tooltipIconVisible ? parent.tooltipPopup.close() : undefined } } } diff --git a/components/LanguageSidebar.qml b/components/LanguageSidebar.qml index e7de02ef..8372d474 100644 --- a/components/LanguageSidebar.qml +++ b/components/LanguageSidebar.qml @@ -53,26 +53,64 @@ Drawer { color: "red" ListView { + id: languagesListView clip: true Layout.fillHeight: true Layout.fillWidth: true boundsBehavior: Flickable.StopAtBounds width: sideBar.width height: sideBar.height + focus: true model: langModel + Keys.onUpPressed: currentIndex !== 0 ? currentIndex = currentIndex - 1 : "" + Keys.onBacktabPressed: currentIndex !== 0 ? currentIndex = currentIndex - 1 : "" + Keys.onDownPressed: currentIndex + 1 !== count ? currentIndex = currentIndex + 1 : "" + Keys.onTabPressed: currentIndex + 1 !== count ? currentIndex = currentIndex + 1 : "" + delegate: Rectangle { id: item - color: "transparent" + color: index == languagesListView.currentIndex ? MoneroComponents.Style.titleBarButtonHoverColor : "transparent" width: sideBar.width height: 32 + Accessible.role: Accessible.ListItem + Accessible.name: display_name + Keys.onEnterPressed: setSelectedItemAsLanguage(); + Keys.onReturnPressed: setSelectedItemAsLanguage(); + Keys.onSpacePressed: setSelectedItemAsLanguage(); + + function setSelectedItemAsLanguage() { + var locale_spl = locale.split("_"); + + // reload active translations + console.log(locale_spl[0]); + translationManager.setLanguage(locale_spl[0]); + + // set wizard language settings + persistentSettings.locale = locale; + persistentSettings.language = display_name; + persistentSettings.language_wallet = wallet_language; + + appWindow.showStatusMessage(qsTr("Language changed."), 3); + appWindow.toggleLanguageView(); + } + + Rectangle { + id: selectedIndicator + anchors.left: parent.left + anchors.leftMargin: 0 + height: parent.height + width: 2 + color: index == languagesListView.currentIndex ? MoneroComponents.Style.buttonBackgroundColor : "transparent" + } + Rectangle { id: flagRect height: 24 width: 24 - anchors.left: parent.left + anchors.left: selectedIndicator.right anchors.leftMargin: 4 anchors.verticalCenter: parent.verticalCenter color: "transparent" @@ -85,8 +123,8 @@ Drawer { MoneroComponents.TextPlain { anchors.left: parent.left - anchors.leftMargin: 30 - font.bold: true + anchors.leftMargin: 32 + font.bold: languagesListView.currentIndex == index ? true : false font.pixelSize: 14 color: MoneroComponents.Style.defaultFontColor text: display_name @@ -112,21 +150,7 @@ Drawer { MouseArea { anchors.fill: parent cursorShape: Qt.PointingHandCursor - onClicked: { - var locale_spl = locale.split("_"); - - // reload active translations - console.log(locale_spl[0]); - translationManager.setLanguage(locale_spl[0]); - - // set wizard language settings - persistentSettings.locale = locale; - persistentSettings.language = display_name; - persistentSettings.language_wallet = wallet_language; - - appWindow.showStatusMessage(qsTr("Language changed."), 3); - appWindow.toggleLanguageView(); - } + onClicked: setSelectedItemAsLanguage(); hoverEnabled: true onEntered: { // item.color = "#26FFFFFF" @@ -166,4 +190,12 @@ Drawer { } } } + + function selectCurrentLanguage() { + for (var i = 0; i < langModel.count; ++i) { + if (langModel.get(i).display_name === persistentSettings.language) { + languagesListView.currentIndex = i; + } + } + } } diff --git a/components/LineEdit.qml b/components/LineEdit.qml index 0356b83b..bc42150a 100644 --- a/components/LineEdit.qml +++ b/components/LineEdit.qml @@ -33,14 +33,21 @@ import QtQuick.Layouts 1.1 import "../components" as MoneroComponents -Item { +ColumnLayout { id: item + Layout.fillWidth: true default property alias content: inlineButtons.children property alias input: input property alias text: input.text + property int inputPaddingLeft: 10 + property int inputPaddingRight: 10 + property int inputPaddingTop: 10 + property int inputPaddingBottom: 10 + property int inputRadius: 4 + property bool password: false property bool passwordHidden: true property var passwordLinked: null @@ -55,10 +62,8 @@ Item { property real placeholderLeftMargin: { if (placeholderCenter) { return undefined; - } else if (inlineIcon.visible) { - return inlineIcon.width + inlineIcon.anchors.leftMargin + inputPadding; } else { - return inputPadding; + return inputPaddingLeft; } } @@ -66,16 +71,16 @@ Item { property alias validator: input.validator property alias readOnly : input.readOnly property alias cursorPosition: input.cursorPosition - property alias inlineIcon: inlineIcon.visible property bool copyButton: false + property bool pasteButton: false property alias copyButtonText: copyButtonId.text property alias copyButtonEnabled: copyButtonId.enabled property bool borderDisabled: false property string borderColor: { - if(error && input.text !== ""){ + if ((error && input.text !== "") || (errorWhenEmpty && input.text == "")) { return MoneroComponents.Style.inputBorderColorInvalid; - } else if(input.activeFocus){ + } else if (input.activeFocus) { return MoneroComponents.Style.inputBorderColorActive; } else { return MoneroComponents.Style.inputBorderColorInActive; @@ -87,6 +92,7 @@ Item { property bool fontBold: false property alias fontColor: input.color property bool error: false + property bool errorWhenEmpty: false property alias labelText: inputLabel.text property alias labelColor: inputLabel.color property alias labelTextFormat: inputLabel.textFormat @@ -97,16 +103,13 @@ Item { property alias labelWrapMode: inputLabel.wrapMode property alias labelHorizontalAlignment: inputLabel.horizontalAlignment property bool showingHeader: inputLabel.text !== "" || copyButton - property int inputHeight: 42 - property int inputPadding: 10 + property int inputHeight: 39 signal labelLinkActivated(); // input label, rich text <a> signal signal editingFinished(); signal accepted(); signal textUpdated(); - height: showingHeader ? (inputLabel.height + inputItem.height + 2) : inputHeight - onActiveFocusChanged: activeFocus && input.forceActiveFocus() onTextUpdated: { // check to remove placeholder text when there is content @@ -152,45 +155,100 @@ Item { } } - MoneroComponents.TextPlain { - id: inputLabel - anchors.top: parent.top - anchors.left: parent.left - font.family: MoneroComponents.Style.fontRegular.name - font.pixelSize: labelFontSize - font.bold: labelFontBold - textFormat: Text.RichText - color: MoneroComponents.Style.defaultFontColor - onLinkActivated: item.labelLinkActivated() + spacing: 0 + Rectangle { + id: inputLabelRect + color: "transparent" + Layout.fillWidth: true + height: (inputLabel.height + 10) + visible: showingHeader ? true : false - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.NoButton - cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor + MoneroComponents.TextPlain { + id: inputLabel + anchors.top: parent.top + anchors.left: parent.left + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: labelFontSize + font.bold: labelFontBold + textFormat: Text.RichText + color: MoneroComponents.Style.defaultFontColor + onLinkActivated: item.labelLinkActivated() + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.NoButton + cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor + } } - } - MoneroComponents.LabelButton { - id: copyButtonId - text: qsTr("Copy") + translationManager.emptyString - anchors.right: parent.right - onClicked: { - if (input.text.length > 0) { - console.log("Copied to clipboard"); - clipboard.setText(input.text); - appWindow.showStatusMessage(qsTr("Copied to clipboard"), 3); + RowLayout { + anchors.right: parent.right + spacing: 16 + + MoneroComponents.LabelButton { + id: copyButtonId + text: qsTr("Copy") + translationManager.emptyString + onClicked: { + if (input.text.length > 0) { + console.log("Copied to clipboard"); + clipboard.setText(input.text); + appWindow.showStatusMessage(qsTr("Copied to clipboard"), 3); + } + } + visible: copyButton && input.text !== "" + } + + MoneroComponents.LabelButton { + id: pasteButtonId + onClicked: { + input.clear(); + input.paste(); + } + text: qsTr("Paste") + translationManager.emptyString + visible: pasteButton } } - visible: copyButton && input.text !== "" } - Item{ - id: inputItem - height: inputHeight - anchors.top: showingHeader ? inputLabel.bottom : parent.top - anchors.topMargin: showingHeader ? 12 : 0 - width: parent.width - clip: true + MoneroComponents.Input { + id: input + KeyNavigation.backtab: item.KeyNavigation.backtab + KeyNavigation.tab: item.KeyNavigation.tab + Layout.fillWidth: true + Layout.preferredHeight: inputHeight + + leftPadding: item.inputPaddingLeft + rightPadding: (inlineButtons.width > 0 ? inlineButtons.width + inlineButtons.spacing : 0) + inputPaddingRight + topPadding: item.inputPaddingTop + bottomPadding: item.inputPaddingBottom + + font.family: item.fontFamily + font.pixelSize: item.fontSize + font.bold: item.fontBold + onEditingFinished: item.editingFinished() + onAccepted: item.accepted(); + onTextChanged: item.textUpdated() + echoMode: isPasswordHidden() ? TextInput.Password : TextInput.Normal + + MoneroComponents.Label { + visible: password || passwordLinked + fontSize: 20 + text: isPasswordHidden() ? FontAwesome.eye : FontAwesome.eyeSlash + opacity: eyeMouseArea.containsMouse ? 0.9 : 0.7 + fontFamily: FontAwesome.fontFamily + anchors.right: parent.right + anchors.rightMargin: 15 + anchors.verticalCenter: parent.verticalCenter + anchors.verticalCenterOffset: 1 + + MouseArea { + id: eyeMouseArea + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + hoverEnabled: true + onClicked: passwordToggle() + } + } MoneroComponents.TextPlain { id: placeholderLabel @@ -221,69 +279,15 @@ Item { anchors.fill: parent border.width: borderDisabled ? 0 : 1 border.color: borderColor - radius: 4 - } - - Image { - id: inlineIcon - width: 26 - height: 26 - anchors.top: parent.top - anchors.topMargin: 8 - anchors.left: parent.left - anchors.leftMargin: 12 - source: "qrc:///images/moneroIcon-28x28.png" - visible: false + radius: item.inputRadius } - MoneroComponents.Input { - id: input - anchors.fill: parent - anchors.leftMargin: inlineIcon.visible ? 44 : 0 - font.family: item.fontFamily - font.pixelSize: item.fontSize - font.bold: item.fontBold - KeyNavigation.backtab: item.KeyNavigation.backtab - KeyNavigation.tab: item.KeyNavigation.tab - onEditingFinished: item.editingFinished() - onAccepted: item.accepted(); - onTextChanged: item.textUpdated() - leftPadding: inputPadding - rightPadding: (inlineButtons.width > 0 ? inlineButtons.width + inlineButtons.spacing : 0) + inputPadding - topPadding: inputPadding - bottomPadding: inputPadding - echoMode: isPasswordHidden() ? TextInput.Password : TextInput.Normal - - MoneroComponents.Label { - visible: password || passwordLinked - fontSize: 20 - text: isPasswordHidden() ? FontAwesome.eye : FontAwesome.eyeSlash - opacity: eyeMouseArea.containsMouse ? 0.9 : 0.7 - fontFamily: FontAwesome.fontFamily - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - anchors.verticalCenterOffset: 1 - - MouseArea { - id: eyeMouseArea - anchors.fill: parent - cursorShape: Qt.PointingHandCursor - hoverEnabled: true - onClicked: passwordToggle() - } - } - - RowLayout { - id: inlineButtons - anchors.bottom: parent.bottom - anchors.top: parent.top - anchors.right: parent.right - anchors.topMargin: inputPadding - anchors.bottomMargin: inputPadding - anchors.rightMargin: inputPadding - spacing: 4 - } + RowLayout { + id: inlineButtons + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: inputPaddingRight + spacing: 4 } } } diff --git a/components/LineEditMulti.qml b/components/LineEditMulti.qml index 8137c02b..e45b0a9a 100644 --- a/components/LineEditMulti.qml +++ b/components/LineEditMulti.qml @@ -68,6 +68,7 @@ ColumnLayout { } property alias error: input.error + property alias cursorPosition: input.cursorPosition property string labelFontColor: MoneroComponents.Style.defaultFontColor property bool labelFontBold: false @@ -91,6 +92,8 @@ ColumnLayout { signal labelButtonClicked(); signal inputLabelLinkActivated(); signal editingFinished(); + signal returnPressed(); + signal enterPressed(); onActiveFocusChanged: activeFocus && input.forceActiveFocus() @@ -176,6 +179,8 @@ ColumnLayout { fontColor: item.fontColor mouseSelection: item.mouseSelection onEditingFinished: item.editingFinished() + Keys.onReturnPressed: item.returnPressed() + Keys.onEnterPressed: item.enterPressed() MoneroComponents.TextPlain { id: placeholderLabel diff --git a/components/QRCodeScanner.qml b/components/QRCodeScanner.qml index a4d6927c..f3dd4a0d 100644 --- a/components/QRCodeScanner.qml +++ b/components/QRCodeScanner.qml @@ -90,6 +90,9 @@ Rectangle { if (!parsed.error) { root.qrcode_decoded(parsed.address, parsed.payment_id, parsed.amount, parsed.tx_description, parsed.recipient_name, parsed.extra_parameters); root.state = "Stopped"; + } else if (walletManager.addressValid(data, appWindow.persistentSettings.nettype)) { + root.qrcode_decoded(data, "", "", "", "", null); + root.state = "Stopped"; } else { onNotifyError(parsed.error); } diff --git a/components/RemoteNodeEdit.qml b/components/RemoteNodeEdit.qml index 7b4b4773..255f6673 100644 --- a/components/RemoteNodeEdit.qml +++ b/components/RemoteNodeEdit.qml @@ -82,9 +82,9 @@ GridLayout { return addr + ":" + port; } - LineEdit { + MoneroComponents.LineEdit { id: daemonAddr - Layout.fillWidth: true + Layout.preferredWidth: root.width/3 placeholderText: qsTr("Remote Node Hostname / IP") + translationManager.emptyString placeholderFontFamily: root.placeholderFontFamily placeholderFontBold: root.placeholderFontBold @@ -104,9 +104,9 @@ GridLayout { text: initialHostPort[1] } - LineEdit { + MoneroComponents.LineEdit { id: daemonPort - Layout.fillWidth: true + Layout.preferredWidth: root.width/3 placeholderText: qsTr("Port") + translationManager.emptyString placeholderFontFamily: root.placeholderFontFamily placeholderFontBold: root.placeholderFontBold diff --git a/components/RemoteNodeList.qml b/components/RemoteNodeList.qml index 2e9c36f4..ffbce57d 100644 --- a/components/RemoteNodeList.qml +++ b/components/RemoteNodeList.qml @@ -59,7 +59,7 @@ ColumnLayout { Rectangle { height: 30 Layout.fillWidth: true - color: itemMouseArea.containsMouse || index === remoteNodesModel.selected ? MoneroComponents.Style.titleBarButtonHoverColor : "transparent" + color: itemMouseArea.containsMouse || trustedDaemonCheckMark.labelMouseArea.containsMouse || index === remoteNodesModel.selected ? MoneroComponents.Style.titleBarButtonHoverColor : "transparent" Rectangle { color: MoneroComponents.Style.appWindowBorderColor @@ -80,8 +80,10 @@ ColumnLayout { anchors.fill: parent anchors.rightMargin: 80 color: "transparent" + property var trusted: remoteNodesModel.get(index).trusted MoneroComponents.TextPlain { + id: addressText color: index === remoteNodesModel.selected ? MoneroComponents.Style.defaultFontColor : MoneroComponents.Style.dimmedFontColor anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left @@ -91,6 +93,22 @@ ColumnLayout { themeTransition: false } + MoneroComponents.Label { + id: trustedDaemonCheckMark + anchors.left: addressText.right + anchors.leftMargin: 6 + anchors.verticalCenter: parent.verticalCenter + z: itemMouseArea.z + 1 + fontSize: 16 + fontFamily: FontAwesome.fontFamilySolid + fontColor: index === remoteNodesModel.selected ? MoneroComponents.Style.defaultFontColor : MoneroComponents.Style.dimmedFontColor + styleName: "Solid" + visible: trusted + text: FontAwesome.shieldAlt + tooltip: qsTr("Trusted daemon") + translationManager.emptyString + themeTransition: false + } + MouseArea { id: itemMouseArea cursorShape: Qt.PointingHandCursor @@ -103,9 +121,8 @@ ColumnLayout { RowLayout { anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right - anchors.rightMargin: 6 height: 30 - spacing: 10 + spacing: 2 MoneroComponents.InlineButton { buttonColor: "transparent" diff --git a/components/Slider.qml b/components/Slider.qml index 451aa7a9..df3b3cb3 100644 --- a/components/Slider.qml +++ b/components/Slider.qml @@ -16,11 +16,11 @@ ColumnLayout { spacing: 0 - Text { + MoneroComponents.TextPlain { id: label color: MoneroComponents.Style.defaultFontColor font.pixelSize: 14 - Layout.fillWidth: true + font.family: MoneroComponents.Style.fontRegular.name } QtQuickControls.Slider { diff --git a/components/StandardButton.qml b/components/StandardButton.qml index d77e611f..b52b3a00 100644 --- a/components/StandardButton.qml +++ b/components/StandardButton.qml @@ -146,6 +146,7 @@ Item { width: button.small ? 16 : 20 height: button.small ? 16 : 20 source: { + if (fontAwesomeIcon) return ""; if(button.rightIconInactive !== "" && !button.enabled) { return button.rightIconInactive; } diff --git a/components/StandardDropdown.qml b/components/StandardDropdown.qml index dfe37a5d..6108f145 100644 --- a/components/StandardDropdown.qml +++ b/components/StandardDropdown.qml @@ -29,12 +29,16 @@ import QtQuick 2.9 import QtQuick.Controls 2.2 import QtGraphicalEffects 1.0 +import FontAwesome 1.0 +import QtQuick.Layouts 1.1 import "../components" as MoneroComponents import "../components/effects/" as MoneroEffects -Item { +ColumnLayout { id: dropdown + Layout.fillWidth: true + property int itemTopMargin: 0 property alias dataModel: repeater.model property string shadowPressedColor @@ -44,46 +48,66 @@ Item { property string textColor: MoneroComponents.Style.defaultFontColor property alias currentIndex: columnid.currentIndex readonly property alias expanded: popup.visible - property int dropdownHeight: 42 - property int fontHeaderSize: 16 + property alias labelText: dropdownLabel.text + property alias labelColor: dropdownLabel.color + property alias labelTextFormat: dropdownLabel.textFormat + property alias labelWrapMode: dropdownLabel.wrapMode + property alias labelHorizontalAlignment: dropdownLabel.horizontalAlignment + property bool showingHeader: dropdownLabel.text !== "" + property int labelFontSize: 14 + property bool labelFontBold: false + property int dropdownHeight: 39 + property int fontSize: 14 property int fontItemSize: 14 property string colorBorder: MoneroComponents.Style.inputBorderColorInActive property string colorHeaderBackground: "transparent" property bool headerBorder: true property bool headerFontBold: false - height: dropdownHeight - signal changed(); onExpandedChanged: if(expanded) appWindow.currentItem = dropdown - Item { - id: head - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top - anchors.topMargin: parent.itemTopMargin - height: dropdown.dropdownHeight + spacing: 0 + Rectangle { + id: dropdownLabelRect + color: "transparent" + Layout.fillWidth: true + height: (dropdownLabel.height + 10) + visible: showingHeader ? true : false - Rectangle { - color: "transparent" - border.width: dropdown.headerBorder ? 1 : 0 - border.color: dropdown.colorBorder - radius: 4 - anchors.fill: parent + MoneroComponents.TextPlain { + id: dropdownLabel + anchors.top: parent.top + anchors.left: parent.left + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: labelFontSize + font.bold: labelFontBold + textFormat: Text.RichText + color: MoneroComponents.Style.defaultFontColor } + } + + Rectangle { + id: head + color: dropArea.containsMouse ? MoneroComponents.Style.titleBarButtonHoverColor : "transparent" + border.width: dropdown.headerBorder ? 1 : 0 + border.color: dropdown.colorBorder + radius: 4 + Layout.fillWidth: true + Layout.preferredHeight: dropdownHeight MoneroComponents.TextPlain { anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left - anchors.leftMargin: 12 + anchors.leftMargin: 10 anchors.right: dropIndicator.left anchors.rightMargin: 12 + width: droplist.width elide: Text.ElideRight font.family: MoneroComponents.Style.fontRegular.name font.bold: dropdown.headerFontBold - font.pixelSize: dropdown.fontHeaderSize + font.pixelSize: dropdown.fontSize color: dropdown.textColor text: columnid.currentIndex < repeater.model.count ? qsTr(repeater.model.get(columnid.currentIndex).column1) + translationManager.emptyString : "" } @@ -96,19 +120,15 @@ Item { anchors.rightMargin: 12 width: dropdownIcon.width - Image { + MoneroEffects.ImageMask { id: dropdownIcon anchors.centerIn: parent - source: "qrc:///images/whiteDropIndicator.png" - visible: false - } - - ColorOverlay { - source: dropdownIcon - anchors.fill: dropdownIcon + image: "qrc:///images/whiteDropIndicator.png" + height: 8 + width: 12 + fontAwesomeFallbackIcon: FontAwesome.arrowDown + fontAwesomeFallbackSize: 14 color: MoneroComponents.Style.defaultFontColor - rotation: dropdown.expanded ? 180 : 0 - opacity: 1 } } @@ -117,7 +137,7 @@ Item { anchors.fill: parent onClicked: dropdown.expanded ? popup.close() : popup.open() hoverEnabled: true - cursorShape: Qt.PointingHandCursor + cursorShape: Qt.ArrowCursor } } @@ -128,7 +148,7 @@ Item { Rectangle { id: droplist - x: dropdown.x + anchors.left: parent.left width: dropdown.width y: head.y + head.height clip: true @@ -188,25 +208,11 @@ Item { text: "" } - Rectangle { - anchors.left: parent.left - anchors.top: parent.top - width: 3; height: 3 - color: parent.color - } - - Rectangle { - anchors.right: parent.right - anchors.top: parent.top - width: 3; height: 3 - color: parent.color - } - MouseArea { id: itemArea anchors.fill: parent hoverEnabled: true - cursorShape: Qt.PointingHandCursor + cursorShape: Qt.ArrowCursor onClicked: { popup.close() diff --git a/components/TitleBar.qml b/components/TitleBar.qml index 27d4fe29..ef04fdf4 100644 --- a/components/TitleBar.qml +++ b/components/TitleBar.qml @@ -382,6 +382,7 @@ Rectangle { anchors.fill: parent propagateComposedEvents: true onPressed: previousPosition = globalCursor.getPosition() + onDoubleClicked: root.maximizeClicked() onPositionChanged: { if (pressedButtons == Qt.LeftButton) { var pos = globalCursor.getPosition() diff --git a/components/TxConfirmationDialog.qml b/components/TxConfirmationDialog.qml index 4904b4e6..b35a3b30 100644 --- a/components/TxConfirmationDialog.qml +++ b/components/TxConfirmationDialog.qml @@ -141,7 +141,7 @@ Rectangle { function showFiatConversion(valueXMR) { const fiatFee = fiatApiConvertToFiat(valueXMR); - return "%1 %2".arg(fiatFee < 0.01 ? "<0.01" : "~" + fiatFee).arg(fiatApiCurrencySymbol()); + return "%1 %2".arg(fiatFee < 0.01 ? "<0.01" : "~" + fiatFee).arg(fiatApiCurrencySymbol()); } ColumnLayout { |
