From 614a7a086a636f6d6d1a67425fb147d71df39bac Mon Sep 17 00:00:00 2001 From: rating89us <45968869+rating89us@users.noreply.github.com> Date: Wed, 23 Jun 2021 02:28:48 +0200 Subject: [PATCH] RemoteNodeList: display shield icon if trusted daemon --- components/Label.qml | 7 ++++++- components/RemoteNodeList.qml | 20 +++++++++++++++++++- fonts/FontAwesome/FontAwesome.qml | 1 + 3 files changed, 26 insertions(+), 2 deletions(-) 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/RemoteNodeList.qml b/components/RemoteNodeList.qml index 2e9c36f4..96e252c4 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 diff --git a/fonts/FontAwesome/FontAwesome.qml b/fonts/FontAwesome/FontAwesome.qml index d8b60192..8e49cc93 100644 --- a/fonts/FontAwesome/FontAwesome.qml +++ b/fonts/FontAwesome/FontAwesome.qml @@ -601,6 +601,7 @@ Object { property string shekel : "\uf20b" property string sheqel : "\uf20b" property string shield : "\uf132" + property string shieldAlt : "\uf3ed" property string ship : "\uf21a" property string shirtsinbulk : "\uf214" property string shoppingBag : "\uf290"