feature: added country selection on home page drawer (#1215)
This commit is contained in:
parent
23806e1def
commit
aa871bd1c9
6 changed files with 51 additions and 24 deletions
|
|
@ -84,7 +84,7 @@ DrawerType2 {
|
||||||
Layout.topMargin: 16
|
Layout.topMargin: 16
|
||||||
|
|
||||||
text: qsTr("Share")
|
text: qsTr("Share")
|
||||||
imageSource: "qrc:/images/controls/share-2.svg"
|
leftImageSource: "qrc:/images/controls/share-2.svg"
|
||||||
|
|
||||||
KeyNavigation.tab: copyConfigTextButton
|
KeyNavigation.tab: copyConfigTextButton
|
||||||
|
|
||||||
|
|
@ -120,7 +120,7 @@ DrawerType2 {
|
||||||
borderWidth: 1
|
borderWidth: 1
|
||||||
|
|
||||||
text: qsTr("Copy")
|
text: qsTr("Copy")
|
||||||
imageSource: "qrc:/images/controls/copy.svg"
|
leftImageSource: "qrc:/images/controls/copy.svg"
|
||||||
|
|
||||||
Keys.onReturnPressed: { copyConfigTextButton.clicked() }
|
Keys.onReturnPressed: { copyConfigTextButton.clicked() }
|
||||||
Keys.onEnterPressed: { copyConfigTextButton.clicked() }
|
Keys.onEnterPressed: { copyConfigTextButton.clicked() }
|
||||||
|
|
@ -143,7 +143,7 @@ DrawerType2 {
|
||||||
borderWidth: 1
|
borderWidth: 1
|
||||||
|
|
||||||
text: qsTr("Copy config string")
|
text: qsTr("Copy config string")
|
||||||
imageSource: "qrc:/images/controls/copy.svg"
|
leftImageSource: "qrc:/images/controls/copy.svg"
|
||||||
|
|
||||||
KeyNavigation.tab: showSettingsButton
|
KeyNavigation.tab: showSettingsButton
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,10 @@ Button {
|
||||||
property int borderWidth: 0
|
property int borderWidth: 0
|
||||||
property int borderFocusedWidth: 1
|
property int borderFocusedWidth: 1
|
||||||
|
|
||||||
property string imageSource
|
property string leftImageSource
|
||||||
property string rightImageSource
|
property string rightImageSource
|
||||||
property string leftImageColor: textColor
|
property string leftImageColor
|
||||||
|
property bool changeLeftImageSize: true
|
||||||
|
|
||||||
property bool squareLeftSide: false
|
property bool squareLeftSide: false
|
||||||
|
|
||||||
|
|
@ -127,18 +128,23 @@ Button {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
Layout.preferredHeight: 20
|
id: leftImage
|
||||||
Layout.preferredWidth: 20
|
source: root.leftImageSource
|
||||||
|
visible: root.leftImageSource === "" ? false : true
|
||||||
source: root.imageSource
|
|
||||||
visible: root.imageSource === "" ? false : true
|
|
||||||
|
|
||||||
layer {
|
layer {
|
||||||
enabled: true
|
enabled: leftImageColor !== "" ? true : false
|
||||||
effect: ColorOverlay {
|
effect: ColorOverlay {
|
||||||
color: leftImageColor
|
color: leftImageColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (root.changeLeftImageSize) {
|
||||||
|
leftImage.Layout.preferredHeight = 20
|
||||||
|
leftImage.Layout.preferredWidth = 20
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ButtonTextType {
|
ButtonTextType {
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ Item {
|
||||||
|
|
||||||
focusPolicy: Qt.NoFocus
|
focusPolicy: Qt.NoFocus
|
||||||
text: root.buttonText
|
text: root.buttonText
|
||||||
imageSource: root.buttonImageSource
|
leftImageSource: root.buttonImageSource
|
||||||
|
|
||||||
anchors.top: content.top
|
anchors.top: content.top
|
||||||
anchors.bottom: content.bottom
|
anchors.bottom: content.bottom
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,6 @@ PageType {
|
||||||
pressedColor: AmneziaStyle.color.sheerWhite
|
pressedColor: AmneziaStyle.color.sheerWhite
|
||||||
disabledColor: AmneziaStyle.color.mutedGray
|
disabledColor: AmneziaStyle.color.mutedGray
|
||||||
textColor: AmneziaStyle.color.mutedGray
|
textColor: AmneziaStyle.color.mutedGray
|
||||||
leftImageColor: AmneziaStyle.color.transparent
|
|
||||||
borderWidth: 0
|
borderWidth: 0
|
||||||
|
|
||||||
buttonTextLabel.lineHeight: 20
|
buttonTextLabel.lineHeight: 20
|
||||||
|
|
@ -110,7 +109,7 @@ PageType {
|
||||||
|
|
||||||
text: isSplitTunnelingEnabled ? qsTr("Split tunneling enabled") : qsTr("Split tunneling disabled")
|
text: isSplitTunnelingEnabled ? qsTr("Split tunneling enabled") : qsTr("Split tunneling disabled")
|
||||||
|
|
||||||
imageSource: isSplitTunnelingEnabled ? "qrc:/images/controls/split-tunneling.svg" : ""
|
leftImageSource: isSplitTunnelingEnabled ? "qrc:/images/controls/split-tunneling.svg" : ""
|
||||||
rightImageSource: "qrc:/images/controls/chevron-down.svg"
|
rightImageSource: "qrc:/images/controls/chevron-down.svg"
|
||||||
|
|
||||||
Keys.onEnterPressed: splitTunnelingButton.clicked()
|
Keys.onEnterPressed: splitTunnelingButton.clicked()
|
||||||
|
|
@ -166,6 +165,7 @@ PageType {
|
||||||
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
drawer.collapsedHeight = collapsed.implicitHeight
|
drawer.collapsedHeight = collapsed.implicitHeight
|
||||||
|
|
@ -267,18 +267,39 @@ PageType {
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||||
Layout.bottomMargin: drawer.isCollapsed ? 44 : ServersModel.isDefaultServerFromApi ? 89 : 44
|
Layout.topMargin: 8
|
||||||
|
Layout.bottomMargin: drawer.isCollapsed ? 44 : ServersModel.isDefaultServerFromApi ? 61 : 16
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
Image {
|
BasicButtonType {
|
||||||
Layout.rightMargin: 8
|
enabled: (ServersModel.defaultServerImagePathCollapsed !== "") && drawer.isCollapsed
|
||||||
visible: source !== ""
|
hoverEnabled: enabled
|
||||||
source: ServersModel.defaultServerImagePathCollapsed
|
|
||||||
}
|
implicitHeight: 36
|
||||||
|
|
||||||
|
leftPadding: 16
|
||||||
|
rightPadding: 16
|
||||||
|
|
||||||
|
defaultColor: AmneziaStyle.color.transparent
|
||||||
|
hoveredColor: AmneziaStyle.color.translucentWhite
|
||||||
|
pressedColor: AmneziaStyle.color.sheerWhite
|
||||||
|
disabledColor: AmneziaStyle.color.transparent
|
||||||
|
textColor: AmneziaStyle.color.mutedGray
|
||||||
|
|
||||||
|
buttonTextLabel.lineHeight: 16
|
||||||
|
buttonTextLabel.font.pixelSize: 13
|
||||||
|
buttonTextLabel.font.weight: 400
|
||||||
|
|
||||||
LabelTextType {
|
|
||||||
id: collapsedServerMenuDescription
|
|
||||||
text: drawer.isCollapsed ? ServersModel.defaultServerDescriptionCollapsed : ServersModel.defaultServerDescriptionExpanded
|
text: drawer.isCollapsed ? ServersModel.defaultServerDescriptionCollapsed : ServersModel.defaultServerDescriptionExpanded
|
||||||
|
leftImageSource: ServersModel.defaultServerImagePathCollapsed
|
||||||
|
changeLeftImageSize: false
|
||||||
|
|
||||||
|
rightImageSource: hoverEnabled ? "qrc:/images/controls/chevron-down.svg" : ""
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
ServersModel.processedIndex = ServersModel.defaultIndex
|
||||||
|
PageController.goToPage(PageEnum.PageSettingsServerInfo)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -573,7 +573,7 @@ PageType {
|
||||||
visible: accessTypeSelector.currentIndex === 0
|
visible: accessTypeSelector.currentIndex === 0
|
||||||
|
|
||||||
text: qsTr("Share")
|
text: qsTr("Share")
|
||||||
imageSource: "qrc:/images/controls/share-2.svg"
|
leftImageSource: "qrc:/images/controls/share-2.svg"
|
||||||
|
|
||||||
Keys.onTabPressed: lastItemTabClicked(focusItem)
|
Keys.onTabPressed: lastItemTabClicked(focusItem)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ PageType {
|
||||||
Layout.topMargin: 40
|
Layout.topMargin: 40
|
||||||
|
|
||||||
text: qsTr("Share")
|
text: qsTr("Share")
|
||||||
imageSource: "qrc:/images/controls/share-2.svg"
|
leftImageSource: "qrc:/images/controls/share-2.svg"
|
||||||
|
|
||||||
Keys.onTabPressed: lastItemTabClicked(focusItem)
|
Keys.onTabPressed: lastItemTabClicked(focusItem)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue