Enable ending polls

This commit is contained in:
James Graham
2025-03-28 13:41:46 +00:00
parent fadb5725e0
commit 42fab806c6
9 changed files with 113 additions and 50 deletions

View File

@@ -136,7 +136,7 @@ QQC2.Control {
}
QQC2.Button {
visible: NeoChatConfig.threads && !root.currentRoom.readOnly
visible: NeoChatConfig.threads && !root.currentRoom.readOnly && !root.delegate?.isPoll
text: i18n("Reply in Thread")
icon.name: "dialog-messages"
display: QQC2.Button.IconOnly
@@ -153,6 +153,18 @@ QQC2.Control {
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
}
QQC2.Button {
visible: (root.delegate?.isPoll ?? false) && !root.currentRoom.poll(root.delegate.eventId).hasEnded
text: i18n("End Poll")
icon.name: "gtk-stop"
display: QQC2.ToolButton.IconOnly
onClicked: root.currentRoom.poll(root.delegate.eventId).endPoll()
QQC2.ToolTip.text: text
QQC2.ToolTip.visible: hovered
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
}
EmojiDialog {
id: emojiDialog
currentRoom: root.currentRoom