diff --git a/src/chatbar/CMakeLists.txt b/src/chatbar/CMakeLists.txt index 3738f90e5..fdd08781f 100644 --- a/src/chatbar/CMakeLists.txt +++ b/src/chatbar/CMakeLists.txt @@ -22,7 +22,6 @@ ecm_add_qml_module(Chatbar GENERATE_PLUGIN_SOURCE StyleDelegate.qml ImageEditorPage.qml VoiceMessageDialog.qml - ImageDialog.qml LinkDialog.qml LocationChooser.qml NewPollDialog.qml diff --git a/src/chatbar/SendBar.qml b/src/chatbar/SendBar.qml index 38c8c5a68..5d9234556 100644 --- a/src/chatbar/SendBar.qml +++ b/src/chatbar/SendBar.qml @@ -83,6 +83,13 @@ RowLayout { dialog.open(); } + function openVoiceDialog(): void { + let dialog = Qt.createComponent('org.kde.neochat.chatbar', 'VoiceMessageDialog').createObject(root, { + room: root.currentRoom + }) as VoiceMessageDialog; + dialog.open(); + } + Kirigami.Separator { Layout.fillHeight: true } @@ -132,6 +139,11 @@ RowLayout { text: i18nc("@action:button", "Create a Poll") onTriggered: root.openNewPollDialog(); } + QQC2.MenuItem { + icon.name: "microphone" + text: i18nc("@action:button", "Send a Voice Message") + onTriggered: root.openVoiceDialog(); + } } } @@ -176,6 +188,16 @@ RowLayout { QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay QQC2.ToolTip.text: text } + QQC2.ToolButton { + visible: (root.contentModel?.type ?? true) === LibNeoChat.ChatBarType.Room && root.maxAvailableWidth >= root.overflowWidth + icon.name: "microphone" + text: i18nc("@action:button", "Send a Voice Message") + display: QQC2.AbstractButton.IconOnly + onClicked: root.openVoiceDialog(); + QQC2.ToolTip.visible: hovered + QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay + QQC2.ToolTip.text: text + } QQC2.ToolButton { id: sendButton icon.name: "document-send"