update transitions

This commit is contained in:
Cyril Anisimov 2024-09-29 23:50:58 +02:00
parent b4f4ec4ac9
commit 3c655d0051
6 changed files with 10 additions and 23 deletions

View file

@ -37,11 +37,11 @@ DrawerType2 {
target: root target: root
enabled: !GC.isMobile() enabled: !GC.isMobile()
function onOpened() { function onOpened() {
FocusController.setRootItem(root) FocusController.pushRootObject(root)
} }
function onClosed() { function onClosed() {
FocusController.setRootItem(null) FocusController.dropRootObject(root)
} }
} }

View file

@ -24,11 +24,11 @@ DrawerType2 {
target: root target: root
enabled: !GC.isMobile() enabled: !GC.isMobile()
function onOpened() { function onOpened() {
FocusController.setRootItem(root) FocusController.pushRootObject(root)
} }
function onClosed() { function onClosed() {
FocusController.setRootItem(null) FocusController.dropRootObject(root)
} }
} }

View file

@ -95,7 +95,7 @@ Item {
depthIndex = 0 depthIndex = 0
PageController.decrementDrawerDepth() PageController.decrementDrawerDepth()
FocusController.setRootItem(null) FocusController.dropRootObject(root)
} }
function onOpenTriggered() { function onOpenTriggered() {
@ -118,7 +118,7 @@ Item {
} }
depthIndex = PageController.incrementDrawerDepth() depthIndex = PageController.incrementDrawerDepth()
FocusController.setRootItem(root) FocusController.pushRootObject(root)
} }
} }

View file

@ -15,25 +15,13 @@ Item {
} }
} }
// MouseArea {
// id: globalMouseArea
// z: 99
// anchors.fill: parent
// enabled: true
// onPressed: function(mouse) {
// forceActiveFocus()
// mouse.accepted = false
// }
// }
// Set a timer to set focus after a short delay // Set a timer to set focus after a short delay
Timer { Timer {
id: timer id: timer
interval: 500 // Milliseconds interval: 500 // Milliseconds
onTriggered: { onTriggered: {
FocusController.resetFocus() FocusController.resetRootObject()
FocusController.setFocusOnDefaultItem()
} }
repeat: false // Stop the timer after one trigger repeat: false // Stop the timer after one trigger
running: !GC.isMobile() // Start the timer running: !GC.isMobile() // Start the timer

View file

@ -28,11 +28,11 @@ Popup {
} }
onOpened: { onOpened: {
FocusController.setRootItem(root) FocusController.pushRootObject(root)
} }
onClosed: { onClosed: {
FocusController.setRootItem(null) FocusController.dropRootObject(root)
} }
background: Rectangle { background: Rectangle {

View file

@ -299,7 +299,6 @@ PageType {
tabBarStackView.goToTabBarPage(PageEnum.PageHome) tabBarStackView.goToTabBarPage(PageEnum.PageHome)
ServersModel.processedIndex = ServersModel.defaultIndex ServersModel.processedIndex = ServersModel.defaultIndex
tabBar.currentIndex = 0 tabBar.currentIndex = 0
FocusController.setRootItem(null) // TODO: move to do it automaticaly
} }
} }