Add icons to room actions

This commit is contained in:
Nate Graham
2022-11-04 11:55:22 -06:00
parent 58ed108a1b
commit b9d7e43fd1
2 changed files with 17 additions and 0 deletions

View File

@@ -104,6 +104,8 @@ if(ANDROID)
target_link_libraries(neochat PUBLIC Qt::Svg OpenSSL::SSL) target_link_libraries(neochat PUBLIC Qt::Svg OpenSSL::SSL)
kirigami_package_breeze_icons(ICONS kirigami_package_breeze_icons(ICONS
"arrow-down" "arrow-down"
"arrow-up"
"checkmark"
"help-about" "help-about"
"im-user" "im-user"
"im-invisible-user" "im-invisible-user"
@@ -123,6 +125,7 @@ if(ANDROID)
"user-others" "user-others"
"media-playback-pause" "media-playback-pause"
"media-playback-start" "media-playback-start"
"go-previous"
"go-up" "go-up"
"go-down" "go-down"
"list-add" "list-add"

View File

@@ -24,6 +24,7 @@ Loader {
MenuItem { MenuItem {
id: newWindow id: newWindow
text: i18n("Open in New Window") text: i18n("Open in New Window")
icon.name: "window-new"
onTriggered: RoomManager.openWindow(room); onTriggered: RoomManager.openWindow(room);
visible: !Kirigami.Settings.isMobile visible: !Kirigami.Settings.isMobile
} }
@@ -34,21 +35,25 @@ Loader {
MenuItem { MenuItem {
text: room.isFavourite ? i18n("Remove from Favourites") : i18n("Add to Favourites") text: room.isFavourite ? i18n("Remove from Favourites") : i18n("Add to Favourites")
icon.name: room.isFavourite ? "bookmark-remove" : "bookmark-new"
onTriggered: room.isFavourite ? room.removeTag("m.favourite") : room.addTag("m.favourite", 1.0) onTriggered: room.isFavourite ? room.removeTag("m.favourite") : room.addTag("m.favourite", 1.0)
} }
MenuItem { MenuItem {
text: room.isLowPriority ? i18n("Reprioritize") : i18n("Deprioritize") text: room.isLowPriority ? i18n("Reprioritize") : i18n("Deprioritize")
icon.name: room.isLowPriority ? "arrow-up" : "arrow-down"
onTriggered: room.isLowPriority ? room.removeTag("m.lowpriority") : room.addTag("m.lowpriority", 1.0) onTriggered: room.isLowPriority ? room.removeTag("m.lowpriority") : room.addTag("m.lowpriority", 1.0)
} }
MenuItem { MenuItem {
text: i18n("Mark as Read") text: i18n("Mark as Read")
icon.name: "checkmark"
onTriggered: room.markAllMessagesAsRead() onTriggered: room.markAllMessagesAsRead()
} }
MenuItem { MenuItem {
text: i18nc("@action:inmenu", "Copy Address to Clipboard") text: i18nc("@action:inmenu", "Copy Address to Clipboard")
icon.name: "edit-copy"
onTriggered: if (room.canonicalAlias.length === 0) { onTriggered: if (room.canonicalAlias.length === 0) {
Clipboard.saveText(room.id) Clipboard.saveText(room.id)
} else { } else {
@@ -61,6 +66,7 @@ Loader {
MenuItem { MenuItem {
text: i18n("Follow Global Setting") text: i18n("Follow Global Setting")
icon.name: "globe"
checkable: true checkable: true
autoExclusive: true autoExclusive: true
checked: room.pushNotificationState === PushNotificationState.Default checked: room.pushNotificationState === PushNotificationState.Default
@@ -71,6 +77,7 @@ Loader {
} }
MenuItem { MenuItem {
text: i18nc("As in 'notify for all messages'","All") text: i18nc("As in 'notify for all messages'","All")
icon.name: "notifications"
checkable: true checkable: true
autoExclusive: true autoExclusive: true
checked: room.pushNotificationState === PushNotificationState.All checked: room.pushNotificationState === PushNotificationState.All
@@ -81,6 +88,7 @@ Loader {
} }
MenuItem { MenuItem {
text: i18nc("As in 'notify when the user is mentioned or the message contains a set keyword'","@Mentions and Keywords") text: i18nc("As in 'notify when the user is mentioned or the message contains a set keyword'","@Mentions and Keywords")
icon.name: "im-user"
checkable: true checkable: true
autoExclusive: true autoExclusive: true
checked: room.pushNotificationState === PushNotificationState.MentionKeyword checked: room.pushNotificationState === PushNotificationState.MentionKeyword
@@ -91,6 +99,7 @@ Loader {
} }
MenuItem { MenuItem {
text: i18nc("As in 'do not notify for any messages'","Off") text: i18nc("As in 'do not notify for any messages'","Off")
icon.name: "notifications-disabled"
checkable: true checkable: true
autoExclusive: true autoExclusive: true
checked: room.pushNotificationState === PushNotificationState.Mute checked: room.pushNotificationState === PushNotificationState.Mute
@@ -103,6 +112,7 @@ Loader {
MenuItem { MenuItem {
text: i18n("Room Settings") text: i18n("Room Settings")
icon.name: "configure"
onTriggered: ApplicationWindow.window.pageStack.pushDialogLayer('qrc:/Categories.qml', {room: room}) onTriggered: ApplicationWindow.window.pageStack.pushDialogLayer('qrc:/Categories.qml', {room: room})
} }
@@ -110,6 +120,7 @@ Loader {
MenuItem { MenuItem {
text: i18n("Leave Room") text: i18n("Leave Room")
icon.name: "go-previous"
onTriggered: RoomManager.leaveRoom(room) onTriggered: RoomManager.leaveRoom(room)
} }
@@ -173,17 +184,20 @@ Loader {
Kirigami.BasicListItem { Kirigami.BasicListItem {
text: room.isLowPriority ? i18n("Reprioritize") : i18n("Deprioritize") text: room.isLowPriority ? i18n("Reprioritize") : i18n("Deprioritize")
icon: room.isLowPriority ? "arrow-up" : "arrow-down"
onClicked: room.isLowPriority ? room.removeTag("m.lowpriority") : room.addTag("m.lowpriority", 1.0) onClicked: room.isLowPriority ? room.removeTag("m.lowpriority") : room.addTag("m.lowpriority", 1.0)
implicitHeight: visible ? Kirigami.Units.gridUnit * 3 : 0 implicitHeight: visible ? Kirigami.Units.gridUnit * 3 : 0
} }
Kirigami.BasicListItem { Kirigami.BasicListItem {
text: i18n("Mark as Read") text: i18n("Mark as Read")
icon: "checkmark"
onClicked: room.markAllMessagesAsRead() onClicked: room.markAllMessagesAsRead()
implicitHeight: visible ? Kirigami.Units.gridUnit * 3 : 0 implicitHeight: visible ? Kirigami.Units.gridUnit * 3 : 0
} }
Kirigami.BasicListItem { Kirigami.BasicListItem {
text: i18n("Leave Room") text: i18n("Leave Room")
icon: "go-previous"
onClicked: RoomManager.leaveRoom(room) onClicked: RoomManager.leaveRoom(room)
implicitHeight: visible ? Kirigami.Units.gridUnit * 3 : 0 implicitHeight: visible ? Kirigami.Units.gridUnit * 3 : 0
} }