harbour-tooter/qml/pages/components/EmojiSelect.qml

272 lines
16 KiB
QML
Raw Normal View History

import QtQuick 2.0
import Sailfish.Silica 1.0
2020-06-29 11:48:06 +03:00
Dialog {
id: emojiDialog
allowedOrientations: Orientation.All
canAccept: false //selector.currentIndex >= 0
onAcceptPendingChanged: {
if (acceptPending) {
// Tell the destination page what the selected category is
// acceptDestinationInstance.category = selector.value
}
2020-06-29 11:48:06 +03:00
}
2020-07-03 11:45:30 +03:00
anchors.top: parent.top
2020-06-29 11:48:06 +03:00
Column {
id: emojiColumn
spacing: Theme.paddingLarge
width: parent.width
height: parent.height
2020-07-03 11:45:30 +03:00
VerticalScrollDecorator { flickable: gridView}
SilicaGridView {
id: gridView
header: PageHeader {
title: qsTr("Emojis")
description: qsTr("Tap to insert")
}
2020-06-29 11:48:06 +03:00
cellWidth: isPortrait ? gridView.width / 6 : gridView.width / 10
cellHeight: cellWidth
2020-06-29 11:48:06 +03:00
width: parent.width
height: parent.height
model: ListModel {
2020-07-03 11:45:30 +03:00
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: "Cat Faces"; glyph: "😺" }
ListElement { section: "Cat Faces"; glyph: "😸" }
ListElement { section: "Cat Faces"; glyph: "😻" }
ListElement { section: "Cat Faces"; glyph: "😽" }
ListElement { section: "Cat Faces"; glyph: "😼" }
ListElement { section: "Cat Faces"; glyph: "🙀" }
ListElement { section: "Cat Faces"; glyph: "😿" }
ListElement { section: "Cat Faces"; glyph: "😹" }
ListElement { section: "Cat Faces"; glyph: "😾" }
2020-07-03 11:45:30 +03:00
ListElement { section: "Other Faces"; glyph: "👹" }
ListElement { section: "Other Faces"; glyph: "👺" }
ListElement { section: "Other Faces"; glyph: "🙈" }
ListElement { section: "Other Faces"; glyph: "🙉" }
ListElement { section: "Other Faces"; glyph: "🙊" }
ListElement { section: "Other Faces"; glyph: "💀" }
ListElement { section: "Other Faces"; glyph: "👽" }
ListElement { section: "Misc Emoji"; glyph: "🔥" }
ListElement { section: "Misc Emoji"; glyph: "✨" }
ListElement { section: "Misc Emoji"; glyph: "🌟" }
ListElement { section: "Misc Emoji"; glyph: "💫" }
ListElement { section: "Misc Emoji"; glyph: "💥" }
ListElement { section: "Misc Emoji"; glyph: "💢" }
ListElement { section: "Misc Emoji"; glyph: "💦" }
ListElement { section: "Misc Emoji"; glyph: "💧" }
ListElement { section: "Misc Emoji"; glyph: "💤" }
ListElement { section: "Misc Emoji"; glyph: "💨" }
ListElement { section: "Misc Emoji"; glyph: "👂" }
ListElement { section: "Misc Emoji"; glyph: "👀" }
ListElement { section: "Misc Emoji"; glyph: "👃" }
ListElement { section: "Misc Emoji"; glyph: "👅" }
ListElement { section: "Misc Emoji"; glyph: "👄" }
ListElement { section: "Misc Emoji"; glyph: "👍" }
ListElement { section: "Misc Emoji"; glyph: "👎" }
ListElement { section: "Misc Emoji"; glyph: "👌" }
ListElement { section: "Misc Emoji"; glyph: "👊" }
ListElement { section: "Misc Emoji"; glyph: "✊" }
ListElement { section: "Misc Emoji"; glyph: "✌" }
ListElement { section: "Misc Emoji"; glyph: "👋" }
ListElement { section: "Misc Emoji"; glyph: "✋" }
ListElement { section: "Misc Emoji"; glyph: "👐" }
ListElement { section: "Misc Emoji"; glyph: "👆" }
ListElement { section: "Misc Emoji"; glyph: "👇" }
ListElement { section: "Misc Emoji"; glyph: "👉" }
ListElement { section: "Misc Emoji"; glyph: "👈" }
ListElement { section: "Misc Emoji"; glyph: "🙌" }
ListElement { section: "Misc Emoji"; glyph: "🙏" }
ListElement { section: "Misc Emoji"; glyph: "☝" }
ListElement { section: "Misc Emoji"; glyph: "👏" }
ListElement { section: "Misc Emoji"; glyph: "💪" }
ListElement { section: "Animals Emoji"; glyph: "🐶" }
ListElement { section: "Animals Emoji"; glyph: "🐺" }
ListElement { section: "Animals Emoji"; glyph: "🐱" }
ListElement { section: "Animals Emoji"; glyph: "🐭" }
ListElement { section: "Animals Emoji"; glyph: "🐹" }
ListElement { section: "Animals Emoji"; glyph: "🐰" }
ListElement { section: "Animals Emoji"; glyph: "🐸" }
ListElement { section: "Animals Emoji"; glyph: "🐯" }
ListElement { section: "Animals Emoji"; glyph: "🐨" }
ListElement { section: "Animals Emoji"; glyph: "🐘" }
ListElement { section: "Animals Emoji"; glyph: "🐼" }
ListElement { section: "Animals Emoji"; glyph: "🐧" }
ListElement { section: "Animals Emoji"; glyph: "🐦" }
ListElement { section: "Animals Emoji"; glyph: "🐤" }
ListElement { section: "Animals Emoji"; glyph: "🐥" }
ListElement { section: "Animals Emoji"; glyph: "🐣" }
ListElement { section: "Animals Emoji"; glyph: "🐔" }
ListElement { section: "Animals Emoji"; glyph: "🐍" }
ListElement { section: "Animals Emoji"; glyph: "🐢" }
ListElement { section: "Animals Emoji"; glyph: "🐛" }
ListElement { section: "Animals Emoji"; glyph: "🐝" }
ListElement { section: "Animals Emoji"; glyph: "🐜" }
ListElement { section: "Animals Emoji"; glyph: "🐞" }
ListElement { section: "Animals Emoji"; glyph: "🐌" }
ListElement { section: "Animals Emoji"; glyph: "🐙" }
ListElement { section: "Animals Emoji"; glyph: "🐚" }
ListElement { section: "Animals Emoji"; glyph: "🐠" }
ListElement { section: "Animals Emoji"; glyph: "🐟" }
ListElement { section: "Animals Emoji"; glyph: "🐬" }
ListElement { section: "Animals Emoji"; glyph: "🐳" }
ListElement { section: "Animals Emoji"; glyph: "🐋" }
ListElement { section: "Animals Emoji"; glyph: "🐄" }
ListElement { section: "Animals Emoji"; glyph: "🐏" }
ListElement { section: "Animals Emoji"; glyph: "🐀" }
ListElement { section: "Animals Emoji"; glyph: "🐃" }
ListElement { section: "Animals Emoji"; glyph: "🐅" }
ListElement { section: "Animals Emoji"; glyph: "🐇" }
ListElement { section: "Animals Emoji"; glyph: "🐉" }
ListElement { section: "Animals Emoji"; glyph: "🐎" }
ListElement { section: "Animals Emoji"; glyph: "🐐" }
ListElement { section: "Animals Emoji"; glyph: "🐓" }
ListElement { section: "Animals Emoji"; glyph: "🐕" }
ListElement { section: "Animals Emoji"; glyph: "🐖" }
ListElement { section: "Animals Emoji"; glyph: "🐁" }
ListElement { section: "Animals Emoji"; glyph: "🐂" }
ListElement { section: "Animals Emoji"; glyph: "🐲" }
ListElement { section: "Animals Emoji"; glyph: "🐡" }
ListElement { section: "Animals Emoji"; glyph: "🐊" }
ListElement { section: "Animals Emoji"; glyph: "🐫" }
ListElement { section: "Animals Emoji"; glyph: "🐪" }
ListElement { section: "Animals Emoji"; glyph: "🐆" }
ListElement { section: "Animals Emoji"; glyph: "🐈" }
ListElement { section: "Animals Emoji"; glyph: "🐩" }
ListElement { section: "Animals Emoji"; 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: "♓" }
}
2020-06-29 11:48:06 +03:00
delegate: BackgroundItem {
width: gridView.cellWidth
height: gridView.cellHeight
Label {
text: glyph
font.pixelSize: Theme.fontSizeLarge
2020-07-03 11:45:30 +03:00
color: highlighted ? Theme.secondaryHighlightColor : Theme.secondaryColor
anchors.centerIn: parent
}
2020-07-03 11:45:30 +03:00
onClicked: {
var cursorPosition = toot.cursorPosition
toot.text = toot.text.substring(
0, cursorPosition) + model.glyph + toot.text.substring(
cursorPosition)
toot.cursorPosition = cursorPosition + model.glyph.length
2020-06-29 11:48:06 +03:00
emojiDialog.canAccept = true
emojiDialog.accept()
}
}
}
}
2020-06-10 12:44:58 +03:00
}