Tab to move quicker between sections
This commit is contained in:
@@ -39,6 +39,7 @@ Item {
|
|||||||
signal activateRequested()
|
signal activateRequested()
|
||||||
signal closeRequested()
|
signal closeRequested()
|
||||||
signal deleteRequested()
|
signal deleteRequested()
|
||||||
|
signal tabRequested(int direction)
|
||||||
signal textKey(string text)
|
signal textKey(string text)
|
||||||
|
|
||||||
focus: true
|
focus: true
|
||||||
@@ -49,6 +50,11 @@ Item {
|
|||||||
if (event.key === Qt.Key_Escape) {
|
if (event.key === Qt.Key_Escape) {
|
||||||
closeRequested(); event.accepted = true; return
|
closeRequested(); event.accepted = true; return
|
||||||
}
|
}
|
||||||
|
if (event.key === Qt.Key_Tab || event.key === Qt.Key_Backtab) {
|
||||||
|
tabRequested((event.modifiers & Qt.ShiftModifier) || event.key === Qt.Key_Backtab ? -1 : 1)
|
||||||
|
event.accepted = true
|
||||||
|
return
|
||||||
|
}
|
||||||
if (event.key === Qt.Key_Down || event.text === "j") {
|
if (event.key === Qt.Key_Down || event.text === "j") {
|
||||||
moveRequested(0, 1); event.accepted = true; return
|
moveRequested(0, 1); event.accepted = true; return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,6 +169,17 @@ Panel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function moveSection(delta) {
|
||||||
|
var sections = visibleSections
|
||||||
|
if (sections.length === 0) return
|
||||||
|
var current = sections.indexOf(focusSection)
|
||||||
|
if (current < 0) current = delta > 0 ? -1 : 0
|
||||||
|
var next = (current + delta + sections.length) % sections.length
|
||||||
|
focusSection = sections[next]
|
||||||
|
selectedIndex = sectionHasSlider(focusSection) ? -1 : 0
|
||||||
|
cursorActive = true
|
||||||
|
}
|
||||||
|
|
||||||
// Adjust the slider associated with the focused section. Output and
|
// Adjust the slider associated with the focused section. Output and
|
||||||
// input sliders are real volume controls; on stream rows h/l adjusts
|
// input sliders are real volume controls; on stream rows h/l adjusts
|
||||||
// that stream's volume (so keyboard parity with the inline slider).
|
// that stream's volume (so keyboard parity with the inline slider).
|
||||||
@@ -575,6 +586,7 @@ Panel {
|
|||||||
}
|
}
|
||||||
onActivateRequested: if (root.cursorActive) root.activateCursor()
|
onActivateRequested: if (root.cursorActive) root.activateCursor()
|
||||||
onCloseRequested: root.close()
|
onCloseRequested: root.close()
|
||||||
|
onTabRequested: function(direction) { root.moveSection(direction) }
|
||||||
onTextKey: function(t) {
|
onTextKey: function(t) {
|
||||||
// 'm' mutes whatever the cursor is on: focused section's slider
|
// 'm' mutes whatever the cursor is on: focused section's slider
|
||||||
// for output/input, the focused stream for streams.
|
// for output/input, the focused stream for streams.
|
||||||
|
|||||||
Reference in New Issue
Block a user