From f3ab0abadfcb76b717237a55478c6df8b00c0aa7 Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Sat, 25 Feb 2023 22:58:18 -0500 Subject: [PATCH] Change members button color when hovered --- resources/qml/EncryptionIndicator.qml | 8 ++++--- resources/qml/TopBar.qml | 34 +++++++++++++-------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/resources/qml/EncryptionIndicator.qml b/resources/qml/EncryptionIndicator.qml index 9fe40dea..5338b6be 100644 --- a/resources/qml/EncryptionIndicator.qml +++ b/resources/qml/EncryptionIndicator.qml @@ -14,10 +14,12 @@ Image { property int trust: Crypto.Unverified property string unencryptedIcon: ":/icons/icons/ui/shield-filled-cross.svg" property color unencryptedColor: Nheko.theme.error + property color unencryptedHoverColor: unencryptedColor + property bool hovered: ma.hovered property string sourceUrl: { if (!encrypted) - return "image://colorimage/"+unencryptedIcon+"?"; + return "image://colorimage/" + unencryptedIcon + "?"; switch (trust) { case Crypto.Verified: @@ -46,10 +48,10 @@ Image { return sourceUrl + Nheko.theme.error; } } else { - return sourceUrl + unencryptedColor; + return sourceUrl + (stateImg.hovered ? unencryptedHoverColor : unencryptedColor); } } - ToolTip.visible: ma.hovered + ToolTip.visible: stateImg.hovered ToolTip.text: { if (!encrypted) return qsTr("This message is not encrypted!"); diff --git a/resources/qml/TopBar.qml b/resources/qml/TopBar.qml index 0e4ca4e7..f23645a7 100644 --- a/resources/qml/TopBar.qml +++ b/resources/qml/TopBar.qml @@ -242,26 +242,26 @@ Pane { enabled: false unencryptedIcon: ":/icons/icons/ui/people.svg" unencryptedColor: Nheko.colors.buttonText + unencryptedHoverColor: Nheko.colors.highlight + hovered: parent.hovered + + ToolTip.delay: Nheko.tooltipDelay + ToolTip.text: { + if (!isEncrypted) + return qsTr("Show room members."); + + switch (trustlevel) { + case Crypto.Verified: + return qsTr("This room contains only verified devices."); + case Crypto.TOFU: + return qsTr("This room contains verified devices and devices which have never changed their master key."); + default: + return qsTr("This room contains unverified devices!"); + } + } } background: null - - ToolTip.delay: Nheko.tooltipDelay - ToolTip.text: { - if (!isEncrypted) - return qsTr("Show room members."); - - switch (trustlevel) { - case Crypto.Verified: - return qsTr("This room contains only verified devices."); - case Crypto.TOFU: - return qsTr("This room contains verified devices and devices which have never changed their master key."); - default: - return qsTr("This room contains unverified devices!"); - } - } - ToolTip.visible: hovered - onClicked: TimelineManager.openRoomMembers(room) }