From dcf660f343a7ba85feb693ee5db40894829e7804 Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Mon, 29 Nov 2021 17:12:06 +0100 Subject: [ui] ui fixes after field test recommendations --- gui/components/About.qml | 16 ++++++----- gui/components/Locations.qml | 57 ++++++++++++++++++++++++++++++++++----- gui/components/MainView.qml | 2 +- gui/components/MaterialButton.qml | 3 +-- gui/components/Preferences.qml | 4 +-- gui/components/StatusBox.qml | 2 +- 6 files changed, 64 insertions(+), 20 deletions(-) (limited to 'gui/components') diff --git a/gui/components/About.qml b/gui/components/About.qml index cceaad4..291c491 100644 --- a/gui/components/About.qml +++ b/gui/components/About.qml @@ -26,6 +26,7 @@ ThemedPage { width: parent.width Text { + textFormat: Text.RichText width: parent.width - 40 color: Theme.fontColor font.pixelSize: 12 @@ -58,8 +59,6 @@ ThemedPage { readOnly: true selectByMouse: true text: getVersion() - //horizontalAlignment: Text.AlignCenter - //anchors.horizontalCenter: parent.horizontalCenter } } @@ -79,16 +78,19 @@ ThemedPage { if (_donateURL) { //: donation text of the about dialog _donateTXT = qsTr( - "

This service is paid for entirely by donations from users like you. Please donate.

").arg( - _donateURL) + "

This service is paid for entirely by donations from users like you. Please donate.

").arg(_donateURL) + } + if (_provider == "Riseup") { + // XXX this is a quick workaround. About-us should be parametrized too. + _provider = "" + ctx.provider + "" } //: about dialog //: %1 -> application name //: %2 -> provider name //: %3 -> donation text if activated - var _txt = qsTr( - "

%1 is an easy, fast, and secure VPN service from %2. %1 does not require a user account, keep logs, or track you in any way.

%3

By using this application, you agree to the Terms of Service. This service is provided as-is, without any warranty, and is intended for people who work to make the world a better place.

").arg( - _name).arg(_provider).arg(_donateTXT).arg(_tosURL) + //: %4 -> terms of service + let _txt = qsTr( + "

%1 is an easy, fast, and secure VPN service from %2. %1 does not require a user account, keep logs, or track you in any way.

%3

By using this application, you agree to the Terms of Service. This service is provided as-is, without any warranty, and is intended for people who work to make the world a better place.

").arg(_name).arg(_provider).arg(_donateTXT).arg(_tosURL) return _txt } diff --git a/gui/components/Locations.qml b/gui/components/Locations.qml index 624d5a0..30a34e5 100644 --- a/gui/components/Locations.qml +++ b/gui/components/Locations.qml @@ -56,12 +56,37 @@ ThemedPage { fill: parent margins: 10 } - Label { - id: recommendedLabel - //: Location Selection: label for radio button that selects automatically - text: qsTr("Recommended") - font.weight: Font.Bold - font.bold: true + Rectangle { + id: recommendedHeader + height: 20 + Label { + id: recommendedLabel + //: Location Selection: label for radio button that selects automatically + text: qsTr("Recommended") + font.weight: Font.Bold + font.bold: true + } + Image { + id: lightning + smooth: true + width: 16 + source: "../resources/lightning.svg" + fillMode: Image.PreserveAspectFit + verticalAlignment: Image.AlignVCenter + anchors { + left: recommendedLabel.right + top: parent.top + leftMargin: 5 + topMargin: 2 + //verticalCenterOffset: 3 + } + ColorOverlay{ + anchors.fill: lightning + source: lightning + color: "black" + antialiasing: true + } + } } WrappedRadioButton { id: autoRadioButton @@ -69,7 +94,7 @@ ThemedPage { ButtonGroup.group: locsel checked: false anchors { - top: recommendedLabel.bottom + top: recommendedHeader.bottom leftMargin: -5 } HoverHandler { @@ -226,11 +251,20 @@ ThemedPage { function getAutoLabel() { let l = autoSelectionLabel + /* There's been some discussion about whether to include this. + An argument is that it is not 100% sure that we're going to connect + to this "recommended" gateway. However, it's fair to tell the user what's likely + to be the recomended location, to make a better choice. ALso, we can + implement a warning if finally connecting to a different location. + That said, all is made worse by the fact that menshen will not return + the "right" location if we're connecting from the vpn, a proxy etc... For that we need to modify menshen to accept a location parameter. + Disabling the hint for now, but some agreement needs to be done on android + desktop about this behavior. if (ctx && ctx.locations && ctx.bestLocation) { let best = ctx.locationLabels[ctx.bestLocation] let label = best[0] + ", " + best[1] l += " (" + label + ")" } + */ return l } @@ -267,6 +301,15 @@ ThemedPage { } } + function getLocationColor() { + if (ctx && ctx.status == "on") { + return "black" + } else { + // TODO darker gray + return "gray" + } + } + function isBridgeSelected() { if (ctx && ctx.transport == "obfs4") { return true diff --git a/gui/components/MainView.qml b/gui/components/MainView.qml index c103565..0893a2a 100644 --- a/gui/components/MainView.qml +++ b/gui/components/MainView.qml @@ -53,7 +53,7 @@ Page { text: qsTr("Donate") icon: "../resources/donate.svg" triggered: function () { - donateDialog.open() + Qt.openUrlExternally(ctx.donateURL) } } ListElement { diff --git a/gui/components/MaterialButton.qml b/gui/components/MaterialButton.qml index 7d4ff47..8e90e94 100644 --- a/gui/components/MaterialButton.qml +++ b/gui/components/MaterialButton.qml @@ -40,8 +40,7 @@ T.Button { text: control.text font: control.font - color: !control.enabled ? control.Material.hintTextColor : control.flat - && control.highlighted ? control.Material.accentColor : control.highlighted ? control.Material.primaryHighlightedTextColor : control.Material.foreground + color: !control.enabled ? control.Material.hintTextColor : control.flat && control.highlighted ? control.Material.accentColor : control.highlighted ? control.Material.primaryHighlightedTextColor : "black" } background: Rectangle { diff --git a/gui/components/Preferences.qml b/gui/components/Preferences.qml index 3de8acb..23aae05 100644 --- a/gui/components/Preferences.qml +++ b/gui/components/Preferences.qml @@ -53,7 +53,7 @@ ThemedPage { } Label { - text: qsTr("These techniques can bypass censorship, but are slower. Use them only when needed") + text: qsTr("These techniques can bypass censorship, but are slower. Use them only when needed.") color: "gray" visible: true wrapMode: Text.Wrap @@ -154,7 +154,7 @@ ThemedPage { MaterialCheckBox { id: useUDP - text: qsTr("UDP") + text: qsTr("Use UDP if available") enabled: false checked: false Layout.leftMargin: 10 diff --git a/gui/components/StatusBox.qml b/gui/components/StatusBox.qml index 6036264..1d3d720 100644 --- a/gui/components/StatusBox.qml +++ b/gui/components/StatusBox.qml @@ -36,7 +36,7 @@ Item { } border { color: Theme.accentOff - width: 2 + width: 4 } } -- cgit v1.2.3