Add global notification control icon in top bar
The "Mentions & keywords only" option doesn't work yet in multi-account cases: when notifications arrive for a room that multiple accounts are part of, the first notification to arrive is let through, and the duplicate later ones are ignored. The first notification to arrive may not be from the account that gets highlighted, thus it is ignored under the "Mentions & keywords" setting.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Layouts 1.12
|
||||
import ".."
|
||||
import "../Base"
|
||||
|
||||
Rectangle {
|
||||
@@ -69,12 +70,60 @@ Rectangle {
|
||||
|
||||
HButton {
|
||||
backgroundColor: "transparent"
|
||||
icon.name: "reload-config-files"
|
||||
toolTip.text: qsTr("Reload config files")
|
||||
|
||||
onClicked: mainUI.reloadSettings()
|
||||
icon.name:
|
||||
window.notificationLevel === Window.NotificationLevel.All ?
|
||||
"notifications-all" :
|
||||
|
||||
window.notificationLevel === Window.NotificationLevel.None ?
|
||||
"notifications-none" :
|
||||
|
||||
"notifications-mentions-keywords"
|
||||
|
||||
icon.color:
|
||||
window.notificationLevel === Window.NotificationLevel.All ?
|
||||
theme.icons.colorize :
|
||||
|
||||
window.notificationLevel === Window.NotificationLevel.None ?
|
||||
theme.colors.negativeBackground :
|
||||
|
||||
theme.colors.middleBackground
|
||||
|
||||
toolTip.text: qsTr("Control global notifications")
|
||||
onClicked: notificationsMenu.open()
|
||||
|
||||
Layout.fillHeight: true
|
||||
|
||||
HMenu {
|
||||
id: notificationsMenu
|
||||
y: parent.height
|
||||
|
||||
HMenuItem {
|
||||
icon.name: "notifications-all"
|
||||
text: qsTr("Normal notifications")
|
||||
onTriggered:
|
||||
window.notificationLevel =
|
||||
Window.NotificationLevel.All
|
||||
}
|
||||
|
||||
HMenuItem {
|
||||
icon.name: "notifications-mentions-keywords"
|
||||
icon.color: theme.colors.middleBackground
|
||||
text: qsTr("Mentions & keywords")
|
||||
onTriggered:
|
||||
window.notificationLevel =
|
||||
Window.NotificationLevel.MentionsKeywords
|
||||
}
|
||||
|
||||
HMenuItem {
|
||||
icon.name: "notifications-none"
|
||||
icon.color: theme.colors.negativeBackground
|
||||
text: qsTr("Nothing")
|
||||
onTriggered:
|
||||
window.notificationLevel =
|
||||
Window.NotificationLevel.None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HButton {
|
||||
|
Reference in New Issue
Block a user