Add support for sharing text from plasmoid
Summary: This allows you to enter text in the plasmoid and it be sent to the connected device. Reviewers: #vdg, #kde_connect, albertvaka Reviewed By: #kde_connect, albertvaka Subscribers: apol, kdeconnect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D16696
This commit is contained in:
parent
b0e9cb3c7c
commit
061d415f83
1 changed files with 26 additions and 4 deletions
|
@ -23,6 +23,7 @@ import QtQuick.Layouts 1.1
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||||
import org.kde.kdeconnect 1.0
|
import org.kde.kdeconnect 1.0
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
import QtQuick.Controls.Styles 1.4
|
import QtQuick.Controls.Styles 1.4
|
||||||
import QtQuick.Dialogs 1.0
|
import QtQuick.Dialogs 1.0
|
||||||
|
|
||||||
|
@ -110,10 +111,6 @@ PlasmaComponents.ListItem
|
||||||
//Share
|
//Share
|
||||||
PlasmaComponents.Button
|
PlasmaComponents.Button
|
||||||
{
|
{
|
||||||
Share {
|
|
||||||
id: share
|
|
||||||
device: root.device
|
|
||||||
}
|
|
||||||
FileDialog {
|
FileDialog {
|
||||||
id: fileDialog
|
id: fileDialog
|
||||||
title: "Please choose a file"
|
title: "Please choose a file"
|
||||||
|
@ -311,6 +308,31 @@ PlasmaComponents.ListItem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Share
|
||||||
|
Share {
|
||||||
|
id: share
|
||||||
|
device: root.device
|
||||||
|
}
|
||||||
|
|
||||||
|
PlasmaComponents.Label {
|
||||||
|
text: i18n("Share text")
|
||||||
|
}
|
||||||
|
TextArea {
|
||||||
|
id: shareText
|
||||||
|
wrapMode: TextEdit.NoWrap
|
||||||
|
width: parent.width;
|
||||||
|
height: Math.max(shareText.contentHeight + shareText.textMargin * 3, shareText.textMargin * 7 + shareText.font.pixelSize)
|
||||||
|
}
|
||||||
|
PlasmaComponents.Button
|
||||||
|
{
|
||||||
|
id: submitTextButton
|
||||||
|
anchors.right: shareText.right
|
||||||
|
iconSource: "document-send"
|
||||||
|
onClicked: {
|
||||||
|
share.plugin.shareText(shareText.getText(0, shareText.length))
|
||||||
|
}
|
||||||
|
}
|
||||||
//NOTE: More information could be displayed here
|
//NOTE: More information could be displayed here
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue