added connectionController and ConnectionButton.qml

This commit is contained in:
vladimir.kuznetsov 2023-05-12 23:54:31 +08:00
parent dd0de7e8be
commit 35d4222c7a
17 changed files with 233 additions and 60 deletions

View file

@ -0,0 +1,40 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Button {
id: root
implicitHeight: 190
implicitWidth: 190
background: Rectangle {
id: background
radius: parent.width * 0.5
color: "transparent"
border.width: 2
border.color: "white"
}
contentItem: Text {
height: 24
font.family: "PT Root UI VF"
font.weight: 700
font.pixelSize: 20
color: "#D7D8DB"
text: root.text
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
onClicked: {
background.color = "red"
ConnectionController.onConnectionButtonClicked()
}
}

View file

@ -5,7 +5,7 @@ Text {
color: "#D7D8DB"
font.pixelSize: 16
font.weight: 500
font.weight: Font.Medium
font.family: "PT Root UI VF"
wrapMode: Text.WordWrap

View file

@ -5,7 +5,7 @@ Text {
color: "#D7D8DB"
font.pixelSize: 36
font.weight: 700
font.weight: Font.Bold
font.family: "PT Root UI VF"
font.letterSpacing: -0.03

View file

@ -5,7 +5,7 @@ Text {
color: "#D7D8DB"
font.pixelSize: 25
font.weight: 700
font.weight: Font.Bold
font.family: "PT Root UI VF"
wrapMode: Text.WordWrap

View file

@ -5,7 +5,7 @@ Text {
color: "#878B91"
font.pixelSize: 13
font.weight: 400
font.weight: Font.Normal
font.family: "PT Root UI VF"
font.letterSpacing: 0.02

View file

@ -5,7 +5,7 @@ Text {
color: "#D7D8DB"
font.pixelSize: 16
font.weight: 400
font.weight: Font.Normal
font.family: "PT Root UI VF"
wrapMode: Text.WordWrap

View file

@ -12,6 +12,7 @@ import "../Pages"
import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"
import "../Components"
PageBase {
id: root
@ -24,6 +25,12 @@ PageBase {
property string currentServerName: serversMenuContent.currentItem.delegateData.desc
property string currentServerDescription: serversMenuContent.currentItem.delegateData.address
ConnectButton {
anchors.centerIn: parent
text: "Подключиться"
}
Rectangle {
id: buttonBackground
anchors.fill: buttonContent
@ -136,11 +143,11 @@ PageBase {
sourceModel: ContainersModel
filters: [
ValueFilter {
roleName: "service_type_role"
roleName: "serviceType"
value: ProtocolEnum.Vpn
},
ValueFilter {
roleName: "is_installed_role"
roleName: "isInstalled"
value: true
}
]
@ -153,7 +160,7 @@ PageBase {
borderWidth: 0
buttonImageColor: "#0E0E11"
buttonMaximumWidth: 150
buttonMaximumWidth: 150 //todo make it dynamic
defaultColor: "#D7D8DB"
@ -183,7 +190,7 @@ PageBase {
checked: {
if (modelData !== null) {
return modelData.default_role
return modelData.isDefault
}
return false
}
@ -208,7 +215,7 @@ PageBase {
// todo remove dirty hack?
text: {
if (modelData !== null) {
return modelData.name_role
return modelData.name
} else
return ""
}
@ -235,7 +242,7 @@ PageBase {
}
onClicked: {
modelData.default_role = true
modelData.isDefault = true
containersDropDown.text = containerRadioButtonText.text
containersDropDown.menuVisible = false
@ -243,14 +250,16 @@ PageBase {
}
Component.onCompleted: {
if (modelData !== null && modelData.default_role) {
containersDropDown.text = modelData.name_role
if (modelData !== null && modelData.isDefault) {
containersDropDown.text = modelData.name
}
}
}
}
BasicButtonType {
id: dnsButton
implicitHeight: 40
text: "Amnezia DNS"