From bb6244f9fa200d8442b9256fc25d1c1bc9578d26 Mon Sep 17 00:00:00 2001 From: link2xt Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: Change "Attach" button to "Detach" when file is attached As a side effect, this adds a visual cue that a file will be sent. There is no file preview yet, so at least some indicator is needed. --- qml/ComposePane.qml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'qml/ComposePane.qml') diff --git a/qml/ComposePane.qml b/qml/ComposePane.qml index 2dc24d1..f8f3b6b 100644 --- a/qml/ComposePane.qml +++ b/qml/ComposePane.qml @@ -50,13 +50,19 @@ Pane { Button { id: attachButton visible: root.canSend - text: qsTr("Attach") + text: attachFileUrl.length > 0 ? qsTr("Detach") : qsTr("Attach") Layout.alignment: Qt.AlignBottom icon.name: "mail-attachment" - onClicked: attachFileDialog.open() + onClicked: { + if (attachFileUrl.length > 0) { + attachFileUrl = "" + } else { + attachFileDialog.open() + } + } } TextArea { -- cgit v1.2.3-70-g09d2