From 9fc55c72f054c2cf1d18c90df356e3a6c0fa71d0 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Fri, 9 Nov 2018 18:06:35 +0000 Subject: [PATCH] Use plasma TextArea for sharing text in plasmoid Summary: This also fixes a bug where the box could be too small. BUG: 400862 Reviewers: #kde_connect, nicolasfella Reviewed By: #kde_connect, nicolasfella Subscribers: nicolasfella, sredman, apol, kdeconnect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D16782 --- plasmoid/package/contents/ui/DeviceDelegate.qml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/plasmoid/package/contents/ui/DeviceDelegate.qml b/plasmoid/package/contents/ui/DeviceDelegate.qml index 8a23f2942..e806d3c6f 100644 --- a/plasmoid/package/contents/ui/DeviceDelegate.qml +++ b/plasmoid/package/contents/ui/DeviceDelegate.qml @@ -22,9 +22,8 @@ import QtQuick 2.1 import QtQuick.Layouts 1.1 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents +import org.kde.plasma.components 3.0 as PlasmaComponents3 import org.kde.kdeconnect 1.0 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import QtQuick.Dialogs 1.0 import QtQuick.Controls 2.4 @@ -250,11 +249,9 @@ PlasmaComponents.ListItem PlasmaComponents.Label { text: i18n("Share text") } - TextArea { + PlasmaComponents3.TextArea { id: shareText - wrapMode: TextEdit.NoWrap - width: parent.width; - height: Math.max(shareText.contentHeight + shareText.textMargin * 3, shareText.textMargin * 7 + shareText.font.pixelSize) + width: parent.width } PlasmaComponents.Button { @@ -262,7 +259,8 @@ PlasmaComponents.ListItem anchors.right: shareText.right iconSource: "document-send" onClicked: { - share.plugin.shareText(shareText.getText(0, shareText.length)) + share.plugin.shareText(shareText.getText(0, shareText.length)) + shareText.clear() } } //NOTE: More information could be displayed here