Sidebar: add shortcuts for filter / events controls

This commit is contained in:
Timotej Lazar 2021-09-12 20:14:06 +02:00
parent 0bced7522b
commit 65daa139a4
No known key found for this signature in database
GPG key ID: B6F38793D143456F

View file

@ -133,6 +133,19 @@ Page {
placeholderText: qsTr('Filter') placeholderText: qsTr('Filter')
onTextChanged: eventFilter.setFilter(text) onTextChanged: eventFilter.setFilter(text)
Keys.onEscapePressed: 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 { Events {
@ -153,16 +166,29 @@ Page {
} }
Keys.forwardTo: control 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 { Rectangle {
anchors { left: parent.left; right: parent.right; top: parent.top } anchors { left: parent.left; right: parent.right; top: parent.top }
implicitHeight: 1 implicitHeight: 1
color: palette.mid color: parent.activeFocus ? palette.highlight : palette.dark
} }
Rectangle { Rectangle {
anchors { left: parent.left; right: parent.right; bottom: parent.bottom } anchors { left: parent.left; right: parent.right; bottom: parent.bottom }
implicitHeight: 1 implicitHeight: 1
color: palette.mid color: parent.activeFocus ? palette.highlight : palette.dark
} }
} }