Spectral/qml/menu/RoomContextMenu.qml

36 lines
948 B
QML
Raw Normal View History

import QtQuick 2.9
import QtQuick.Controls 2.2
import Spectral 0.1
Menu {
2018-09-12 00:27:34 +00:00
property var model: null
2018-09-11 05:14:56 +00:00
id: roomListMenu
MenuItem {
text: "Favourite"
checkable: true
2018-09-12 00:27:34 +00:00
checked: model && model.category === RoomType.Favorite
2018-09-04 13:13:14 +00:00
2018-09-12 00:27:34 +00:00
onTriggered: model.category === RoomType.Favorite ? model.currentRoom.removeTag("m.favourite") : model.currentRoom.addTag("m.favourite", "1")
}
MenuItem {
text: "Deprioritize"
checkable: true
2018-09-12 00:27:34 +00:00
checked: model && model.category === RoomType.Deprioritized
2018-09-04 13:13:14 +00:00
2018-09-12 00:27:34 +00:00
onTriggered: model.category === RoomType.Deprioritized ? model.currentRoom.removeTag("m.lowpriority") : model.currentRoom.addTag("m.lowpriority", "1")
}
MenuSeparator {}
MenuItem {
text: "Mark as Read"
2018-09-04 13:13:14 +00:00
2018-09-12 00:27:34 +00:00
onTriggered: model.currentRoom.markAllMessagesAsRead()
}
MenuItem {
text: "Leave Room"
2018-09-04 13:13:14 +00:00
2018-09-12 00:27:34 +00:00
onTriggered: model.currentRoom.forget()
}
}