From 51d6a853898a7d8a11249d85bc88d7c6250d2e8c Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 20 Nov 2017 19:23:45 +0200 Subject: [PATCH] support focuscope in config window --the user can use Esc to close the config window and arrows to navigate between different tabs --- .../configuration/LatteDockConfiguration.qml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/shell/package/contents/configuration/LatteDockConfiguration.qml b/shell/package/contents/configuration/LatteDockConfiguration.qml index 42aca1d90..e6c9f2ddb 100644 --- a/shell/package/contents/configuration/LatteDockConfiguration.qml +++ b/shell/package/contents/configuration/LatteDockConfiguration.qml @@ -35,9 +35,8 @@ import org.kde.kquickcontrolsaddons 2.0 as KQuickControlAddons import org.kde.latte 0.1 as Latte -PlasmaCore.FrameSvgItem { +FocusScope { id: dialog - imagePath: "dialogs/background" property int maxWidth: 34 * theme.defaultFont.pixelSize width: maxWidth + units.smallSpacing * 2 @@ -48,6 +47,11 @@ PlasmaCore.FrameSvgItem { property bool panelIsVertical: plasmoid.formFactor === PlasmaCore.Types.Vertical property int subGroupSpacing: units.largeSpacing + units.smallSpacing * 1.5 + PlasmaCore.FrameSvgItem{ + anchors.fill: parent + imagePath: "dialogs/background" + } + PlasmaComponents.ToolButton { id: pinButton @@ -93,6 +97,12 @@ PlasmaCore.FrameSvgItem { anchors.top: parent.top spacing: units.smallSpacing + Keys.onPressed: { + if (event.key === Qt.Key_Escape) { + dockConfig.hideConfigWindow(); + } + } + RowLayout { id: header Layout.fillWidth: true @@ -215,6 +225,8 @@ PlasmaCore.FrameSvgItem { visible: plasmoid.configuration.advanced } + + Component.onCompleted: forceActiveFocus(); } Rectangle {