Add direct keybinds for presence states

This commit is contained in:
miruka 2020-07-10 15:15:53 -04:00
parent 3848ce60ca
commit fec1026346
3 changed files with 28 additions and 2 deletions

View File

@ -1,6 +1,5 @@
# TODO # TODO
- presence keybinds
- retry if media not found - retry if media not found
- fix members not synced bug - fix members not synced bug
- fix local unread counters order - fix local unread counters order

View File

@ -299,7 +299,11 @@ class UISettings(JSONDataFile):
"toggleFocusMainPane": ["Alt+F"], "toggleFocusMainPane": ["Alt+F"],
"clearRoomFilter": ["Alt+Shift+F"], "clearRoomFilter": ["Alt+Shift+F"],
"toggleCollapseAccount": ["Alt+O"], "toggleCollapseAccount": ["Alt+O"],
"openPresenceMenu": ["Alt+P"], "openPresenceMenu": ["Alt+P"],
"togglePresenceUnavailable": ["Alt+Ctrl+U", "Alt+Ctrl+A"],
"togglePresenceInvisible": ["Alt+Ctrl+I"],
"togglePresenceOffline": ["Alt+Ctrl+O"],
"goToLastPage": ["Ctrl+Tab"], "goToLastPage": ["Ctrl+Tab"],
"goToPreviousAccount": ["Alt+Shift+N"], "goToPreviousAccount": ["Alt+Shift+N"],

View File

@ -199,6 +199,11 @@ HTile {
setCollapse(! collapsed) setCollapse(! collapsed)
} }
function togglePresence(presence) {
if (model.presence === presence) presence = "online"
py.callClientCoro(model.id, "set_presence", [presence])
}
HShortcut { HShortcut {
enabled: enableKeybinds enabled: enableKeybinds
@ -217,4 +222,22 @@ HTile {
sequences: window.settings.keys.openPresenceMenu sequences: window.settings.keys.openPresenceMenu
onActivated: account.doRightClick(false) onActivated: account.doRightClick(false)
} }
HShortcut {
enabled: enableKeybinds
sequences: window.settings.keys.togglePresenceUnavailable
onActivated: account.togglePresence("unavailable")
}
HShortcut {
enabled: enableKeybinds
sequences: window.settings.keys.togglePresenceInvisible
onActivated: account.togglePresence("invisible")
}
HShortcut {
enabled: enableKeybinds
sequences: window.settings.keys.togglePresenceOffline
onActivated: account.togglePresence("offline")
}
} }