Commit 7d1de0f2 authored by Martin Straka's avatar Martin Straka Committed by Karel Slaný

Return focus to stackview if menu or popup was closed

parent ff68a2ec
......@@ -62,4 +62,7 @@ Menu {
inputTextControl.paste()
}
}
onAboutToHide: {
mainWindow.resetFocus()
}
}
......@@ -116,92 +116,89 @@ ApplicationWindow {
anchors.fill: parent
initialItem: appArea
Component { /* Application workspace. */
Item {
id: appArea
objectName: "appArea"
anchors.fill: parent
Item {
objectName: "appArea"
anchors.fill: parent
StackView.onActivated: {
mainStack.forceActiveFocus()
}
StackView.onActivated: {
mainStack.forceActiveFocus()
}
Item { /* Application page stack. */
id: mainPage
Item { /* Application page stack. */
id: mainPage
anchors.fill: parent
visible: true
StackView {
id: pageView
anchors.fill: parent
visible: true
StackView {
id: pageView
anchors.fill: parent
visible: true
initialItem: PageAccountList {}
Component.onCompleted: {
nestedStack = pageView
}
initialItem: PageAccountList {}
Component.onCompleted: {
nestedStack = pageView
}
}
Rectangle {
id: statusBar
visible: false
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.right: parent.right
height: headerHeight * 0.5
color: datovkaPalette.alternateBase
BusyIndicator {
id: busyuIndicator
width: parent.height
height: parent.height
anchors.centerIn: parent
running: false
}
Text {
id: statusBarText
color: datovkaPalette.text
anchors.centerIn: parent
text: mainWindow.width + " x "+ mainWindow.height
Connections {
target: isds
onStatusBarTextChanged: {
statusBar.visible = isVisible
statusBarText.text = txt
busyuIndicator.running = busy
timerId.running = !busy
}
}
Connections {
target: files
onStatusBarTextChanged: {
statusBar.visible = true
statusBarText.text = txt
busyuIndicator.running = busy
timerId.running = !busy
}
}
Rectangle {
id: statusBar
visible: false
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.right: parent.right
height: headerHeight * 0.5
color: datovkaPalette.alternateBase
BusyIndicator {
id: busyuIndicator
width: parent.height
height: parent.height
anchors.centerIn: parent
running: false
}
Text {
id: statusBarText
color: datovkaPalette.text
anchors.centerIn: parent
text: mainWindow.width + " x "+ mainWindow.height
Connections {
target: isds
onStatusBarTextChanged: {
statusBar.visible = isVisible
statusBarText.text = txt
busyuIndicator.running = busy
timerId.running = !busy
}
Connections {
target: settings
onStatusBarTextChanged: {
statusBar.visible = true
statusBarText.text = txt
busyuIndicator.running = busy
timerId.running = !busy
}
}
Connections {
target: files
onStatusBarTextChanged: {
statusBar.visible = true
statusBarText.text = txt
busyuIndicator.running = busy
timerId.running = !busy
}
}
Timer {
id: timerId
interval: statusBarTimer;
running: false;
repeat: false
onTriggered: {
timerId.running = false
statusBar.visible = false
statusBarText.text = ""
Connections {
target: settings
onStatusBarTextChanged: {
statusBar.visible = true
statusBarText.text = txt
busyuIndicator.running = busy
timerId.running = !busy
}
}
}
Timer {
id: timerId
interval: statusBarTimer;
running: false;
repeat: false
onTriggered: {
timerId.running = false
statusBar.visible = false
statusBarText.text = ""
}
}
}
}
......@@ -478,6 +475,11 @@ ApplicationWindow {
}
}
/* We can loose the focus to StackView if any Menu or Popup is opened */
function resetFocus() {
pageView.focus = true
}
Text {
id: dummyText
text: ""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment