Spectral/qml/menu/RoomContextMenu.qml

36 lines
889 B
QML
Raw Normal View History

import QtQuick 2.9
import QtQuick.Controls 2.2
Menu {
id: roomListMenu
MenuItem {
text: "Favourite"
checkable: true
checked: currentRoom && currentRoom.isFavourite
2018-09-04 13:13:14 +00:00
onTriggered: currentRoom.isFavourite ? currentRoom.removeTag("m.favourite") : currentRoom.addTag("m.favourite", "1")
}
MenuItem {
text: "Deprioritize"
checkable: true
checked: currentRoom && currentRoom.isLowPriority
2018-09-04 13:13:14 +00:00
onTriggered: currentRoom.isLowPriority ? currentRoom.removeTag("m.lowpriority") : currentRoom.addTag("m.lowpriority", "1")
}
MenuSeparator {}
MenuItem {
text: "Mark as Read"
2018-09-04 13:13:14 +00:00
onTriggered: currentRoom.markAllMessagesAsRead()
}
MenuItem {
text: "Leave Room"
2018-09-04 13:13:14 +00:00
onTriggered: currentRoom.forget()
}
Component.onCompleted: popup()
onClosed: roomListMenu.destroy()
}