mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
refactoring: improved stability of focus controller (#1464)
* change position view mode * remove `parentFlickable` from `PageShare` * replace `FlickableType` with `ListViewType` in `PageSettings` * reorganize `PageSettingsAbout` for improved structure * replace `Flickable` with `ListViewType` in drawer in `PageSettingsApiNativeConfigs` * replace `FlickableType` with `ListViewType` in `PageSettingsApplication` and update layout structure * replace `FlickableType` with `ListViewType` in `PageSettingsAppSplitTunneling` and adjust layout for better structure * replace `FlickableType` with `ListViewType` in `PageSettingsBackup` * replace `FlickableType` with `ListViewType` in `PageSettingsConnection` * replace `FlickableType` with `ListViewType` in `PageSettingsDns` * replace `FlickableType` with `ListViewType` in `PageSettingsLogging` * replace `FlickableType` with `ListViewType` in `PageSettingsServerData` * update structure of `PageSettingsServerProtocol` * update `PageSettingsServersList` * replace `ListView` with `ListViewType` in `PageSettingsSplitTunneling` * replace `FlickableType` with `ListViewType` in `PageServiceDnsSettings` * update `PageServiceSftpSettings` * update `PageServiceSocksProxySettings` * replace `FlickableType` with `ListViewType` in `PageServiceTorWebsiteSettings` * replace `FlickableType` with `ListViewType` in `PageSetupWizardApiServiceInfo` * update `PageSetupWizardApiServicesList` * replace `ListView` with `ListViewType` in `PageSetupWizardConfigSource` * replace `ListView` with `ListViewType` in `PageSetupWizardCredentials` * replace `FlickableType` with `ListViewType` in `PageSetupWizardEasy` * replace `FlickableType` with `ListViewType` in `PageSetupWizardInstalling` * replace `ListView` with `ListViewType` in `PageSetupWizardProtocols` * replace `FlickableType` with `ListViewType` in `PageSetupWizardProtocolSettings` * replace `FlickableType` with `ListViewType` in `PageSetupWizardTextKey` * replace `FlickableType` with `ListViewType` in `PageSetupWizardViewConfig` * update `PageProtocolAwgClientSettings` * update `PageProtocolAwgSettings` * replace `FlickableType` with `ListViewType` in `PageProtocolCloakSettings` * replace `FlickableType` with `ListViewType` in `PageProtocolRaw` * replace `FlickableType` with `ListViewType` in `PageProtocolShadowSocksSettings` * replace `FlickableType` with `ListViewType` in `PageProtocolWireGuardClientSettings` * replace `FlickableType` with `ListViewType` in `PageProtocolWireGuardSettings` * replace `FlickableType` with `ListViewType` in `PageProtocolXraySettings` * replace `FlickableType` with `ListViewType` in `PageShareFullAccess` * replace `FlickableType` with `ListViewType` in `PageDeinstalling` * update `PageDevMenu` * remove `Flickable` references in `LabelWithButtonType` * remove useless key navigation handlers from `ListViewType` * replace `ListView` with `ListViewType` in `ListViewWithRadioButtonType.qml` and remove unnecessary properties * remove references to `Flickable` in `TextAreaType.qml` * remove references to `Flickable` in `TextAreaWithFooterType` * remove references to `FlickableType` in `TextFieldWithHeaderType` * remove references to `FlickableType` in `SwitcherType` * remove references to `FlickableType` in `CheckBoxType` * remove references to `FlickableType` in `CardWithIconsType.qml` * remove references to `FlickableType` in `BasicButtonType.qml` * update `ServersListView` * update `SettingsContainersListView` * update `InstalledAppsDrawer` * update `SelectLanguageDrawer` * update `HomeContainersListView` * update `HomeSplitTunnelingDrawer` * fix `PageSetupWizardApiServicesList` --------- Co-authored-by: vladimir.kuznetsov <nethiuswork@gmail.com>
This commit is contained in:
@@ -1,156 +1,167 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Dialogs
|
||||
|
||||
import PageEnum 1.0
|
||||
import Style 1.0
|
||||
|
||||
import "./"
|
||||
import "../Controls2"
|
||||
import "../Controls2/TextTypes"
|
||||
import "../Config"
|
||||
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
FlickableType {
|
||||
id: fl
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
contentHeight: content.height
|
||||
|
||||
ColumnLayout {
|
||||
id: content
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
spacing: 0
|
||||
|
||||
BaseHeaderType {
|
||||
id: header
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 24
|
||||
Layout.rightMargin: 16
|
||||
Layout.leftMargin: 16
|
||||
|
||||
headerText: qsTr("Settings")
|
||||
}
|
||||
|
||||
LabelWithButtonType {
|
||||
id: account
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
|
||||
text: qsTr("Servers")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
leftImageSource: "qrc:/images/controls/server.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsServersList)
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
|
||||
LabelWithButtonType {
|
||||
id: connection
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("Connection")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
leftImageSource: "qrc:/images/controls/radio.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsConnection)
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
|
||||
LabelWithButtonType {
|
||||
id: application
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("Application")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
leftImageSource: "qrc:/images/controls/app.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsApplication)
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
|
||||
LabelWithButtonType {
|
||||
id: backup
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("Backup")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
leftImageSource: "qrc:/images/controls/save.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsBackup)
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
|
||||
LabelWithButtonType {
|
||||
id: about
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("About AmneziaVPN")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
leftImageSource: "qrc:/images/controls/amnezia.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsAbout)
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
|
||||
LabelWithButtonType {
|
||||
id: devConsole
|
||||
visible: SettingsController.isDevModeEnabled
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("Dev console")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
leftImageSource: "qrc:/images/controls/bug.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
PageController.goToPage(PageEnum.PageDevMenu)
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {
|
||||
visible: SettingsController.isDevModeEnabled
|
||||
}
|
||||
|
||||
LabelWithButtonType {
|
||||
id: close
|
||||
visible: GC.isDesktop()
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: about.height
|
||||
|
||||
text: qsTr("Close application")
|
||||
leftImageSource: "qrc:/images/controls/x-circle.svg"
|
||||
isLeftImageHoverEnabled: false
|
||||
|
||||
clickedFunction: function() {
|
||||
PageController.closeApplication()
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {
|
||||
visible: GC.isDesktop()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Dialogs
|
||||
|
||||
import PageEnum 1.0
|
||||
import Style 1.0
|
||||
|
||||
import "./"
|
||||
import "../Controls2"
|
||||
import "../Controls2/TextTypes"
|
||||
import "../Config"
|
||||
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
ListViewType {
|
||||
id: listView
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
header: ColumnLayout {
|
||||
width: listView.width
|
||||
|
||||
BaseHeaderType {
|
||||
id: header
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 24
|
||||
Layout.bottomMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
Layout.leftMargin: 16
|
||||
|
||||
headerText: qsTr("Settings")
|
||||
}
|
||||
}
|
||||
|
||||
model: settingsEntries
|
||||
|
||||
delegate: ColumnLayout {
|
||||
width: listView.width
|
||||
|
||||
spacing: 0
|
||||
|
||||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
visible: isVisible
|
||||
|
||||
text: title
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
leftImageSource: leftImagePath
|
||||
|
||||
clickedFunction: clickedHandler
|
||||
}
|
||||
|
||||
DividerType {
|
||||
visible: isVisible
|
||||
}
|
||||
}
|
||||
|
||||
footer: ColumnLayout {
|
||||
width: listView.width
|
||||
|
||||
LabelWithButtonType {
|
||||
id: close
|
||||
|
||||
visible: GC.isDesktop()
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
text: qsTr("Close application")
|
||||
leftImageSource: "qrc:/images/controls/x-circle.svg"
|
||||
isLeftImageHoverEnabled: false
|
||||
|
||||
clickedFunction: function() {
|
||||
PageController.closeApplication()
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
visible: GC.isDesktop()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property list<QtObject> settingsEntries: [
|
||||
servers,
|
||||
connection,
|
||||
application,
|
||||
backup,
|
||||
about,
|
||||
devConsole
|
||||
]
|
||||
|
||||
QtObject {
|
||||
id: servers
|
||||
|
||||
property string title: qsTr("Servers")
|
||||
readonly property string leftImagePath: "qrc:/images/controls/server.svg"
|
||||
property bool isVisible: true
|
||||
readonly property var clickedHandler: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsServersList)
|
||||
}
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: connection
|
||||
|
||||
property string title: qsTr("Connection")
|
||||
readonly property string leftImagePath: "qrc:/images/controls/radio.svg"
|
||||
property bool isVisible: true
|
||||
readonly property var clickedHandler: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsConnection)
|
||||
}
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: application
|
||||
|
||||
property string title: qsTr("Application")
|
||||
readonly property string leftImagePath: "qrc:/images/controls/app.svg"
|
||||
property bool isVisible: true
|
||||
readonly property var clickedHandler: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsApplication)
|
||||
}
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: backup
|
||||
|
||||
property string title: qsTr("Backup")
|
||||
readonly property string leftImagePath: "qrc:/images/controls/save.svg"
|
||||
property bool isVisible: true
|
||||
readonly property var clickedHandler: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsBackup)
|
||||
}
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: about
|
||||
|
||||
property string title: qsTr("About AmneziaVPN")
|
||||
readonly property string leftImagePath: "qrc:/images/controls/amnezia.svg"
|
||||
property bool isVisible: true
|
||||
readonly property var clickedHandler: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsAbout)
|
||||
}
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: devConsole
|
||||
|
||||
property string title: qsTr("Dev console")
|
||||
readonly property string leftImagePath: "qrc:/images/controls/bug.svg"
|
||||
property bool isVisible: SettingsController.isDevModeEnabled
|
||||
readonly property var clickedHandler: function() {
|
||||
PageController.goToPage(PageEnum.PageDevMenu)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user