Skip to content
Snippets Groups Projects
Commit f186b32e authored by jkito's avatar jkito :skull:
Browse files

gui: add new buttons for vpn connection start/stop

this implements the buttons from the new design mockup
parent f8e80315
Branches
Tags
1 merge request!199gui: partial implementation of new design
...@@ -134,26 +134,27 @@ Item { ...@@ -134,26 +134,27 @@ Item {
VerticalSpacer { VerticalSpacer {
id: spacerPostImg id: spacerPostImg
visible: true visible: true
height: 20 height: 50
Layout.alignment: Qt.AlignBottom Layout.alignment: Qt.AlignBottom
} }
MaterialButton { RoundButton {
id: toggleVPN id: toggleVPN
// FIXME - this is a workaround. It will BREAK with i18n width: 48
width: 100 height: 48
spacing: 8
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Layout.alignment: Qt.AlignBottom Layout.alignment: Qt.AlignBottom
font { padding: 0
pixelSize: Theme.buttonFontSize display: AbstractButton.IconOnly
capitalization: Font.Capitalize
family: lightFont.name
bold: false
}
HoverHandler { HoverHandler {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
} }
icon {
source: Theme.buttonDisconnected
height: 48
width: 48
color: "transparent"
}
onClicked: { onClicked: {
if (vpn.state === "on" | vpn.state === "starting") { if (vpn.state === "on" | vpn.state === "starting") {
......
...@@ -63,9 +63,7 @@ StateGroup { ...@@ -63,9 +63,7 @@ StateGroup {
PropertyChanges { PropertyChanges {
target: toggleVPN target: toggleVPN
enabled: false enabled: false
// XXX this is a fake cancel, won't do anything at this point. We need icon.source: Theme.buttonConnecting
// to queue this action for when the openvpn process becomes available.
text: ("Cancel")
} }
PropertyChanges { PropertyChanges {
target: systray target: systray
...@@ -96,7 +94,7 @@ StateGroup { ...@@ -96,7 +94,7 @@ StateGroup {
PropertyChanges { PropertyChanges {
target: toggleVPN target: toggleVPN
enabled: true enabled: true
text: qsTr("Turn on") icon.source: Theme.buttonDisconnected
} }
PropertyChanges { PropertyChanges {
target: systray target: systray
...@@ -131,7 +129,7 @@ StateGroup { ...@@ -131,7 +129,7 @@ StateGroup {
PropertyChanges { PropertyChanges {
target: toggleVPN target: toggleVPN
enabled: true enabled: true
text: qsTr("Turn off") icon.source: Theme.buttonConnected
} }
PropertyChanges { PropertyChanges {
target: systray target: systray
...@@ -168,7 +166,7 @@ StateGroup { ...@@ -168,7 +166,7 @@ StateGroup {
PropertyChanges { PropertyChanges {
target: toggleVPN target: toggleVPN
enabled: true enabled: true
text: qsTr("Cancel") icon.source: Theme.buttonConnecting
} }
PropertyChanges { PropertyChanges {
target: systray target: systray
...@@ -204,6 +202,10 @@ StateGroup { ...@@ -204,6 +202,10 @@ StateGroup {
target: backgroundImage target: backgroundImage
source: customTheme.bgConnecting source: customTheme.bgConnecting
} }
PropertyChanges {
target: toggleVPN
icon.source: Theme.buttonConnecting
}
PropertyChanges { PropertyChanges {
target: systray target: systray
tooltip: toHuman("stopping") tooltip: toHuman("stopping")
......
...@@ -69,6 +69,9 @@ ...@@ -69,6 +69,9 @@
<file>resources/alert.svg</file> <file>resources/alert.svg</file>
<file>resources/angle-right.svg</file> <file>resources/angle-right.svg</file>
<file>resources/snowflake.svg</file> <file>resources/snowflake.svg</file>
<file>resources/button_green.png</file>
<file>resources/button_yellow.png</file>
<file>resources/button_red.png</file>
<!-- riseup assets --> <!-- riseup assets -->
<file>resources/ravens.svg</file> <file>resources/ravens.svg</file>
......
gui/resources/button_green.png

21.2 KiB

gui/resources/button_red.png

20.4 KiB

gui/resources/button_yellow.png

13.8 KiB

...@@ -64,5 +64,9 @@ const blueButton = { ...@@ -64,5 +64,9 @@ const blueButton = {
const buttonFontSize = 18; const buttonFontSize = 18;
const buttonColor = "#eeeeee"; const buttonColor = "#eeeeee";
const buttonDisconnected = "../resources/button_red.png";
const buttonConnecting = "../resources/button_yellow.png";
const buttonConnected = "../resources/button_green.png";
const bgColor = "#f3f3f3"; const bgColor = "#f3f3f3";
const fgColor = "#ffffff"; const fgColor = "#ffffff";
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment