Add keybinds to control global notifications
Alt+M: toggle "mute all notifications except highlights" Alt+Shift+M: toggle "mute all notifications" The Keys.Rooms.(previous/next)_highlight keybinds, previously bound to Alt+(Shift+)M (stood for "mention") now defaults to Alt+(Shift+)H. The NotificationLevel enum and notificationLevel property had to be moved from Window to UI due to QML having a global "Window" object that causes conflicts when trying to access the enum as "Window.NotificationLevel" from UI.qml.
This commit is contained in:
@@ -6,12 +6,22 @@ import QtQuick.Controls 2.12
|
||||
import QtQuick.Layouts 1.12
|
||||
import QtQuick.Window 2.12
|
||||
import QtGraphicalEffects 1.12
|
||||
import "."
|
||||
import "Base"
|
||||
import "MainPane"
|
||||
|
||||
Item {
|
||||
id: mainUI
|
||||
|
||||
enum NotificationLevel { Mute, HighlightsOnly, Enable }
|
||||
|
||||
property int notificationLevel:
|
||||
settings.Notifications.start_level === "highlights_only" ?
|
||||
UI.NotificationLevel.HighlightsOnly :
|
||||
settings.Notifications.start_level === "mute" ?
|
||||
UI.NotificationLevel.Mute :
|
||||
UI.NotificationLevel.Enable
|
||||
|
||||
property bool accountsPresent:
|
||||
ModelStore.get("accounts").count > 0 || py.startupAnyAccountsSaved
|
||||
|
||||
@@ -78,6 +88,25 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
HShortcut {
|
||||
sequences: window.settings.Keys.notifications_highlights_only
|
||||
onActivated:
|
||||
mainUI.notificationLevel =
|
||||
mainUI.notificationLevel ===
|
||||
UI.NotificationLevel.HighlightsOnly ?
|
||||
UI.NotificationLevel.Enable :
|
||||
UI.NotificationLevel.HighlightsOnly
|
||||
}
|
||||
|
||||
HShortcut {
|
||||
sequences: window.settings.Keys.notifications_mute
|
||||
onActivated:
|
||||
mainUI.notificationLevel =
|
||||
mainUI.notificationLevel === UI.NotificationLevel.Mute ?
|
||||
UI.NotificationLevel.Enable :
|
||||
UI.NotificationLevel.Mute
|
||||
}
|
||||
|
||||
FontMetrics {
|
||||
id: fontMetrics
|
||||
font.family: theme.fontFamily.sans
|
||||
|
Reference in New Issue
Block a user