diff --git a/docs/TODO.md b/docs/TODO.md index 4036e6bc..77ecf646 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -5,7 +5,6 @@ - combo box custom item - explain pattern - fix spinbox buttons -- HMenuItem checkbox styling - quick settings - import/export/json edit rules? - fix flickable popups can't be flicked by keyboard diff --git a/src/gui/Base/HMenuItem.qml b/src/gui/Base/HMenuItem.qml index ccd96482..3dd7049e 100644 --- a/src/gui/Base/HMenuItem.qml +++ b/src/gui/Base/HMenuItem.qml @@ -33,6 +33,14 @@ MenuItem { buttonTheme: theme.controls.menuItem label.horizontalAlignment: Label.AlignLeft + HIcon { + visible: menuItem.checkable + opacity: menuItem.checked ? 1 : 0 + svgName: "menu-item-check-mark" + + Behavior on opacity { HNumberAnimation {} } + } + HIcon { visible: menuItem.subMenu svgName: "submenu-arrow" @@ -40,4 +48,5 @@ MenuItem { } arrow: null + indicator: null } diff --git a/src/gui/MainPane/RoomDelegate.qml b/src/gui/MainPane/RoomDelegate.qml index 9948ca07..6c97649d 100644 --- a/src/gui/MainPane/RoomDelegate.qml +++ b/src/gui/MainPane/RoomDelegate.qml @@ -152,6 +152,7 @@ HTile { HMenuItem { text: qsTr("Use default account settings") + checkable: true checked: model.notification_setting === "UseDefaultSettings" onTriggered: py.callClientCoro( model.for_account, "room_pushrule_use_default", [model.id], @@ -160,6 +161,7 @@ HTile { HMenuItem { text: qsTr("All new messages") + checkable: true checked: model.notification_setting === "AllEvents" onTriggered: py.callClientCoro( model.for_account, "room_pushrule_all_events", [model.id], @@ -168,6 +170,7 @@ HTile { HMenuItem { text: qsTr("Highlights only (replies, keywords...)") + checkable: true checked: model.notification_setting === "HighlightsOnly" onTriggered: py.callClientCoro( model.for_account, @@ -178,6 +181,7 @@ HTile { HMenuItem { text: qsTr("Ignore new messages") + checkable: true checked: model.notification_setting === "IgnoreEvents" onTriggered: py.callClientCoro( model.for_account, "room_pushrule_ignore_all", [model.id], diff --git a/src/gui/MainPane/TopBar.qml b/src/gui/MainPane/TopBar.qml index e9ed3a17..df8f4ca3 100644 --- a/src/gui/MainPane/TopBar.qml +++ b/src/gui/MainPane/TopBar.qml @@ -94,6 +94,7 @@ Rectangle { HMenuItem { text: qsTr("Enable notifications") + checkable: true checked: mainUI.notificationLevel === UI.NotificationLevel.Enable @@ -104,6 +105,7 @@ Rectangle { HMenuItem { text: qsTr("Highlights only (replies, keywords...)") + checkable: true checked: mainUI.notificationLevel === UI.NotificationLevel.HighlightsOnly @@ -114,6 +116,7 @@ Rectangle { HMenuItem { text: qsTr("Mute all notifications") + checkable: true checked: mainUI.notificationLevel === UI.NotificationLevel.Mute onTriggered: diff --git a/src/icons/thin/menu-item-check-mark.svg b/src/icons/thin/menu-item-check-mark.svg new file mode 100644 index 00000000..8fda6c85 --- /dev/null +++ b/src/icons/thin/menu-item-check-mark.svg @@ -0,0 +1,3 @@ + + +