fix PageSetupWizardProtocolSettings focus move

This commit is contained in:
Cyril Anisimov 2024-10-21 16:19:57 +02:00
parent 9cfa4c1389
commit c962211068

View file

@ -49,6 +49,32 @@ PageType {
interactive: false interactive: false
model: proxyContainersModel model: proxyContainersModel
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()
}
delegate: Item { delegate: Item {
implicitWidth: processedContainerListView.width implicitWidth: processedContainerListView.width
implicitHeight: (delegateContent.implicitHeight > root.height) ? delegateContent.implicitHeight : root.height implicitHeight: (delegateContent.implicitHeight > root.height) ? delegateContent.implicitHeight : root.height
@ -97,7 +123,7 @@ PageType {
KeyNavigation.tab: transportProtoSelector KeyNavigation.tab: transportProtoSelector
clickedFunc: function() { clickedFunc: function() {
showDetailsDrawer.open() showDetailsDrawer.openTriggered()
} }
} }
@ -110,16 +136,6 @@ PageType {
expandedStateContent: Item { expandedStateContent: Item {
implicitHeight: showDetailsDrawer.expandedHeight implicitHeight: showDetailsDrawer.expandedHeight
// Item {
// id: focusItem2
// KeyNavigation.tab: showDetailsBackButton
// onFocusChanged: {
// if (focusItem2.activeFocus) {
// fl.contentY = 0
// }
// }
// }
BackButtonType { BackButtonType {
id: showDetailsBackButton id: showDetailsBackButton
@ -129,7 +145,7 @@ PageType {
anchors.topMargin: 16 anchors.topMargin: 16
backButtonFunction: function() { backButtonFunction: function() {
showDetailsDrawer.close() showDetailsDrawer.closeTriggered()
} }
} }
@ -183,10 +199,9 @@ PageType {
parentFlickable: fl parentFlickable: fl
text: qsTr("Close") text: qsTr("Close")
// Keys.onTabPressed: lastItemTabClicked(focusItem2)
clickedFunc: function() { clickedFunc: function() {
showDetailsDrawer.close() showDetailsDrawer.closeTriggered()
} }
} }
} }
@ -207,8 +222,6 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
rootWidth: root.width rootWidth: root.width
// KeyNavigation.tab: (port.visible && port.enabled) ? port.textField : installButton
} }
TextFieldWithHeaderType { TextFieldWithHeaderType {
@ -235,8 +248,6 @@ PageType {
text: qsTr("Install") text: qsTr("Install")
// Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunc: function() { clickedFunc: function() {
if (!port.textField.acceptableInput && if (!port.textField.acceptableInput &&
ContainerProps.containerTypeToString(dockerContainer) !== "torwebsite" && ContainerProps.containerTypeToString(dockerContainer) !== "torwebsite" &&
@ -264,11 +275,6 @@ PageType {
var protocolSelectorVisible = ProtocolProps.defaultTransportProtoChangeable(defaultContainerProto) var protocolSelectorVisible = ProtocolProps.defaultTransportProtoChangeable(defaultContainerProto)
transportProtoSelector.visible = protocolSelectorVisible transportProtoSelector.visible = protocolSelectorVisible
transportProtoHeader.visible = protocolSelectorVisible transportProtoHeader.visible = protocolSelectorVisible
// if (port.visible && port.enabled)
// defaultActiveFocusItem = port.textField
// else
// defaultActiveFocusItem = focusItem
} }
} }
} }