diff --git a/docs/TODO.md b/docs/TODO.md index 5509cd4f..31d88b51 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -5,7 +5,7 @@ - combo box custom item - explain pattern - fix spinbox buttons -- quick room & sender rule changes +- HMenuItem checkbox styling - config & keybind for global rule disabling - quick settings - import/export/json edit rules? @@ -22,7 +22,6 @@ - profiles missing in notifications - option to use plaintext notifications - Notification urgency level (plyer)? -- annoying tooltips when menu open - add http_proxy support - image viewer: can't expand image in reduced window layout diff --git a/src/gui/MainPane/TopBar.qml b/src/gui/MainPane/TopBar.qml index 314eaa26..1b233d51 100644 --- a/src/gui/MainPane/TopBar.qml +++ b/src/gui/MainPane/TopBar.qml @@ -67,24 +67,23 @@ Rectangle { backgroundColor: "transparent" icon.name: - window.notificationLevel === Window.NotificationLevel.All ? + window.notificationLevel === Window.NotificationLevel.Enable ? "notifications-all" : - window.notificationLevel === Window.NotificationLevel.None ? + window.notificationLevel === Window.NotificationLevel.Mute ? "notifications-none" : "notifications-mentions-keywords" icon.color: - window.notificationLevel === Window.NotificationLevel.All ? + window.notificationLevel === Window.NotificationLevel.Enable ? theme.icons.colorize : - window.notificationLevel === Window.NotificationLevel.None ? + window.notificationLevel === Window.NotificationLevel.Mute ? theme.colors.negativeBackground : theme.colors.middleBackground - toolTip.text: qsTr("Control global notifications") onClicked: notificationsMenu.open() Layout.fillHeight: true @@ -94,29 +93,33 @@ Rectangle { y: parent.height HMenuItem { - icon.name: "notifications-all" - text: qsTr("Normal notifications") + text: qsTr("Enable notifications") + checked: + window.notificationLevel === + Window.NotificationLevel.Enable onTriggered: window.notificationLevel = - Window.NotificationLevel.All + Window.NotificationLevel.Enable } HMenuItem { - icon.name: "notifications-mentions-keywords" - icon.color: theme.colors.middleBackground - text: qsTr("Mentions & keywords") + text: qsTr("Highlights only (replies, keywords...)") + checked: + window.notificationLevel === + Window.NotificationLevel.HighlightsOnly onTriggered: window.notificationLevel = - Window.NotificationLevel.MentionsKeywords + Window.NotificationLevel.HighlightsOnly } HMenuItem { - icon.name: "notifications-none" - icon.color: theme.colors.negativeBackground - text: qsTr("Nothing") + text: qsTr("Mute all notifications") + checked: + window.notificationLevel === + Window.NotificationLevel.Mute onTriggered: window.notificationLevel = - Window.NotificationLevel.None + Window.NotificationLevel.Mute } } } diff --git a/src/gui/PythonBridge/EventHandlers.qml b/src/gui/PythonBridge/EventHandlers.qml index b58aac3e..07c55b78 100644 --- a/src/gui/PythonBridge/EventHandlers.qml +++ b/src/gui/PythonBridge/EventHandlers.qml @@ -13,8 +13,8 @@ QtObject { ) { const level = window.notificationLevel - if (level === Window.NotificationLevel.None) return - if (level === Window.MentionsKeywords && ! critical) return + if (level === Window.NotificationLevel.Mute) return + if (level === Window.HighlightsOnly && ! critical) return if (window.notifiedIds.has(id)) return window.notifiedIds.add(id) diff --git a/src/gui/Window.qml b/src/gui/Window.qml index f96b47c4..7abb6721 100644 --- a/src/gui/Window.qml +++ b/src/gui/Window.qml @@ -10,7 +10,7 @@ import "PythonBridge" ApplicationWindow { id: window - enum NotificationLevel { None, MentionsKeywords, All } + enum NotificationLevel { Mute, HighlightsOnly, Enable } // FIXME: Qt 5.13.1 bug, this randomly stops updating after the cursor // leaves the window until it's clicked again. @@ -21,7 +21,7 @@ ApplicationWindow { window.visibility === window.Minimized || window.visibility === window.Hidden - property int notificationLevel: Window.NotificationLevel.All + property int notificationLevel: Window.NotificationLevel.Enable property var notifiedIds: new Set() property var mainUI: null diff --git a/src/icons/thin/global-notifications.svg b/src/icons/thin/global-notifications.svg deleted file mode 100644 index dcebec68..00000000 --- a/src/icons/thin/global-notifications.svg +++ /dev/null @@ -1,3 +0,0 @@ - - -