Restore focus to previous element on HMenu closed

This commit is contained in:
miruka 2019-12-12 08:36:51 -04:00
parent 2769d60fdc
commit 1bd012c871

View File

@ -22,4 +22,10 @@ Menu {
border.color: theme.controls.menu.border
border.width: theme.controls.menu.borderWidth
}
onAboutToShow: previouslyFocused = window.activeFocusItem
onClosed: if (previouslyFocused) previouslyFocused.forceActiveFocus()
property var previouslyFocused: null
}