2017-06-08 01:53:54 +03:00
|
|
|
import QtQuick 2.0
|
|
|
|
import Sailfish.Silica 1.0
|
2017-07-06 01:59:00 +03:00
|
|
|
import harbour.tooter.Uploader 1.0
|
2017-06-08 01:53:54 +03:00
|
|
|
import "../lib/API.js" as Logic
|
|
|
|
import "./components/"
|
|
|
|
|
|
|
|
Page {
|
|
|
|
id: conversationPage
|
|
|
|
property string type;
|
|
|
|
property alias title: header.title
|
|
|
|
property alias description: header.description
|
|
|
|
property alias avatar: header.image
|
2017-10-27 17:44:35 +03:00
|
|
|
property string suggestedUser: ""
|
|
|
|
property ListModel suggestedModel;
|
2017-11-01 18:57:09 +03:00
|
|
|
property string toot_id: ""
|
2018-10-25 15:00:19 +03:00
|
|
|
property int tootMaxChar: 500;
|
2017-06-15 17:03:20 +03:00
|
|
|
property ListModel mdl;
|
2017-07-20 13:14:16 +03:00
|
|
|
allowedOrientations: Orientation.All
|
2017-10-27 17:44:35 +03:00
|
|
|
onSuggestedUserChanged: {
|
|
|
|
console.log(suggestedUser)
|
|
|
|
suggestedModel = Qt.createQmlObject('import QtQuick 2.0; ListModel { }', Qt.application, 'InternalQmlObject');
|
|
|
|
predictionList.visible = false;
|
|
|
|
if (suggestedUser.length > 0) {
|
|
|
|
var msg = {
|
|
|
|
'action' : 'accounts/search',
|
|
|
|
'method' : 'GET',
|
|
|
|
'model' : suggestedModel,
|
|
|
|
'mode' : "append",
|
|
|
|
'params' : [ {name: "q", data: suggestedUser} ],
|
|
|
|
'conf' : Logic.conf
|
|
|
|
};
|
|
|
|
worker.sendMessage(msg);
|
|
|
|
predictionList.visible = true;
|
2017-07-06 17:15:12 +03:00
|
|
|
}
|
2017-07-06 12:22:12 +03:00
|
|
|
}
|
2017-10-27 17:44:35 +03:00
|
|
|
|
2017-10-26 17:23:16 +03:00
|
|
|
ListModel {
|
2017-10-27 17:44:35 +03:00
|
|
|
id: mediaModel
|
2017-10-26 17:23:16 +03:00
|
|
|
onCountChanged: {
|
2017-10-27 17:44:35 +03:00
|
|
|
btnAddImage.enabled = mediaModel.count < 4
|
2017-10-26 17:23:16 +03:00
|
|
|
}
|
|
|
|
}
|
2017-06-08 01:53:54 +03:00
|
|
|
|
|
|
|
WorkerScript {
|
|
|
|
id: worker
|
|
|
|
source: "../lib/Worker.js"
|
|
|
|
onMessage: {
|
|
|
|
console.log(JSON.stringify(messageObject))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ProfileHeader {
|
|
|
|
id: header
|
2017-06-15 17:03:20 +03:00
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
SilicaListView {
|
|
|
|
id: conversationList
|
|
|
|
header: PageHeader {
|
|
|
|
title: qsTr("Conversation")
|
|
|
|
}
|
|
|
|
clip: true;
|
|
|
|
anchors {
|
|
|
|
top: parent.top
|
|
|
|
bottom: panel.top
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
|
|
|
}
|
|
|
|
model: mdl
|
2017-06-22 15:49:39 +03:00
|
|
|
section {
|
|
|
|
property: 'section'
|
|
|
|
delegate: SectionHeader {
|
|
|
|
height: Theme.itemSizeExtraSmall
|
|
|
|
text: Format.formatDate(section, Formatter.DateMedium)
|
|
|
|
}
|
|
|
|
}
|
2017-06-15 17:03:20 +03:00
|
|
|
delegate: VisualContainer {}
|
|
|
|
onCountChanged: {
|
2017-10-19 11:42:40 +03:00
|
|
|
if (mdl)
|
|
|
|
for (var i = 0; i < mdl.count; i++){
|
|
|
|
if (mdl.get(i).status_id === toot_id) {
|
|
|
|
console.log(mdl.get(i).status_id)
|
|
|
|
positionViewAtIndex(i, ListView.Center )
|
|
|
|
}
|
2017-06-15 17:03:20 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-08 01:53:54 +03:00
|
|
|
}
|
2017-10-26 17:23:16 +03:00
|
|
|
Rectangle {
|
|
|
|
id: predictionList
|
|
|
|
visible: false;
|
|
|
|
anchors.bottom: panel.top
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: panel.right
|
2017-10-27 17:44:35 +03:00
|
|
|
height: suggestedModel.count > 6 ? Theme.itemSizeMedium * 6 : Theme.itemSizeMedium * suggestedModel.count
|
2017-10-26 17:23:16 +03:00
|
|
|
color: Theme.highlightDimmerColor
|
|
|
|
|
2017-10-27 17:44:35 +03:00
|
|
|
SilicaListView {
|
2017-10-26 17:23:16 +03:00
|
|
|
anchors.fill: parent
|
|
|
|
model: suggestedModel
|
|
|
|
clip: true
|
|
|
|
|
2017-10-27 17:44:35 +03:00
|
|
|
delegate: ItemUser {
|
|
|
|
onClicked: {
|
|
|
|
var start = toot.cursorPosition;
|
|
|
|
while(toot.text[start] !== "@" && start > 0){
|
|
|
|
start--;
|
2017-10-26 17:23:16 +03:00
|
|
|
}
|
2017-10-27 17:44:35 +03:00
|
|
|
textOperations.text = toot.text
|
|
|
|
textOperations.cursorPosition = toot.cursorPosition
|
|
|
|
textOperations.moveCursorSelection(start-1,TextInput.SelectWords)
|
|
|
|
toot.text = textOperations.text.substring(0, textOperations.selectionStart) + ' @'+model.account_acct + ' ' + textOperations.text.substring(textOperations.selectionEnd).trim()
|
2017-11-01 02:27:48 +03:00
|
|
|
|
2017-10-27 17:44:35 +03:00
|
|
|
toot.cursorPosition = toot.text.indexOf('@'+model.account_acct)
|
2017-10-26 17:23:16 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
onCountChanged: {
|
|
|
|
positionViewAtIndex(suggestedModel.count-1, ListView.End )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-06-08 01:53:54 +03:00
|
|
|
|
|
|
|
DockedPanel {
|
|
|
|
id: panel
|
|
|
|
open: true
|
2017-06-22 15:49:39 +03:00
|
|
|
onExpandedChanged: {
|
|
|
|
if (!expanded) {
|
|
|
|
show()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-08 01:53:54 +03:00
|
|
|
width: parent.width
|
2018-10-25 15:00:19 +03:00
|
|
|
height: progressBar.height + toot.height + (mediaModel.count ? uploadedImages.height : 0) + btnContentWarning.height + Theme.paddingMedium + (warningContent.visible ? warningContent.height : 0)
|
2017-06-08 01:53:54 +03:00
|
|
|
dock: Dock.Bottom
|
2018-10-25 15:00:19 +03:00
|
|
|
Rectangle {
|
|
|
|
width: parent.width
|
|
|
|
height: progressBar.height
|
|
|
|
color: Theme.highlightBackgroundColor
|
|
|
|
opacity: 0.2
|
|
|
|
anchors {
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
|
|
|
top: parent.top
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Rectangle {
|
|
|
|
id: progressBar
|
|
|
|
width: toot.text.length ? panel.width*(toot.text.length/tootMaxChar) : 0;
|
2020-01-25 00:00:04 +03:00
|
|
|
height: Theme.itemSizeSmall * 0.10
|
2018-10-25 15:00:19 +03:00
|
|
|
color: Theme.highlightBackgroundColor
|
|
|
|
opacity: 0.7
|
|
|
|
anchors {
|
|
|
|
left: parent.left
|
|
|
|
top: parent.top
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-08 01:53:54 +03:00
|
|
|
TextField {
|
|
|
|
id: warningContent
|
|
|
|
visible: false
|
|
|
|
height: visible ? implicitHeight : 0;
|
|
|
|
anchors {
|
|
|
|
top: parent.top
|
|
|
|
topMargin: Theme.paddingMedium
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
|
|
|
}
|
|
|
|
autoScrollEnabled: true
|
|
|
|
labelVisible: false
|
2020-01-25 00:00:04 +03:00
|
|
|
placeholderText: qsTr("Write your warning here")
|
|
|
|
placeholderColor: palette.highlightColor
|
|
|
|
color: palette.highlightColor
|
2017-06-08 01:53:54 +03:00
|
|
|
horizontalAlignment: Text.AlignLeft
|
|
|
|
EnterKey.onClicked: {
|
|
|
|
}
|
|
|
|
}
|
2017-10-27 17:44:35 +03:00
|
|
|
TextInput {
|
|
|
|
id: textOperations
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
|
2017-06-08 01:53:54 +03:00
|
|
|
TextArea {
|
|
|
|
id: toot
|
|
|
|
anchors {
|
|
|
|
top: warningContent.bottom
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
2017-07-06 17:15:12 +03:00
|
|
|
rightMargin: Theme.paddingMedium
|
2017-06-08 01:53:54 +03:00
|
|
|
}
|
|
|
|
autoScrollEnabled: true
|
|
|
|
labelVisible: false
|
2017-10-27 17:44:35 +03:00
|
|
|
//focus: true
|
2017-06-08 01:53:54 +03:00
|
|
|
text: description !== "" && (description.charAt(0) == '@' || description.charAt(0) == '#') ? description+' ' : ''
|
2020-01-25 00:00:04 +03:00
|
|
|
height: 300
|
2017-06-08 01:53:54 +03:00
|
|
|
horizontalAlignment: Text.AlignLeft
|
2020-01-25 00:00:04 +03:00
|
|
|
placeholderText: "What's on your mind?"
|
2017-06-08 01:53:54 +03:00
|
|
|
EnterKey.onClicked: {
|
|
|
|
}
|
2017-10-26 17:23:16 +03:00
|
|
|
onTextChanged: {
|
2017-10-27 17:44:35 +03:00
|
|
|
textOperations.text = toot.text
|
|
|
|
textOperations.cursorPosition = toot.cursorPosition
|
|
|
|
textOperations.selectWord()
|
|
|
|
textOperations.select(textOperations.selectionStart ? textOperations.selectionStart-1 : 0, textOperations.selectionEnd)
|
2017-11-01 02:27:48 +03:00
|
|
|
//console.log(textOperations.text.substr(textOperations.selectionStart, textOperations.selectionEnd))
|
2018-10-25 15:00:19 +03:00
|
|
|
console.log(toot.text.length)
|
2017-10-27 17:44:35 +03:00
|
|
|
suggestedUser = ""
|
|
|
|
if (textOperations.selectedText.charAt(0) === "@") {
|
|
|
|
suggestedUser = textOperations.selectedText.trim().substring(1);
|
2017-10-26 17:23:16 +03:00
|
|
|
}
|
|
|
|
}
|
2017-06-08 01:53:54 +03:00
|
|
|
}
|
|
|
|
IconButton {
|
2017-07-06 17:15:12 +03:00
|
|
|
id: btnSmileys
|
|
|
|
property string selection
|
|
|
|
onSelectionChanged: {
|
|
|
|
console.log(selection)
|
|
|
|
}
|
|
|
|
|
|
|
|
anchors {
|
2020-01-25 00:00:04 +03:00
|
|
|
top: warningContent.bottom
|
2017-07-06 17:15:12 +03:00
|
|
|
bottom: bottom.top
|
|
|
|
right: parent.right
|
|
|
|
rightMargin: Theme.paddingSmall
|
|
|
|
}
|
2020-01-30 00:22:19 +03:00
|
|
|
icon.source: "../../qml/images/emojiselect.svg" + (pressed
|
|
|
|
? Theme.secondaryHighlightColor
|
|
|
|
: Theme.secondaryColor)
|
2017-07-06 17:15:12 +03:00
|
|
|
onClicked: pageStack.push(firstWizardPage)
|
|
|
|
}
|
|
|
|
SilicaGridView {
|
|
|
|
id: uploadedImages
|
|
|
|
width: parent.width
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
height: mediaModel.count ? Theme.itemSizeSmall : 0
|
|
|
|
model: mediaModel
|
|
|
|
cellWidth: uploadedImages.width / 4
|
|
|
|
cellHeight: Theme.itemSizeSmall
|
|
|
|
delegate: BackgroundItem {
|
|
|
|
id: myDelegate
|
|
|
|
width: uploadedImages.cellWidth
|
|
|
|
height: uploadedImages.cellHeight
|
|
|
|
RemorseItem { id: remorse }
|
|
|
|
Image {
|
|
|
|
anchors.fill: parent
|
2017-10-20 16:20:33 +03:00
|
|
|
fillMode: Image.PreserveAspectCrop
|
2017-07-06 17:15:12 +03:00
|
|
|
source: model.preview_url
|
|
|
|
}
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
var idx = index
|
|
|
|
console.log(idx)
|
|
|
|
//mediaModel.remove(idx)
|
|
|
|
remorse.execute(myDelegate, qsTr("Delete"), function() { mediaModel.remove(idx) } )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
add: Transition {
|
|
|
|
NumberAnimation { property: "opacity"; from: 0; to: 1.0; duration: 800 }
|
|
|
|
}
|
|
|
|
|
|
|
|
remove: Transition {
|
|
|
|
NumberAnimation { property: "opacity"; from: 1.0; to: 0; duration: 800 }
|
|
|
|
}
|
|
|
|
displaced: Transition {
|
|
|
|
NumberAnimation { properties: "x,y"; duration: 800; easing.type: Easing.InOutBack }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
IconButton {
|
2017-06-13 17:45:52 +03:00
|
|
|
id: btnContentWarning
|
2017-06-08 01:53:54 +03:00
|
|
|
anchors {
|
2017-06-13 17:45:52 +03:00
|
|
|
verticalCenter: privacy.verticalCenter
|
2017-06-08 01:53:54 +03:00
|
|
|
left: parent.left
|
|
|
|
leftMargin: Theme.paddingMedium
|
|
|
|
}
|
2020-01-16 00:22:18 +03:00
|
|
|
icon.source: "image://theme/icon-s-warning?" + (pressed
|
2020-01-25 00:00:04 +03:00
|
|
|
? Theme.highlightColor
|
|
|
|
: (warningContent.visible ? Theme.secondaryHighlightColor : Theme.primaryColor))
|
2017-06-08 01:53:54 +03:00
|
|
|
onClicked: warningContent.visible = !warningContent.visible
|
|
|
|
}
|
2017-07-06 01:59:00 +03:00
|
|
|
IconButton {
|
|
|
|
id: btnAddImage
|
2017-07-06 17:15:12 +03:00
|
|
|
enabled: mediaModel.count < 4
|
2017-07-06 01:59:00 +03:00
|
|
|
anchors {
|
|
|
|
verticalCenter: privacy.verticalCenter
|
|
|
|
left: btnContentWarning.right
|
|
|
|
leftMargin: Theme.paddingSmall
|
|
|
|
}
|
|
|
|
icon.source: "image://theme/icon-s-attach?" + (pressed
|
|
|
|
? Theme.highlightColor
|
|
|
|
: (warningContent.visible ? Theme.secondaryHighlightColor : Theme.primaryColor))
|
|
|
|
onClicked: {
|
2017-07-06 12:22:12 +03:00
|
|
|
btnAddImage.enabled = false;
|
2017-07-06 01:59:00 +03:00
|
|
|
var once = true;
|
2017-07-06 12:22:12 +03:00
|
|
|
var imagePicker = pageStack.push("Sailfish.Pickers.ImagePickerPage", { "allowedOrientations" : Orientation.All });
|
2017-07-06 01:59:00 +03:00
|
|
|
imagePicker.selectedContentChanged.connect(function () {
|
2017-07-06 12:22:12 +03:00
|
|
|
var imagePath = imagePicker.selectedContent;
|
|
|
|
console.log(imagePath)
|
|
|
|
imageUploader.setUploadUrl(Logic.conf.instance + "/api/v1/media")
|
|
|
|
imageUploader.setFile(imagePath);
|
|
|
|
imageUploader.setAuthorizationHeader(Logic.conf.api_user_token);
|
|
|
|
imageUploader.upload();
|
2017-07-06 01:59:00 +03:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ImageUploader {
|
2017-10-26 17:23:16 +03:00
|
|
|
id: imageUploader
|
|
|
|
onProgressChanged: {
|
|
|
|
console.log("progress "+progress)
|
|
|
|
uploadProgress.width = parent.width*progress
|
|
|
|
}
|
|
|
|
onSuccess: {
|
|
|
|
uploadProgress.width =0
|
|
|
|
console.log(replyData);
|
|
|
|
mediaModel.append(JSON.parse(replyData))
|
|
|
|
}
|
|
|
|
onFailure: {
|
|
|
|
uploadProgress.width =0
|
|
|
|
btnAddImage.enabled = true;
|
|
|
|
console.log(status)
|
|
|
|
console.log(statusText)
|
2017-07-06 01:59:00 +03:00
|
|
|
}
|
2017-10-26 17:23:16 +03:00
|
|
|
|
|
|
|
}
|
2017-06-08 01:53:54 +03:00
|
|
|
ComboBox {
|
|
|
|
id: privacy
|
|
|
|
anchors {
|
|
|
|
top: toot.bottom
|
2020-01-25 00:00:04 +03:00
|
|
|
//topMargin: -Theme.paddingSmall*2
|
2017-07-06 01:59:00 +03:00
|
|
|
left: btnAddImage.right
|
2017-06-08 01:53:54 +03:00
|
|
|
right: btnSend.left
|
|
|
|
}
|
2020-01-25 00:00:04 +03:00
|
|
|
currentIndex: 0
|
2017-06-08 01:53:54 +03:00
|
|
|
menu: ContextMenu {
|
2020-01-25 00:00:04 +03:00
|
|
|
MenuItem { text: qsTr("Public") }
|
|
|
|
MenuItem { text: qsTr("Unlisted") }
|
|
|
|
MenuItem { text: qsTr("Followers-only") }
|
|
|
|
MenuItem { text: qsTr("Direct") }
|
2017-06-08 01:53:54 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
IconButton {
|
|
|
|
id: btnSend
|
2020-01-16 00:22:18 +03:00
|
|
|
icon.source: "image://theme/icon-m-send?" + (pressed
|
2020-01-25 00:00:04 +03:00
|
|
|
? Theme.highlightColor
|
|
|
|
: Theme.primaryColor)
|
2017-06-08 01:53:54 +03:00
|
|
|
anchors {
|
|
|
|
top: toot.bottom
|
|
|
|
right: parent.right
|
|
|
|
rightMargin: Theme.paddingLarge
|
|
|
|
}
|
2018-10-25 15:00:19 +03:00
|
|
|
enabled: toot.text !== "" && toot.text.length < tootMaxChar
|
2017-06-08 01:53:54 +03:00
|
|
|
onClicked: {
|
2020-01-30 00:22:19 +03:00
|
|
|
var visibility = [ "Public", "Unlisted", "Private", "Direct"];
|
2017-07-06 12:22:12 +03:00
|
|
|
var media_ids = [];
|
|
|
|
for(var k = 0; k < mediaModel.count; k++){
|
|
|
|
console.log(mediaModel.get(k).id)
|
|
|
|
media_ids.push(mediaModel.get(k).id)
|
|
|
|
}
|
|
|
|
|
2017-06-08 01:53:54 +03:00
|
|
|
var msg = {
|
|
|
|
'action' : 'statuses',
|
|
|
|
'method' : 'POST',
|
2017-06-16 17:45:04 +03:00
|
|
|
'model' : mdl,
|
2020-01-25 00:00:04 +03:00
|
|
|
'mode' : "append",
|
2017-06-08 01:53:54 +03:00
|
|
|
'params' : {
|
|
|
|
"status": toot.text,
|
2017-07-06 12:22:12 +03:00
|
|
|
"visibility": visibility[privacy.currentIndex],
|
|
|
|
"media_ids": media_ids
|
2017-06-08 01:53:54 +03:00
|
|
|
},
|
|
|
|
'conf' : Logic.conf
|
|
|
|
};
|
2017-11-01 18:57:09 +03:00
|
|
|
if (toot_id)
|
|
|
|
msg.params['in_reply_to_id'] = (toot_id)+""
|
2017-06-08 01:53:54 +03:00
|
|
|
|
|
|
|
if (warningContent.visible && warningContent.text.length > 0){
|
|
|
|
msg.params['sensitive'] = 1
|
|
|
|
msg.params['spoiler_text'] = warningContent.text
|
|
|
|
}
|
|
|
|
|
2017-06-15 01:48:53 +03:00
|
|
|
worker.sendMessage(msg);
|
2017-06-09 17:56:16 +03:00
|
|
|
warningContent.text = ""
|
|
|
|
toot.text = ""
|
2017-07-20 16:26:20 +03:00
|
|
|
mediaModel.clear()
|
2017-06-08 01:53:54 +03:00
|
|
|
}
|
|
|
|
}
|
2017-07-06 17:15:12 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: uploadProgress
|
|
|
|
color: Theme.highlightBackgroundColor
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.left: parent.left
|
|
|
|
height: 3
|
|
|
|
}
|
2017-06-08 01:53:54 +03:00
|
|
|
}
|
2017-06-14 17:42:28 +03:00
|
|
|
Component.onCompleted: {
|
|
|
|
toot.cursorPosition = toot.text.length
|
2017-10-19 11:42:40 +03:00
|
|
|
if (mdl.count > 0) {
|
|
|
|
var setIndex = 0;
|
|
|
|
switch (mdl.get(0).status_visibility){
|
2017-10-26 17:23:16 +03:00
|
|
|
case "unlisted":
|
|
|
|
setIndex = 1;
|
|
|
|
break;
|
|
|
|
case "private":
|
|
|
|
setIndex = 2;
|
|
|
|
break;
|
|
|
|
case "direct":
|
|
|
|
privacy.enabled = false;
|
|
|
|
setIndex = 3;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
privacy.enabled = true;
|
|
|
|
setIndex = 0;
|
2017-10-19 11:42:40 +03:00
|
|
|
}
|
|
|
|
privacy.currentIndex = setIndex;
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(JSON.stringify())
|
|
|
|
|
2017-06-15 17:03:20 +03:00
|
|
|
worker.sendMessage({
|
2018-10-26 13:14:06 +03:00
|
|
|
'action' : 'statuses/'+mdl.get(0).status_id+'/context',
|
2017-06-15 17:03:20 +03:00
|
|
|
'method' : 'GET',
|
|
|
|
'model' : mdl,
|
|
|
|
'params' : { },
|
|
|
|
'conf' : Logic.conf
|
|
|
|
});
|
2017-06-14 17:42:28 +03:00
|
|
|
}
|
2017-07-06 17:15:12 +03:00
|
|
|
Component {
|
|
|
|
id: firstWizardPage
|
|
|
|
|
|
|
|
Dialog {
|
|
|
|
id: emoticonsDialog
|
|
|
|
canAccept: false; //selector.currentIndex >= 0
|
|
|
|
//acceptDestination: conversationPage
|
|
|
|
onAcceptPendingChanged: {
|
|
|
|
if (acceptPending) {
|
|
|
|
// Tell the destination page what the selected category is
|
2017-10-26 17:23:16 +03:00
|
|
|
// acceptDestinationInstance.category = selector.value
|
2017-07-06 17:15:12 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SilicaGridView {
|
|
|
|
id: gridView
|
|
|
|
anchors.fill: parent
|
|
|
|
cellWidth: gridView.width / 6
|
|
|
|
cellHeight: cellWidth
|
|
|
|
header: PageHeader {
|
|
|
|
title: qsTr("Emojis")
|
|
|
|
description: qsTr("Tap to insert")
|
|
|
|
}
|
|
|
|
model: ListModel {
|
|
|
|
ListElement { section: "smileys"; glyph: "😁" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😂" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😃" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😄" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😅" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😆" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😉" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😊" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😋" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😌" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😍" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😏" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😒" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😓" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😔" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😖" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😘" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😚" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😜" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😝" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😞" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😠" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😡" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😢" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😣" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😤" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😥" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😨" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😩" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😪" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😫" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😭" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😰" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😱" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😲" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😳" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😵" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😷" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😸" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😹" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😺" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😻" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😼" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😽" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😾" }
|
|
|
|
ListElement { section: "smileys"; glyph: "😿" }
|
|
|
|
ListElement { section: "smileys"; glyph: "🙀" }
|
|
|
|
ListElement { section: "smileys"; glyph: "🙅" }
|
|
|
|
ListElement { section: "smileys"; glyph: "🙆" }
|
|
|
|
ListElement { section: "smileys"; glyph: "🙇" }
|
|
|
|
ListElement { section: "smileys"; glyph: "🙈" }
|
|
|
|
ListElement { section: "smileys"; glyph: "🙉" }
|
|
|
|
ListElement { section: "smileys"; glyph: "🙊" }
|
|
|
|
ListElement { section: "smileys"; glyph: "🙋" }
|
|
|
|
ListElement { section: "smileys"; glyph: "🙌" }
|
|
|
|
ListElement { section: "smileys"; glyph: "🙍" }
|
|
|
|
ListElement { section: "smileys"; glyph: "🙎" }
|
|
|
|
ListElement { section: "smileys"; glyph: "🙏" }
|
|
|
|
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚀" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚃" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚀" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚄" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚅" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚇" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚉" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚌" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚏" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚑" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚒" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚓" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚕" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚗" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚙" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚚" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚢" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚨" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚩" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚪" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚫" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚬" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚭" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚲" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚶" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚹" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚺" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚻" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚼" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚽" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🚾" }
|
|
|
|
ListElement { section: "Transport and map"; glyph: "🛀" }
|
|
|
|
|
|
|
|
ListElement { section: "Horoscope Signs"; glyph: "♈" }
|
|
|
|
ListElement { section: "Horoscope Signs"; glyph: "♉" }
|
|
|
|
ListElement { section: "Horoscope Signs"; glyph: "♊" }
|
|
|
|
ListElement { section: "Horoscope Signs"; glyph: "♋" }
|
|
|
|
ListElement { section: "Horoscope Signs"; glyph: "♌" }
|
|
|
|
ListElement { section: "Horoscope Signs"; glyph: "♍" }
|
|
|
|
ListElement { section: "Horoscope Signs"; glyph: "♎" }
|
|
|
|
ListElement { section: "Horoscope Signs"; glyph: "♏" }
|
|
|
|
ListElement { section: "Horoscope Signs"; glyph: "♐" }
|
|
|
|
ListElement { section: "Horoscope Signs"; glyph: "♑" }
|
|
|
|
ListElement { section: "Horoscope Signs"; glyph: "♒" }
|
|
|
|
ListElement { section: "Horoscope Signs"; glyph: "♓" }
|
|
|
|
|
|
|
|
}
|
|
|
|
delegate: BackgroundItem {
|
|
|
|
width: gridView.cellWidth
|
|
|
|
height: gridView.cellHeight
|
|
|
|
Label {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
color: (highlighted ? Theme.secondaryHighlightColor : Theme.secondaryColor)
|
|
|
|
font.pixelSize: Theme.fontSizeLarge
|
|
|
|
text: glyph
|
|
|
|
}
|
|
|
|
onClicked: {
|
2017-10-27 17:44:35 +03:00
|
|
|
var cursorPosition = toot.cursorPosition
|
|
|
|
toot.text = toot.text.substring(0, cursorPosition) + model.glyph + toot.text.substring(cursorPosition)
|
|
|
|
toot.cursorPosition = cursorPosition+model.glyph.length
|
2017-07-06 17:15:12 +03:00
|
|
|
emoticonsDialog.canAccept = true;
|
|
|
|
emoticonsDialog.accept()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-06-08 01:53:54 +03:00
|
|
|
}
|