From 65daa139a4ac2104bae26b40aea38a0564357a66 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sun, 12 Sep 2021 20:14:06 +0200 Subject: [PATCH] Sidebar: add shortcuts for filter / events controls --- Sidebar.qml | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/Sidebar.qml b/Sidebar.qml index 5dc04d3..13af9e0 100644 --- a/Sidebar.qml +++ b/Sidebar.qml @@ -133,6 +133,19 @@ Page { placeholderText: qsTr('Filter') onTextChanged: eventFilter.setFilter(text) Keys.onEscapePressed: text = '' + + Shortcut { + id: shortcutFilter + sequence: 'Ctrl+F' + onActivated: filter.forceActiveFocus() + } + Label { + anchors { right: parent.right; bottom: parent.bottom; margins: 4 } + visible: !parent.activeFocus + text: shortcutFilter.nativeText + font.pixelSize: filter.font.pixelSize * 0.75 + color: 'gray' + } } Events { @@ -153,16 +166,29 @@ Page { } Keys.forwardTo: control + Shortcut { + id: shortcutEvents + sequence: 'Ctrl+E' + onActivated: events.forceActiveFocus() + } + Label { + anchors { right: parent.right; bottom: parent.bottom; margins: 4 } + visible: !parent.activeFocus + text: shortcutEvents.nativeText + font.pixelSize: filter.font.pixelSize * 0.75 + color: 'gray' + } + Rectangle { anchors { left: parent.left; right: parent.right; top: parent.top } implicitHeight: 1 - color: palette.mid + color: parent.activeFocus ? palette.highlight : palette.dark } Rectangle { anchors { left: parent.left; right: parent.right; bottom: parent.bottom } implicitHeight: 1 - color: palette.mid + color: parent.activeFocus ? palette.highlight : palette.dark } }