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