Fix focus problems for submenues in context menues
This commit is contained in:
parent
902f13ab68
commit
d828312a24
|
@ -8,6 +8,7 @@ import CppUtils 0.1
|
|||
Menu {
|
||||
id: menu
|
||||
|
||||
property bool isSubMenu: false
|
||||
property var previouslyFocused: null
|
||||
|
||||
// MenuItems that open popups (or other elements taking focus when opened)
|
||||
|
@ -57,6 +58,7 @@ Menu {
|
|||
}
|
||||
|
||||
onAboutToShow: {
|
||||
if (isSubMenu) return
|
||||
previouslyFocused = window.activeFocusItem
|
||||
focusOnClosed = Qt.binding(() => previouslyFocused)
|
||||
}
|
||||
|
|
|
@ -149,6 +149,7 @@ HTile {
|
|||
|
||||
HMenu {
|
||||
title: qsTr("Notifications")
|
||||
isSubMenu: true
|
||||
|
||||
HMenuItem {
|
||||
text: qsTr("Use default account settings")
|
||||
|
|
Loading…
Reference in New Issue
Block a user