From 1bd012c871a802024f4360dff246044165819fa9 Mon Sep 17 00:00:00 2001 From: miruka Date: Thu, 12 Dec 2019 08:36:51 -0400 Subject: [PATCH] Restore focus to previous element on HMenu closed --- src/qml/Base/HMenu.qml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qml/Base/HMenu.qml b/src/qml/Base/HMenu.qml index 34d25ea5..8eef88e9 100644 --- a/src/qml/Base/HMenu.qml +++ b/src/qml/Base/HMenu.qml @@ -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 }