From 6f7695ad229552cce44d92d90476a37d55fd124b Mon Sep 17 00:00:00 2001 From: miruka Date: Mon, 9 Sep 2019 06:32:29 -0400 Subject: [PATCH] HBoxPopup: split text into summary and details --- src/qml/Base/HBoxPopup.qml | 16 +++++++++++++--- src/qml/Chat/ClearMessagesPopup.qml | 4 ++-- src/qml/Pages/EditAccount/ImportExportKeys.qml | 4 ++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/qml/Base/HBoxPopup.qml b/src/qml/Base/HBoxPopup.qml index 720ff81a..cb4137c3 100644 --- a/src/qml/Base/HBoxPopup.qml +++ b/src/qml/Base/HBoxPopup.qml @@ -10,8 +10,8 @@ HPopup { signal cancel() - property alias label: label - property alias text: label.text + property alias summary: summary + property alias details: details property bool okClicked: false @@ -27,8 +27,18 @@ HPopup { HLabel { - id: label + id: summary wrapMode: Text.Wrap + font.bold: true + visible: Boolean(text) + + Layout.fillWidth: true + } + + HLabel { + id: details + wrapMode: Text.Wrap + visible: Boolean(text) Layout.fillWidth: true } diff --git a/src/qml/Chat/ClearMessagesPopup.qml b/src/qml/Chat/ClearMessagesPopup.qml index a62702c3..2095ab82 100644 --- a/src/qml/Chat/ClearMessagesPopup.qml +++ b/src/qml/Chat/ClearMessagesPopup.qml @@ -2,8 +2,8 @@ import QtQuick 2.12 import "../Base" HBoxPopup { - text: qsTr( - "Clear this room's messages?\n" + + summary.text: qsTr("Clear this room's messages?") + details.text: qsTr( "The messages will only be removed on your side. " + "They will be available again after you restart the application." ) diff --git a/src/qml/Pages/EditAccount/ImportExportKeys.qml b/src/qml/Pages/EditAccount/ImportExportKeys.qml index 3cecb534..a4b9bdf1 100644 --- a/src/qml/Pages/EditAccount/ImportExportKeys.qml +++ b/src/qml/Pages/EditAccount/ImportExportKeys.qml @@ -62,7 +62,7 @@ HBox { property url file: "" id: exportPasswordPopup - label.text: qsTr("Please enter a passphrase to protect this file:") + details.text: qsTr("Please enter a passphrase to protect this file:") onAcceptedPasswordChanged: encryptionUI.exportKeys(file, acceptedPassword, exportButton) } @@ -79,7 +79,7 @@ HBox { } id: importPasswordPopup - label.text: qsTr( + details.text: qsTr( "Please enter the passphrase that was used to protect this file:" ) onAcceptedPasswordChanged: