added PageHome, PageSettings, PageShare, PageStart

- renamed old PageStart to PageSetupWizardStart
- added various text types
- moved servers model to "global" scope
This commit is contained in:
vladimir.kuznetsov 2023-05-06 06:52:23 +03:00
parent 4f36349630
commit 1c8dbae359
28 changed files with 735 additions and 226 deletions

View file

@ -7,154 +7,74 @@ import PageEnum 1.0
import "./"
import "../Pages"
import "../Controls2"
import "../Config"
import "../Controls2/TextTypes"
import "../Config"
PageBase {
id: root
page: PageEnum.PageStart
FlickableType {
id: fl
anchors.top: root.top
anchors.bottom: root.bottom
contentHeight: content.height
StackLayout {
id: stackLayout
currentIndex: tabBar.currentIndex
ColumnLayout {
id: content
anchors.top: parent.top
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: tabBar.top
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
Image {
id: image
source: "qrc:/images/amneziaBigLogo.png"
Layout.alignment: Qt.AlignCenter
Layout.topMargin: 32
Layout.leftMargin: 8
Layout.rightMargin: 8
Layout.preferredWidth: 344
Layout.preferredHeight: 279
}
BodyTextType {
Layout.fillWidth: true
Layout.topMargin: 50
Layout.leftMargin: 16
Layout.rightMargin: 16
text: "Бесплатный сервис для создания личного VPN на вашем сервере. Помогаем получать доступ к заблокированному контенту, не раскрывая конфиденциальность даже провайдерам VPN."
}
BasicButtonType {
Layout.fillWidth: true
Layout.topMargin: 32
Layout.leftMargin: 16
Layout.rightMargin: 16
text: qsTr("У меня есть данные для подключения")
onClicked: {
drawer.visible = true
}
}
BasicButtonType {
Layout.fillWidth: true
Layout.topMargin: 8
Layout.leftMargin: 16
Layout.rightMargin: 16
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#D7D8DB"
borderWidth: 1
text: qsTr("У меня ничего нет")
onClicked: {
UiLogic.goToPage(PageEnum.PageTest)
}
}
width: {
console.log(parent.width)
return parent.width
}
height: {
console.log(root.height - tabBar.implicitHeight)
return root.height - tabBar.implicitHeight
}
Drawer {
id: drawer
PageHome {
}
edge: Qt.BottomEdge
width: parent.width
height: parent.height * 0.4375
clip: true
modal: true
background: Rectangle {
anchors.fill: parent
anchors.bottomMargin: -radius
radius: 16
color: "#1C1D21"
}
Overlay.modal: Rectangle {
color: Qt.rgba(14/255, 14/255, 17/255, 0.8)
}
ColumnLayout {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 16
anchors.leftMargin: 16
Header2TextType {
Layout.fillWidth: true
Layout.topMargin: 24
Layout.alignment: Qt.AlignHCenter
text: "Данные для подключения"
wrapMode: Text.WordWrap
}
LabelWithButtonType {
id: ip
Layout.fillWidth: true
Layout.topMargin: 32
text: "IP, логин и пароль от сервера"
buttonImage: "qrc:/images/controls/chevron-right.svg"
onClickedFunc: function() {
UiLogic.goToPage(PageEnum.PageSetupWizardCredentials)
drawer.visible = false
}
}
Rectangle {
Layout.fillWidth: true
height: 1
color: "#2C2D30"
}
LabelWithButtonType {
Layout.fillWidth: true
text: "QR-код, ключ или файл настроек"
buttonImage: "qrc:/images/controls/chevron-right.svg"
onClickedFunc: function() {
UiLogic.goToPage(PageEnum.PageSetupWizardConfigSource)
drawer.visible = false
}
}
Rectangle {
Layout.fillWidth: true
height: 1
color: "#2C2D30"
}
}
PageSetupWizardEasy {
}
}
TabBar {
id: tabBar
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: parent.bottom
topPadding: 8
bottomPadding: 34
leftPadding: 96
rightPadding: 96
background: Rectangle {
color: "#1C1D21"
}
TabImageButtonType {
isSelected: tabBar.currentIndex === 0
image: "qrc:/images/controls/home.svg"
}
TabImageButtonType {
isSelected: tabBar.currentIndex === 1
image: "qrc:/images/controls/share-2.svg"
}
TabImageButtonType {
isSelected: tabBar.currentIndex === 2
image: "qrc:/images/controls/settings-2.svg"
}
}
MouseArea {
anchors.fill: tabBar
anchors.leftMargin: 96
anchors.rightMargin: 96
cursorShape: Qt.PointingHandCursor
enabled: false
}
}