Multiple ui fixes, save file function reimpl
This commit is contained in:
parent
b63bf2465f
commit
c233f767f4
22 changed files with 229 additions and 2601 deletions
|
@ -1,5 +1,6 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import PageEnum 1.0
|
||||
import "./"
|
||||
|
@ -13,176 +14,155 @@ PageBase {
|
|||
|
||||
BackButton {
|
||||
id: back
|
||||
z: -1
|
||||
}
|
||||
|
||||
// ---------- App settings ------------
|
||||
Rectangle {
|
||||
id: l1
|
||||
visible: !GC.isMobile()
|
||||
Flickable {
|
||||
id: fl
|
||||
width: root.width
|
||||
anchors.top: back.bottom
|
||||
x: 20
|
||||
width: parent.width - 40
|
||||
height: GC.isMobile() ? 0: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
anchors.topMargin: 0
|
||||
anchors.bottom: root.bottom
|
||||
anchors.bottomMargin: 10
|
||||
anchors.left: root.left
|
||||
anchors.leftMargin: 30
|
||||
anchors.right: root.right
|
||||
anchors.rightMargin: 30
|
||||
|
||||
SettingButtonType {
|
||||
id: b1
|
||||
visible: !GC.isMobile()
|
||||
anchors.top: l1.bottom
|
||||
anchors.topMargin: GC.isMobile() ? 0: 15
|
||||
x: 30
|
||||
width: parent.width - 80
|
||||
height: GC.isMobile() ? 0: 30
|
||||
icon.source: "qrc:/images/svg/settings_black_24dp.svg"
|
||||
text: qsTr("App settings")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.AppSettings)
|
||||
contentHeight: content.height
|
||||
clip: true
|
||||
|
||||
ColumnLayout {
|
||||
id: content
|
||||
enabled: logic.pageEnabled
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 10
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
spacing: 15
|
||||
|
||||
|
||||
// ---------- App settings ------------
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
SettingButtonType {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 30
|
||||
icon.source: "qrc:/images/svg/settings_black_24dp.svg"
|
||||
text: qsTr("App settings")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.AppSettings)
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- Network settings ------------
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
SettingButtonType {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 30
|
||||
icon.source: "qrc:/images/svg/settings_suggest_black_24dp.svg"
|
||||
text: qsTr("Network settings")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.NetworkSettings)
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- Server settings ------------
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
SettingButtonType {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 30
|
||||
icon.source: "qrc:/images/svg/vpn_key_black_24dp.svg"
|
||||
text: qsTr("Server Settings")
|
||||
onClicked: {
|
||||
GeneralSettingsLogic.onPushButtonGeneralSettingsServerSettingsClicked()
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- Share connection ------------
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
SettingButtonType {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 30
|
||||
icon.source: "qrc:/images/svg/share_black_24dp.svg"
|
||||
text: qsTr("Share connection")
|
||||
enabled: GeneralSettingsLogic.pushButtonGeneralSettingsShareConnectionEnable
|
||||
onClicked: {
|
||||
GeneralSettingsLogic.onPushButtonGeneralSettingsShareConnectionClicked()
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- Servers ------------
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
SettingButtonType {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 30
|
||||
icon.source: "qrc:/images/svg/format_list_bulleted_black_24dp.svg"
|
||||
text: qsTr("Servers")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.ServersList)
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- Add server ------------
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
SettingButtonType {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 30
|
||||
icon.source: "qrc:/images/svg/control_point_black_24dp.svg"
|
||||
text: qsTr("Add server")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.Start)
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: fl.height > (75+1) * 6 ? fl.height - (75+1) * 6 : 0
|
||||
}
|
||||
|
||||
SettingButtonType {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 30
|
||||
Layout.bottomMargin: 20
|
||||
icon.source: "qrc:/images/svg/logout_black_24dp.svg"
|
||||
text: qsTr("Exit")
|
||||
onClicked: {
|
||||
Qt.quit()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- Network settings ------------
|
||||
Rectangle {
|
||||
id: l2
|
||||
anchors.top: b1.bottom
|
||||
anchors.topMargin: 15
|
||||
x: 20
|
||||
width: parent.width - 40
|
||||
height: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
SettingButtonType {
|
||||
id: b2
|
||||
x: 30
|
||||
anchors.top: l2.bottom
|
||||
anchors.topMargin: 15
|
||||
width: parent.width - 40
|
||||
height: 30
|
||||
icon.source: "qrc:/images/svg/settings_suggest_black_24dp.svg"
|
||||
text: qsTr("Network settings")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.NetworkSettings)
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- Server settings ------------
|
||||
Rectangle {
|
||||
id: l3
|
||||
anchors.top: b2.bottom
|
||||
anchors.topMargin: 15
|
||||
x: 20
|
||||
width: parent.width - 40
|
||||
height: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
SettingButtonType {
|
||||
id: b3
|
||||
x: 30
|
||||
anchors.top: l3.bottom
|
||||
anchors.topMargin: 15
|
||||
width: 330
|
||||
height: 30
|
||||
icon.source: "qrc:/images/svg/vpn_key_black_24dp.svg"
|
||||
text: qsTr("Server Settings")
|
||||
onClicked: {
|
||||
GeneralSettingsLogic.onPushButtonGeneralSettingsServerSettingsClicked()
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- Share connection ------------
|
||||
Rectangle {
|
||||
id: l4
|
||||
anchors.top: b3.bottom
|
||||
anchors.topMargin: 15
|
||||
x: 20
|
||||
width: parent.width - 40
|
||||
height: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
SettingButtonType {
|
||||
id: b4
|
||||
x: 30
|
||||
anchors.top: l4.bottom
|
||||
anchors.topMargin: 15
|
||||
width: 330
|
||||
height: 30
|
||||
icon.source: "qrc:/images/svg/share_black_24dp.svg"
|
||||
text: qsTr("Share connection")
|
||||
enabled: GeneralSettingsLogic.pushButtonGeneralSettingsShareConnectionEnable
|
||||
onClicked: {
|
||||
GeneralSettingsLogic.onPushButtonGeneralSettingsShareConnectionClicked()
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- Servers ------------
|
||||
Rectangle {
|
||||
id: l5
|
||||
anchors.top: b4.bottom
|
||||
anchors.topMargin: 15
|
||||
x: 20
|
||||
width: parent.width - 40
|
||||
height: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
SettingButtonType {
|
||||
id: b5
|
||||
x: 30
|
||||
anchors.top: l5.bottom
|
||||
anchors.topMargin: 15
|
||||
width: 330
|
||||
height: 30
|
||||
icon.source: "qrc:/images/svg/format_list_bulleted_black_24dp.svg"
|
||||
text: qsTr("Servers")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.ServersList)
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- Add server ------------
|
||||
Rectangle {
|
||||
id: l6
|
||||
anchors.top: b5.bottom
|
||||
anchors.topMargin: 15
|
||||
x: 20
|
||||
width: parent.width - 40
|
||||
height: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
SettingButtonType {
|
||||
id: b6
|
||||
x: 30
|
||||
anchors.top: l6.bottom
|
||||
anchors.topMargin: 15
|
||||
width: 330
|
||||
height: 30
|
||||
icon.source: "qrc:/images/svg/control_point_black_24dp.svg"
|
||||
text: qsTr("Add server")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.Start)
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: l7
|
||||
anchors.top: b6.bottom
|
||||
anchors.topMargin: 15
|
||||
x: 20
|
||||
width: parent.width - 40
|
||||
height: 1
|
||||
color: "#DDDDDD"
|
||||
}
|
||||
|
||||
|
||||
SettingButtonType {
|
||||
x: 30
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 20
|
||||
width: 330
|
||||
height: 30
|
||||
icon.source: "qrc:/images/svg/logout_black_24dp.svg"
|
||||
text: qsTr("Exit")
|
||||
onClicked: {
|
||||
Qt.quit()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue