Add accept invite to room context menu
This commit is contained in:
parent
076ff743ad
commit
26b01be23c
2
TODO.md
2
TODO.md
|
@ -5,6 +5,7 @@
|
|||
- File format
|
||||
- Make all icon SVG files white/black, since we can now use ColorOverlay
|
||||
- Make the icon blue in EditAccount when hovering and no avatar set
|
||||
- Remove the filled theme
|
||||
|
||||
- Use [Animators](https://doc.qt.io/qt-5/qml-qtquick-animator.html)
|
||||
- Choose a better default easing type for animations
|
||||
|
@ -33,6 +34,7 @@
|
|||
- Terrible performance using `QT_QPA_PLATFORM=wayland-egl`, must use `xcb`
|
||||
|
||||
- UI
|
||||
- Use a Loader for context menus
|
||||
- Make HListView scrollbars visible
|
||||
- Remove first html lists left margin
|
||||
- Adapt UI for small heights
|
||||
|
|
|
@ -17,7 +17,7 @@ Menu {
|
|||
rightPadding = Math.max(item.rightPadding, rightPadding)
|
||||
}
|
||||
return Math.min(
|
||||
result + leftPadding + rightPadding, theme.minimumSupportedWidth
|
||||
result + leftPadding + rightPadding, window.width
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -77,10 +77,24 @@ HTileDelegate {
|
|||
}
|
||||
|
||||
contextMenu: HMenu {
|
||||
HMenuItem {
|
||||
visible: invited
|
||||
icon.name: "invite-accept"
|
||||
text: qsTr("Accept %1's invite").arg(Utils.coloredNameHtml(
|
||||
model.data.inviter_name, model.data.inviter_id
|
||||
))
|
||||
label.textFormat: Text.StyledText
|
||||
|
||||
onTriggered: py.callClientCoro(
|
||||
model.user_id, "join", [model.data.room_id]
|
||||
)
|
||||
}
|
||||
|
||||
HMenuItem {
|
||||
visible: ! model.data.left
|
||||
icon.name: invited ? "invite-decline" : "room-leave"
|
||||
text: invited ? qsTr("Decline invite") : qsTr("Leave")
|
||||
|
||||
onTriggered: py.callClientCoro(
|
||||
model.user_id, "room_leave", [model.data.room_id]
|
||||
)
|
||||
|
@ -89,6 +103,7 @@ HTileDelegate {
|
|||
HMenuItem {
|
||||
icon.name: "room-forget"
|
||||
text: qsTr("Forget")
|
||||
|
||||
onTriggered: py.callClientCoro(
|
||||
model.user_id, "room_forget", [model.data.room_id]
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user