remove comments and clean up
This commit is contained in:
parent
2c1f3eaf3a
commit
0f98fc955f
14 changed files with 9 additions and 154 deletions
|
|
@ -18,86 +18,15 @@ ListView {
|
||||||
property var selectedText
|
property var selectedText
|
||||||
|
|
||||||
width: rootWidth
|
width: rootWidth
|
||||||
height: contentItem.height // TODO: It should be fixed size, not content item height
|
height: contentItem.height
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
// interactive: false
|
snapMode: ListView.SnapToItem
|
||||||
|
|
||||||
// property FlickableType parentFlickable
|
|
||||||
// property var lastItemTabClicked
|
|
||||||
|
|
||||||
// property int currentFocusIndex: 0
|
|
||||||
|
|
||||||
// snapMode: ListView.SnapToItem
|
|
||||||
|
|
||||||
ScrollBar.vertical: ScrollBarType {}
|
ScrollBar.vertical: ScrollBarType {}
|
||||||
|
|
||||||
property bool isFocusable: true
|
property bool isFocusable: true
|
||||||
|
|
||||||
Keys.onTabPressed: {
|
|
||||||
FocusController.nextKeyTabItem()
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onBacktabPressed: {
|
|
||||||
FocusController.previousKeyTabItem()
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onUpPressed: {
|
|
||||||
FocusController.nextKeyUpItem()
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onDownPressed: {
|
|
||||||
FocusController.nextKeyDownItem()
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onLeftPressed: {
|
|
||||||
FocusController.nextKeyLeftItem()
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onRightPressed: {
|
|
||||||
FocusController.nextKeyRightItem()
|
|
||||||
}
|
|
||||||
|
|
||||||
// activeFocusOnTab: true
|
|
||||||
// onActiveFocusChanged: {
|
|
||||||
// console.log("===========================")
|
|
||||||
// positionViewAtEnd()
|
|
||||||
// parentFlickable.ensureVisible(this.itemAtIndex(6))
|
|
||||||
// if (activeFocus) {
|
|
||||||
// this.currentFocusIndex = 0
|
|
||||||
// this.itemAtIndex(currentFocusIndex).forceActiveFocus()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Keys.onTabPressed: {
|
|
||||||
// if (currentFocusIndex < this.count - 1) {
|
|
||||||
// currentFocusIndex += 1
|
|
||||||
// this.itemAtIndex(currentFocusIndex).forceActiveFocus()
|
|
||||||
// } else {
|
|
||||||
// currentFocusIndex = 0
|
|
||||||
// if (lastItemTabClicked && typeof lastItemTabClicked === "function") {
|
|
||||||
// lastItemTabClicked()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// onVisibleChanged: {
|
|
||||||
// if (visible) {
|
|
||||||
// currentFocusIndex = 0
|
|
||||||
// focusItem.forceActiveFocus()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Item {
|
|
||||||
// id: focusItem
|
|
||||||
// }
|
|
||||||
|
|
||||||
// onCurrentFocusIndexChanged: {
|
|
||||||
// if (parentFlickable) {
|
|
||||||
// parentFlickable.ensureVisible(this.itemAtIndex(currentFocusIndex))
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
ButtonGroup {
|
ButtonGroup {
|
||||||
id: containersRadioButtonGroup
|
id: containersRadioButtonGroup
|
||||||
}
|
}
|
||||||
|
|
@ -136,7 +65,7 @@ ListView {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (checked) {
|
if (checked) {
|
||||||
containersDropDown.closeTriggered() // TODO: containersDropDown is outside this file
|
containersDropDown.closeTriggered()
|
||||||
ServersModel.setDefaultContainer(ServersModel.defaultIndex, proxyDefaultServerContainersModel.mapToSource(index))
|
ServersModel.setDefaultContainer(ServersModel.defaultIndex, proxyDefaultServerContainersModel.mapToSource(index))
|
||||||
} else {
|
} else {
|
||||||
ContainersModel.setProcessedContainerIndex(proxyDefaultServerContainersModel.mapToSource(index))
|
ContainersModel.setProcessedContainerIndex(proxyDefaultServerContainersModel.mapToSource(index))
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,7 @@ ListView {
|
||||||
|
|
||||||
model: ServersModel
|
model: ServersModel
|
||||||
|
|
||||||
ScrollBar.vertical: ScrollBarType {
|
ScrollBar.vertical: ScrollBarType {}
|
||||||
id: scrollBar
|
|
||||||
objectName: "scrollBar"
|
|
||||||
policy: root.height >= root.contentHeight ? ScrollBar.AlwaysOff : ScrollBar.AlwaysOn
|
|
||||||
}
|
|
||||||
|
|
||||||
property bool isFocusable: true
|
property bool isFocusable: true
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,16 +20,10 @@ ListView {
|
||||||
height: root.contentItem.height
|
height: root.contentItem.height
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
interactive: false
|
reuseItems: true
|
||||||
|
|
||||||
property bool isFocusable: false
|
property bool isFocusable: false
|
||||||
|
|
||||||
onVisibleChanged: {
|
|
||||||
if (visible) {
|
|
||||||
this.currentIndex = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
implicitWidth: root.width
|
implicitWidth: root.width
|
||||||
implicitHeight: delegateContent.implicitHeight
|
implicitHeight: delegateContent.implicitHeight
|
||||||
|
|
|
||||||
|
|
@ -61,30 +61,6 @@ DrawerType2 {
|
||||||
|
|
||||||
property bool isFocusable: true
|
property bool isFocusable: true
|
||||||
|
|
||||||
Keys.onTabPressed: {
|
|
||||||
FocusController.nextKeyTabItem()
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onBacktabPressed: {
|
|
||||||
FocusController.previousKeyTabItem()
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onUpPressed: {
|
|
||||||
FocusController.nextKeyUpItem()
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onDownPressed: {
|
|
||||||
FocusController.nextKeyDownItem()
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onLeftPressed: {
|
|
||||||
FocusController.nextKeyLeftItem()
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onRightPressed: {
|
|
||||||
FocusController.nextKeyRightItem()
|
|
||||||
}
|
|
||||||
|
|
||||||
ScrollBar.vertical: ScrollBarType {}
|
ScrollBar.vertical: ScrollBarType {}
|
||||||
|
|
||||||
model: 1
|
model: 1
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,6 @@ Button {
|
||||||
implicitHeight: 56
|
implicitHeight: 56
|
||||||
|
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
focusPolicy: Qt.TabFocus
|
|
||||||
|
|
||||||
onFocusChanged: {
|
onFocusChanged: {
|
||||||
if (root.activeFocus) {
|
if (root.activeFocus) {
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,6 @@ Item {
|
||||||
readonly property string drawerExpandedStateName: "expanded"
|
readonly property string drawerExpandedStateName: "expanded"
|
||||||
readonly property string drawerCollapsedStateName: "collapsed"
|
readonly property string drawerCollapsedStateName: "collapsed"
|
||||||
|
|
||||||
// readonly property bool isExpanded: isExpandedStateActive()
|
|
||||||
// readonly property bool isCollapsed: isCollapsedStateActive()
|
|
||||||
|
|
||||||
readonly property bool isOpened: isExpandedStateActive() || (isCollapsedStateActive && (dragArea.drag.active === true))
|
readonly property bool isOpened: isExpandedStateActive() || (isCollapsedStateActive && (dragArea.drag.active === true))
|
||||||
readonly property bool isClosed: isCollapsedStateActive() && (dragArea.drag.active === false)
|
readonly property bool isClosed: isCollapsedStateActive() && (dragArea.drag.active === false)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ ListView {
|
||||||
height: root.contentItem.height
|
height: root.contentItem.height
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
|
reuseItems: true
|
||||||
|
|
||||||
property bool isFocusable: true
|
property bool isFocusable: true
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,6 @@ RadioButton {
|
||||||
}
|
}
|
||||||
|
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
// focusPolicy: Qt.TabFocus
|
|
||||||
|
|
||||||
indicator: Rectangle {
|
indicator: Rectangle {
|
||||||
id: background
|
id: background
|
||||||
|
|
|
||||||
|
|
@ -67,13 +67,6 @@ PageType {
|
||||||
activeFocusOnTab: true
|
activeFocusOnTab: true
|
||||||
focus: true
|
focus: true
|
||||||
|
|
||||||
onActiveFocusChanged: {
|
|
||||||
if (focus) {
|
|
||||||
listView.currentIndex = 0
|
|
||||||
listView.currentItem.focusItem.forceActiveFocus()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: delegateContent.implicitHeight
|
implicitHeight: delegateContent.implicitHeight
|
||||||
|
|
|
||||||
|
|
@ -56,13 +56,6 @@ PageType {
|
||||||
|
|
||||||
model: WireGuardConfigModel
|
model: WireGuardConfigModel
|
||||||
|
|
||||||
// activeFocusOnTab: true
|
|
||||||
// onActiveFocusChanged: {
|
|
||||||
// if (activeFocus) {
|
|
||||||
// listview.itemAtIndex(0)?.focusItemId.forceActiveFocus()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
id: delegateItem
|
id: delegateItem
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,13 +57,6 @@ PageType {
|
||||||
|
|
||||||
model: XrayConfigModel
|
model: XrayConfigModel
|
||||||
|
|
||||||
// activeFocusOnTab: true
|
|
||||||
// onActiveFocusChanged: {
|
|
||||||
// if (activeFocus) {
|
|
||||||
// listview.itemAtIndex(0)?.focusItemId.forceActiveFocus()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
property alias focusItemId: textFieldWithHeaderType.textField
|
property alias focusItemId: textFieldWithHeaderType.textField
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,9 +104,6 @@ PageType {
|
||||||
|
|
||||||
descriptionOnTop: true
|
descriptionOnTop: true
|
||||||
|
|
||||||
// parentFlickable: fl
|
|
||||||
// KeyNavigation.tab: passwordLabel.eyeButton
|
|
||||||
|
|
||||||
rightImageSource: "qrc:/images/controls/copy.svg"
|
rightImageSource: "qrc:/images/controls/copy.svg"
|
||||||
rightImageColor: AmneziaStyle.color.paleGray
|
rightImageColor: AmneziaStyle.color.paleGray
|
||||||
|
|
||||||
|
|
@ -134,8 +131,6 @@ PageType {
|
||||||
|
|
||||||
text: qsTr("Reload API config")
|
text: qsTr("Reload API config")
|
||||||
|
|
||||||
// Keys.onTabPressed: lastItemTabClicked(focusItem)
|
|
||||||
|
|
||||||
clickedFunc: function() {
|
clickedFunc: function() {
|
||||||
var headerText = qsTr("Reload API config?")
|
var headerText = qsTr("Reload API config?")
|
||||||
var yesButtonText = qsTr("Continue")
|
var yesButtonText = qsTr("Continue")
|
||||||
|
|
@ -174,8 +169,6 @@ PageType {
|
||||||
|
|
||||||
text: qsTr("Remove from application")
|
text: qsTr("Remove from application")
|
||||||
|
|
||||||
// Keys.onTabPressed: lastItemTabClicked(focusItem)
|
|
||||||
|
|
||||||
clickedFunc: function() {
|
clickedFunc: function() {
|
||||||
var headerText = qsTr("Remove from application?")
|
var headerText = qsTr("Remove from application?")
|
||||||
var yesButtonText = qsTr("Continue")
|
var yesButtonText = qsTr("Continue")
|
||||||
|
|
|
||||||
|
|
@ -50,20 +50,14 @@ PageType {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
||||||
height: 500 // servers.contentItem.height // TODO: calculate height
|
height: 500
|
||||||
|
|
||||||
property bool isFocusable: true
|
property bool isFocusable: true
|
||||||
|
|
||||||
model: ServersModel
|
model: ServersModel
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
interactive: false
|
reuseItems: true
|
||||||
|
|
||||||
onVisibleChanged: {
|
|
||||||
if (visible) {
|
|
||||||
currentIndex = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
implicitWidth: servers.width
|
implicitWidth: servers.width
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,6 @@ import "../Config"
|
||||||
PageType {
|
PageType {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
// defaultActiveFocusItem: focusItem
|
|
||||||
|
|
||||||
BackButtonType {
|
BackButtonType {
|
||||||
id: backButton
|
id: backButton
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue