From a67d61195895b2977faee8f638f43385fb1746e0 Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 27 Oct 2019 15:12:57 -0400 Subject: [PATCH] Composer: add an upload button + file dialog Upload not working yet --- TODO.md | 5 ++--- src/icons/thin/upload-file.svg | 3 +++ src/qml/Chat/Composer.qml | 13 +++++++++++++ src/themes/Default.qpl | 3 +++ 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 src/icons/thin/upload-file.svg diff --git a/TODO.md b/TODO.md index d196a053..dd65ef35 100644 --- a/TODO.md +++ b/TODO.md @@ -6,20 +6,18 @@ - Bottom/top bar - Uploading (+local echo) - Deduplicate uploads - - EventLink - File thumbnails + ask matrix API? - Encrypted media - Loading animation - GIF thumbnails: load the real animated image - - Copy thumbnail URL in context menu? + - EventLink - GIFs can use the video player - Video bug: when media is done playing, clicking on progress slider always bring back to the beginning no matter where - Video: missing buttons and small size problems - Audio: online playback is buggy, must download+play file - - In the "Leave me" room, "join > Hi > left" aren't combined - Combined pure media events time looks bad - RoomMessageNotice @@ -39,6 +37,7 @@ - When qml syntax highlighting supports ES6 string interpolation, use that - Fixes + - In the "Leave me" room, "join > Hi > left" aren't combined - Event delegates changing height don't scroll the list - When selecting text and scrolling up, selection stops working after a while - Ensure all the text that should be copied is copied diff --git a/src/icons/thin/upload-file.svg b/src/icons/thin/upload-file.svg new file mode 100644 index 00000000..92a95128 --- /dev/null +++ b/src/icons/thin/upload-file.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/qml/Chat/Composer.qml b/src/qml/Chat/Composer.qml index e44573aa..902836d8 100644 --- a/src/qml/Chat/Composer.qml +++ b/src/qml/Chat/Composer.qml @@ -1,6 +1,7 @@ import QtQuick 2.12 import QtQuick.Layouts 1.12 import "../Base" +import "../Dialogs" import "../utils.js" as Utils Rectangle { @@ -203,5 +204,17 @@ Rectangle { }) } } + + HButton { + icon.name: "upload-file" + backgroundColor: theme.chat.composer.uploadButton.background + toolTip.text: qsTr("Upload files") + + Layout.fillHeight: true + + HFileDialogOpener { + dialog.title: qsTr("Select files to upload") + } + } } } diff --git a/src/themes/Default.qpl b/src/themes/Default.qpl index a79a3b9a..df5b2c27 100644 --- a/src/themes/Default.qpl +++ b/src/themes/Default.qpl @@ -362,6 +362,9 @@ chat: composer: color background: colors.strongBackground + uploadButton: + color background: "transparent" + mediaPlayer: hoverPreview: