From ddaa5b784d89946f3b3b9523920c579c0220cd68 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Fri, 18 Aug 2023 14:14:45 +0500 Subject: [PATCH] minor ui fixes --- .../ui/qml/Controls2/LabelWithButtonType.qml | 27 +++++++++++++------ .../ui/qml/Controls2/VerticalRadioButton.qml | 1 + client/ui/qml/Pages2/PageSettingsAbout.qml | 8 +++--- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/client/ui/qml/Controls2/LabelWithButtonType.qml b/client/ui/qml/Controls2/LabelWithButtonType.qml index 3aca1d57..82aef55a 100644 --- a/client/ui/qml/Controls2/LabelWithButtonType.qml +++ b/client/ui/qml/Controls2/LabelWithButtonType.qml @@ -17,7 +17,9 @@ Item { property string textColor: "#d7d8db" property string descriptionColor: "#878B91" - property string rightImageColor: "#878B91" + property real textOpacity: 1.0 + + property string rightImageColor: "#d7d8db" property bool descriptionOnTop: false @@ -67,6 +69,8 @@ Item { text: root.text color: root.descriptionOnTop ? root.descriptionColor : root.textColor + opacity: root.textOpacity + Layout.fillWidth: true lineHeight: root.descriptionOnTop ? parent.descriptionTextLineHeight : parent.textLineHeight @@ -75,14 +79,20 @@ Item { horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter + + Behavior on opacity { + PropertyAnimation { duration: 200 } + } } CaptionTextType { id: description - color: root.descriptionOnTop ? root.textColor : root.descriptionColor text: root.descriptionText + color: root.descriptionOnTop ? root.textColor : root.descriptionColor + + opacity: root.textOpacity visible: root.descriptionText !== "" @@ -94,6 +104,10 @@ Item { horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter + + Behavior on opacity { + PropertyAnimation { duration: 200 } + } } } @@ -141,9 +155,8 @@ Item { rightImageBackground.color = rightImage.hoveredColor } else if (leftImageSource) { leftImageBackground.color = rightImage.hoveredColor - } else { - background.color = rightImage.hoveredColor } + root.textOpacity = 0.8 } onExited: { @@ -151,9 +164,8 @@ Item { rightImageBackground.color = rightImage.defaultColor } else if (leftImageSource) { leftImageBackground.color = rightImage.defaultColor - } else { - background.color = rightImage.defaultColor } + root.textOpacity = 1 } onPressedChanged: { @@ -161,9 +173,8 @@ Item { rightImageBackground.color = pressed ? rightImage.pressedColor : entered ? rightImage.hoveredColor : rightImage.defaultColor } else if (leftImageSource) { leftImageBackground.color = pressed ? rightImage.pressedColor : entered ? rightImage.hoveredColor : rightImage.defaultColor - } else { - background.color = pressed ? rightImage.pressedColor : entered ? rightImage.hoveredColor : rightImage.defaultColor } + root.textOpacity = 0.7 } onClicked: { diff --git a/client/ui/qml/Controls2/VerticalRadioButton.qml b/client/ui/qml/Controls2/VerticalRadioButton.qml index f44fa751..8229c959 100644 --- a/client/ui/qml/Controls2/VerticalRadioButton.qml +++ b/client/ui/qml/Controls2/VerticalRadioButton.qml @@ -67,6 +67,7 @@ RadioButton { width: 24 height: 24 } + Image { source: { if (showImage) { diff --git a/client/ui/qml/Pages2/PageSettingsAbout.qml b/client/ui/qml/Pages2/PageSettingsAbout.qml index 1875f085..9fc23c15 100644 --- a/client/ui/qml/Pages2/PageSettingsAbout.qml +++ b/client/ui/qml/Pages2/PageSettingsAbout.qml @@ -81,7 +81,8 @@ And if you don't like the app, all the more support it - the donation will be us text: qsTr("Card on Patreon") - onClicked: { + clickedFunction: function() { + Qt.openUrlExternally(qsTr("https://www.patreon.com/amneziavpn")) } } @@ -121,7 +122,7 @@ And if you don't like the app, all the more support it - the donation will be us leftImageSource: "qrc:/images/controls/telegram.svg" clickedFunction: function() { - Qt.openUrlExternally("https://t.me/amnezia_vpn_dev") + Qt.openUrlExternally(qsTr("https://t.me/amnezia_vpn_dev")) } } @@ -147,7 +148,7 @@ And if you don't like the app, all the more support it - the donation will be us leftImageSource: "qrc:/images/controls/github.svg" clickedFunction: function() { - Qt.openUrlExternally("https://github.com/amnezia-vpn/amnezia-client") + Qt.openUrlExternally(qsTr("https://github.com/amnezia-vpn/amnezia-client")) } } @@ -160,6 +161,7 @@ And if you don't like the app, all the more support it - the donation will be us leftImageSource: "qrc:/images/controls/amnezia.svg" clickedFunction: function() { + Qt.openUrlExternally(qsTr("amnezia.org/")) } }