From 724a579f0d88772091d7508748b785a973a2039a Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Fri, 5 Mar 2021 15:47:31 -0500 Subject: [PATCH] Move upload button to align chatbar to room text --- imports/NeoChat/Component/ChatTextInput.qml | 74 +++++++++++---------- 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/imports/NeoChat/Component/ChatTextInput.qml b/imports/NeoChat/Component/ChatTextInput.qml index 6fcc22e71..93143b7c3 100644 --- a/imports/NeoChat/Component/ChatTextInput.qml +++ b/imports/NeoChat/Component/ChatTextInput.qml @@ -311,10 +311,49 @@ ToolBar { onClicked: clearEditReply() } + RowLayout { + Layout.fillHeight: true + Layout.preferredWidth: Kirigami.Units.gridUnit * 2 + Kirigami.Units.smallSpacing + Kirigami.Units.largeSpacing + + ToolButton { + id: uploadButton + + visible: !isReply && !hasAttachment + + icon.name: "mail-attachment" + + onClicked: { + if (Clipboard.hasImage) { + attachDialog.open() + } else { + var fileDialog = openFileDialog.createObject(ApplicationWindow.overlay) + + fileDialog.chosen.connect(function(path) { + if (!path) return + + root.attach(path) + }) + + fileDialog.open() + } + } + + ToolTip { + text: i18n("Attach an image or file") + } + + BusyIndicator { + anchors.fill: parent + + running: currentRoom && currentRoom.hasFileUploading + } + } + } ScrollView { Layout.fillWidth: true Layout.maximumHeight: inputField.lineHeight * 8 + TextArea { id: inputField property real progress: 0 @@ -522,7 +561,6 @@ ToolBar { } } - ToolButton { id: emojiButton icon.name: "preferences-desktop-emoticons" @@ -537,40 +575,6 @@ ToolBar { } } - ToolButton { - id: uploadButton - - visible: !isReply && !hasAttachment - - icon.name: "mail-attachment" - - onClicked: { - if (Clipboard.hasImage) { - attachDialog.open() - } else { - var fileDialog = openFileDialog.createObject(ApplicationWindow.overlay) - - fileDialog.chosen.connect(function(path) { - if (!path) return - - root.attach(path) - }) - - fileDialog.open() - } - } - - ToolTip { - text: i18n("Attach an image or file") - } - - BusyIndicator { - anchors.fill: parent - - running: currentRoom && currentRoom.hasFileUploading - } - } - ToolButton { icon.name: "document-send" icon.color: "transparent"