chore: minor fixes (#2459)

* fix: fixed links on page with service description

* fix: fixed subscription text color

* chore: update ru translations

* chore: add save button

* fix: ru translation fixes
This commit is contained in:
vkamn
2026-04-10 21:24:00 +07:00
committed by GitHub
parent 493ee22883
commit 46f5b3894b
17 changed files with 389 additions and 203 deletions
+9 -10
View File
@@ -11,7 +11,11 @@ RowLayout {
property string iconSource: ""
property string titleText: ""
property string bodyText: ""
property bool accent: false
property bool link: false
readonly property string bodyLineText: root.link && root.bodyText.length > 0 ? "@" + root.bodyText : root.bodyText
readonly property bool bodyClickable: root.link && root.bodyText.length > 0
spacing: 12
@@ -43,22 +47,17 @@ RowLayout {
LabelTextType {
id: bodyLabel
width: parent.width
text: root.bodyText
color: root.accent ? AmneziaStyle.color.goldenApricot : AmneziaStyle.color.mutedGray
text: root.bodyLineText
color: root.link ? AmneziaStyle.color.goldenApricot : AmneziaStyle.color.mutedGray
font.pixelSize: 14
wrapMode: Text.Wrap
}
MouseArea {
anchors.fill: bodyLabel
visible: root.accent && root.bodyText.length > 0
visible: root.bodyClickable
cursorShape: Qt.PointingHandCursor
onClicked: {
var t = root.bodyText.trim()
if (t.startsWith("@")) {
Qt.openUrlExternally("https://t.me/" + t.substring(1))
}
}
onClicked: Qt.openUrlExternally("https://t.me/" + root.bodyText)
}
}
}
+1 -1
View File
@@ -33,7 +33,7 @@ Rectangle {
iconSource: model.icon
titleText: model.title
bodyText: model.body
accent: !!model.accent
link: !!model.link
}
}
}
+1 -1
View File
@@ -68,7 +68,7 @@ ListViewType {
text: name
descriptionText: isServerFromGatewayApi && (isSubscriptionExpired || isSubscriptionExpiringSoon)
? (isSubscriptionExpired ? qsTr("Subscription expired. Please renew.") : qsTr("Subscription expiring soon."))
? (isSubscriptionExpired ? qsTr("Subscription expired. Please renew") : qsTr("Subscription expiring soon"))
: serverDescription
descriptionColor: isServerFromGatewayApi && (isSubscriptionExpired || isSubscriptionExpiringSoon)
? (isSubscriptionExpired ? AmneziaStyle.color.vibrantRed : AmneziaStyle.color.goldenApricot)
@@ -57,7 +57,7 @@ DrawerType2 {
Layout.rightMargin: 16
Layout.leftMargin: 16
text: qsTr("Renew your subscription to continue using VPN")
text: qsTr("Renew to continue using VPN")
horizontalAlignment: Text.AlignLeft
}
@@ -17,6 +17,8 @@ ParagraphTextType {
textFormat: Text.RichText
color: AmneziaStyle.color.mutedGray
font.pixelSize: 12
lineHeight: 1.35
lineHeightMode: Text.ProportionalHeight
text: qsTr("By continuing, you agree to the <a href=\"%1\" style=\"color: %3;\">Terms of Use</a> and <a href=\"%2\" style=\"color: %3;\">Privacy Policy</a>")
.arg(root.termsUrl)
+11 -44
View File
@@ -28,20 +28,20 @@ Button {
property string leftImageSource
property real textOpacity: 1.0
property alias focusItem: rightImage
hoverEnabled: true
clip: false
readonly property real cardTextOpacity: !enabled ? 1.0 : pressed ? 0.7 : hovered ? 0.8 : 1.0
background: Rectangle {
id: backgroundRect
anchors.fill: parent
radius: 16
color: defaultColor
color: root.hovered && root.enabled ? root.hoveredColor : root.defaultColor
Behavior on color {
PropertyAnimation { duration: 200 }
@@ -51,6 +51,7 @@ Button {
contentItem: Item {
id: contentRoot
z: 1
anchors.left: parent.left
anchors.right: parent.right
@@ -129,7 +130,7 @@ Button {
Layout.topMargin: contentRoot.badgeVisible ? 0 : 16
Layout.bottomMargin: root.bodyText !== "" ? 0 : 16
opacity: root.textOpacity
opacity: root.cardTextOpacity
}
CaptionTextType {
@@ -138,13 +139,16 @@ Button {
color: root.bodyTextColor
textFormat: Text.RichText
onLinkActivated: function(link) {
Qt.openUrlExternally(link)
}
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: root.footerText !== "" ? 0 : 8
opacity: root.textOpacity
opacity: root.cardTextOpacity
}
ButtonTextType {
@@ -159,7 +163,7 @@ Button {
Layout.topMargin: 16
Layout.bottomMargin: 16
opacity: root.textOpacity
opacity: root.cardTextOpacity
}
}
@@ -184,7 +188,7 @@ Button {
anchors.fill: parent
radius: 12
color: "transparent"
color: root.pressed ? rightImage.pressedColor : root.hovered ? rightImage.hoveredColor : rightImage.defaultColor
Behavior on color {
PropertyAnimation { duration: 200 }
@@ -198,41 +202,4 @@ Button {
}
}
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
enabled: root.enabled
onEntered: {
backgroundRect.color = root.hoveredColor
if (rightImageSource) {
rightImageBackground.color = rightImage.hoveredColor
}
root.textOpacity = 0.8
}
onExited: {
backgroundRect.color = root.defaultColor
if (rightImageSource) {
rightImageBackground.color = rightImage.defaultColor
}
root.textOpacity = 1
}
onPressedChanged: {
if (rightImageSource) {
rightImageBackground.color = pressed ? rightImage.pressedColor : entered ? rightImage.hoveredColor : rightImage.defaultColor
}
root.textOpacity = 0.7
}
onClicked: {
root.clicked()
}
}
}
+18 -6
View File
@@ -2,8 +2,6 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import SortFilterProxyModel 0.2
import PageEnum 1.0
import Style 1.0
@@ -52,6 +50,8 @@ PageType {
width: listView.width
TextFieldWithHeaderType {
id: gatewayEndpointField
Layout.fillWidth: true
Layout.topMargin: 16
Layout.rightMargin: 16
@@ -64,13 +64,25 @@ PageType {
clickedFunc: function() {
SettingsController.resetGatewayEndpoint()
gatewayEndpointField.textField.text = SettingsController.gatewayEndpoint
}
}
textField.onEditingFinished: {
textField.text = textField.text.replace(/^\s+|\s+$/g, '')
if (textField.text !== SettingsController.gatewayEndpoint) {
SettingsController.gatewayEndpoint = textField.text
BasicButtonType {
id: saveButton
Layout.fillWidth: true
Layout.margins: 16
text: qsTr("Save")
clickedFunc: function() {
var trimmed = gatewayEndpointField.textField.text.replace(/^\s+|\s+$/g, '')
gatewayEndpointField.textField.text = trimmed
if (trimmed !== SettingsController.gatewayEndpoint) {
SettingsController.gatewayEndpoint = trimmed
}
PageController.showNotificationMessage(qsTr("Settings saved"))
}
}
}
@@ -99,7 +99,7 @@ PageType {
wrapMode: Text.WordWrap
color: AmneziaStyle.color.mutedGray
font.pixelSize: 12
text: qsTr("We will create an account for your trial subscription and send important subscription updates to this email.")
text: qsTr("We will create an account for your trial subscription and send important subscription updates to this email address")
}
}
}
@@ -278,7 +278,7 @@ PageType {
id: amneziaVpn
property string title: qsTr("VPN by Amnezia")
property string description: qsTr("The easiest way to connect to VPN")
property string description: qsTr("The easiest way to connect to the VPN")
property string imageSource: "qrc:/images/controls/amnezia.svg"
property bool featuredAmneziaConnection: true
property bool isVisible: true
@@ -94,7 +94,7 @@ PageType {
visible: title === qsTr("Password or SSH private key")
backGroundColor: AmneziaStyle.color.translucentWhite
iconPath: "qrc:/images/controls/alert-circle.svg"
textString: qsTr("SSH key requirements: supported ED25519 or RSA in PEM. Paste the private key including BEGIN/END lines. If your key doesnt work, generate a compatible one.")
textString: qsTr("SSH key requirements: supported key types are ED25519 and RSA in PEM format. Paste the private key, including the BEGIN/END lines. If your key doesnt work, generate a compatible one")
}
}