From 04a9b0d4ad584127b3294b266738414f4f5849b5 Mon Sep 17 00:00:00 2001 From: David Turner Date: Wed, 18 Oct 2023 17:40:53 +0100 Subject: [PATCH] Make escape key close OS customisation window With the move from OS customisation being a popup to being a separate window, it is no longer closed by the escape key. Add a handler to restore this behaviour. --- src/OptionsPopup.qml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/OptionsPopup.qml b/src/OptionsPopup.qml index 910b4e1..4693cf2 100644 --- a/src/OptionsPopup.qml +++ b/src/OptionsPopup.qml @@ -36,6 +36,12 @@ Window { spacing: 10 anchors.fill: parent + // Keys handlers can only be attached to Items. Window is not an + // Item, but ColumnLayout is, so put this handler here. + Keys.onEscapePressed: { + popup.close() + } + ScrollView { id: popupbody font.family: roboto.name