Skip to content
Snippets Groups Projects
Unverified Commit 49755a32 authored by Kali Kaneko's avatar Kali Kaneko
Browse files

[ui] pointing hand for locations and buttons

parent 94d6694a
No related branches found
No related tags found
No related merge requests found
import QtQuick 2.0 import QtQuick 2.15
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Controls.Material 2.1 import QtQuick.Controls.Material 2.1
import QtQuick.Layouts 1.14 import QtQuick.Layouts 1.14
...@@ -25,20 +25,17 @@ ToolBar { ...@@ -25,20 +25,17 @@ ToolBar {
anchors { anchors {
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
leftMargin: 10 leftMargin: 10
// TODO discuss where this should be aligned
//leftMargin: 22
left: parent.left left: parent.left
verticalCenterOffset: 5 verticalCenterOffset: 5
} }
/*
background.implicitHeight: 32
background.implicitWidth: 32
*/
icon { icon {
width: 20 width: 20
height: 20 height: 20
source: stackView.depth > 1 ? "" : "../resources/globe.svg" source: stackView.depth > 1 ? "" : "../resources/globe.svg"
} }
HoverHandler {
cursorShape: Qt.PointingHandCursor
}
onClicked: stackView.push("Locations.qml") onClicked: stackView.push("Locations.qml")
} }
...@@ -64,14 +61,19 @@ ToolBar { ...@@ -64,14 +61,19 @@ ToolBar {
Label { Label {
id: locationLabel id: locationLabel
text: locationStr()
color: getLocationColor()
anchors { anchors {
left: lightning.right left: lightning.right
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
verticalCenterOffset: 7 verticalCenterOffset: 7
leftMargin: (ctx != undefined & root.selectedGateway == "auto") ? 0 : -12 leftMargin: (ctx != undefined & root.selectedGateway == "auto") ? 0 : -12
} }
text: locationStr() MouseArea {
color: getLocationColor() cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: stackView.push("Locations.qml")
}
} }
Item { Item {
......
import QtQuick 2.0 import QtQuick 2.15
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
import QtQuick.Controls.Material 2.1 import QtQuick.Controls.Material 2.1
...@@ -22,6 +22,9 @@ ToolBar { ...@@ -22,6 +22,9 @@ ToolBar {
} }
font.pixelSize: Qt.application.font.pixelSize * 1.6 font.pixelSize: Qt.application.font.pixelSize * 1.6
icon.source: "../resources/arrow-left.svg" icon.source: "../resources/arrow-left.svg"
HoverHandler {
cursorShape: Qt.PointingHandCursor
}
onClicked: { onClicked: {
if (stackView.depth > 1) { if (stackView.depth > 1) {
stackView.pop() stackView.pop()
......
import QtQuick 2.9 import QtQuick 2.15
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.14 import QtQuick.Layouts 1.14
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
...@@ -60,7 +60,7 @@ ThemedPage { ...@@ -60,7 +60,7 @@ ThemedPage {
id: recommendedLabel id: recommendedLabel
//: Location Selection: label for radio button that selects automatically //: Location Selection: label for radio button that selects automatically
text: qsTr("Recommended") text: qsTr("Recommended")
font.weight: Font.Bold font.weight: Font.Bold
font.bold: true font.bold: true
} }
WrappedRadioButton { WrappedRadioButton {
...@@ -72,6 +72,9 @@ ThemedPage { ...@@ -72,6 +72,9 @@ ThemedPage {
top: recommendedLabel.bottom top: recommendedLabel.bottom
leftMargin: -5 leftMargin: -5
} }
HoverHandler {
cursorShape: Qt.PointingHandCursor
}
onClicked: { onClicked: {
root.selectedGateway = "auto" root.selectedGateway = "auto"
console.debug("Selected gateway: auto") console.debug("Selected gateway: auto")
...@@ -131,11 +134,11 @@ ThemedPage { ...@@ -131,11 +134,11 @@ ThemedPage {
color: "gray" color: "gray"
visible: isBridgeSelected() visible: isBridgeSelected()
wrapMode: Text.Wrap wrapMode: Text.Wrap
font.pixelSize: Theme.fontSize - 3
anchors { anchors {
topMargin: 5 topMargin: 5
top: manualLabel.bottom top: manualLabel.bottom
} }
font.pixelSize: Theme.fontSize - 3
} }
ColumnLayout { ColumnLayout {
...@@ -160,6 +163,9 @@ ThemedPage { ...@@ -160,6 +163,9 @@ ThemedPage {
ButtonGroup.group: locsel ButtonGroup.group: locsel
checked: false checked: false
enabled: locationPage.switching ? false : true enabled: locationPage.switching ? false : true
HoverHandler {
cursorShape: Qt.PointingHandCursor
}
onClicked: { onClicked: {
if (ctx.status == "on") { if (ctx.status == "on") {
locationPage.switching = true locationPage.switching = true
......
import QtQuick 2.12 import QtQuick 2.15
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtGraphicalEffects 1.14 import QtGraphicalEffects 1.14
import QtQuick.Layouts 1.14 import QtQuick.Layouts 1.14
...@@ -29,7 +29,6 @@ Item { ...@@ -29,7 +29,6 @@ Item {
height: 300 height: 300
radius: 10 radius: 10
antialiasing: true antialiasing: true
anchors { anchors {
fill: parent fill: parent
margins: 20 margins: 20
...@@ -46,14 +45,15 @@ Item { ...@@ -46,14 +45,15 @@ Item {
objectName: "settingsButton" objectName: "settingsButton"
font.pixelSize: Qt.application.font.pixelSize * 1.6 font.pixelSize: Qt.application.font.pixelSize * 1.6
opacity: 1 opacity: 1
anchors { anchors {
top: parent.top top: parent.top
left: parent.left left: parent.left
topMargin: Theme.windowMargin + 5 topMargin: Theme.windowMargin + 5
leftMargin: Theme.windowMargin + 5 leftMargin: Theme.windowMargin + 5
} }
HoverHandler {
cursorShape: Qt.PointingHandCursor
}
onClicked: { onClicked: {
if (stackView.depth > 1) { if (stackView.depth > 1) {
stackView.pop() stackView.pop()
...@@ -126,16 +126,17 @@ Item { ...@@ -126,16 +126,17 @@ Item {
// FIXME - this is a workaround. It will BREAK with i18n // FIXME - this is a workaround. It will BREAK with i18n
width: 100 width: 100
spacing: 8 spacing: 8
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Layout.alignment: Qt.AlignBottom Layout.alignment: Qt.AlignBottom
font { font {
pixelSize: Theme.buttonFontSize pixelSize: Theme.buttonFontSize
capitalization: Font.Capitalize capitalization: Font.Capitalize
family: lightFont.name family: lightFont.name
bold: false bold: false
} }
HoverHandler {
cursorShape: Qt.PointingHandCursor
}
onClicked: { onClicked: {
if (vpn.state === "on" | vpn.state === "starting") { if (vpn.state === "on" | vpn.state === "starting") {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment