Add Alt+1-0 keybinds to switch to a room at index
This commit is contained in:
parent
53dfd08131
commit
9f52fa86fa
|
@ -256,6 +256,18 @@ class UISettings(JSONDataFile):
|
||||||
"goToPreviousRoom": ["Alt+Shift+Up", "Alt+Shift+K"],
|
"goToPreviousRoom": ["Alt+Shift+Up", "Alt+Shift+K"],
|
||||||
"goToNextRoom": ["Alt+Shift+Down", "Alt+Shift+J"],
|
"goToNextRoom": ["Alt+Shift+Down", "Alt+Shift+J"],
|
||||||
"toggleCollapseAccount": [ "Alt+O"],
|
"toggleCollapseAccount": [ "Alt+O"],
|
||||||
|
"focusRoomAtIndex": {
|
||||||
|
"01": "Alt+1",
|
||||||
|
"02": "Alt+2",
|
||||||
|
"03": "Alt+3",
|
||||||
|
"04": "Alt+4",
|
||||||
|
"05": "Alt+5",
|
||||||
|
"06": "Alt+6",
|
||||||
|
"07": "Alt+7",
|
||||||
|
"08": "Alt+8",
|
||||||
|
"09": "Alt+9",
|
||||||
|
"10": "Alt+0",
|
||||||
|
},
|
||||||
|
|
||||||
"clearRoomMessages": ["Ctrl+L"],
|
"clearRoomMessages": ["Ctrl+L"],
|
||||||
"sendFile": ["Alt+S"],
|
"sendFile": ["Alt+S"],
|
||||||
|
|
|
@ -211,6 +211,20 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: Object.keys(settings.keys.focusRoomAtIndex)
|
||||||
|
|
||||||
|
Item {
|
||||||
|
HShortcut {
|
||||||
|
enabled: mainUI.accountsPresent
|
||||||
|
sequence: settings.keys.focusRoomAtIndex[modelData]
|
||||||
|
onActivated: mainUI.mainPane.mainPaneList.goToRoom(
|
||||||
|
parseInt(modelData - 1, 10),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Chat
|
// Chat
|
||||||
|
|
||||||
|
|
|
@ -182,6 +182,12 @@ HListView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function goToRoom(index) {
|
||||||
|
if (! currentItem) next()
|
||||||
|
const room = currentItem.roomList.contentItem.children[index]
|
||||||
|
if (room && room.activated) room.activated()
|
||||||
|
}
|
||||||
|
|
||||||
function requestActivate() {
|
function requestActivate() {
|
||||||
activateLimiter.restart()
|
activateLimiter.restart()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user