From 307687542cdfb6a35ba7eb6c9c89a28678649cdd Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Fri, 28 Aug 2026 13:40:14 +0200 Subject: [PATCH] gui: add submit button to prompt input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a ▶ button next to the text area for mouse-based submission. Extract shared doSubmit() on the input RowLayout. Button uses focusPolicy: Qt.NoFocus so it doesn't steal focus from the TextArea. --- kde/gui/ChatPane.qml | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/kde/gui/ChatPane.qml b/kde/gui/ChatPane.qml index aea7e77..b2397ce 100644 --- a/kde/gui/ChatPane.qml +++ b/kde/gui/ChatPane.qml @@ -203,10 +203,18 @@ Item { // Input RowLayout { + id: inputRow Layout.fillWidth: true Layout.margins: 6 spacing: 4 + function doSubmit() { + if (promptInput.text.trim() !== "") { + ollie.submit(promptInput.text.trim()) + promptInput.text = "" + } + } + // TextArea in ScrollView for overflow, with context menu overlay Item { Layout.fillWidth: true @@ -246,10 +254,7 @@ Item { if (event.modifiers & Qt.ShiftModifier) { event.accepted = false } else { - if (text.trim() !== "") { - ollie.submit(text.trim()) - text = "" - } + inputRow.doSubmit() event.accepted = true } } @@ -285,6 +290,19 @@ Item { } } } + + Button { + text: "▶" + Layout.alignment: Qt.AlignBottom + Layout.preferredWidth: 36 + Layout.preferredHeight: 36 + focusPolicy: Qt.NoFocus + enabled: promptInput.enabled && promptInput.text.trim() !== "" + onClicked: inputRow.doSubmit() + + ToolTip.visible: hovered + ToolTip.text: "Send (Enter)" + } } }