mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-12-04 16:18:48 +03:00
Update emoji picker and translations
This commit is contained in:
parent
dfb76c693d
commit
ff7468e6d5
20 changed files with 246 additions and 136 deletions
BIN
resources/icons/emoji-categories/search.png
Normal file
BIN
resources/icons/emoji-categories/search.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 573 B |
BIN
resources/icons/emoji-categories/search@2x.png
Normal file
BIN
resources/icons/emoji-categories/search@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
resources/icons/ui/search.png
Normal file
BIN
resources/icons/ui/search.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 573 B |
BIN
resources/icons/ui/search@2x.png
Normal file
BIN
resources/icons/ui/search@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
|
@ -189,13 +189,13 @@
|
||||||
<context>
|
<context>
|
||||||
<name>EmojiPicker</name>
|
<name>EmojiPicker</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/emoji/EmojiPicker.qml" line="+33"/>
|
<location filename="../qml/emoji/EmojiPicker.qml" line="+104"/>
|
||||||
<location line="+133"/>
|
<location line="+135"/>
|
||||||
<source>Search</source>
|
<source>Search</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-16"/>
|
<location line="-42"/>
|
||||||
<source>People</source>
|
<source>People</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -751,7 +751,7 @@
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+15"/>
|
<location line="+16"/>
|
||||||
<source>Reply</source>
|
<source>Reply</source>
|
||||||
<translation>Antworten</translation>
|
<translation>Antworten</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -764,7 +764,7 @@
|
||||||
<context>
|
<context>
|
||||||
<name>TimelineView</name>
|
<name>TimelineView</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/TimelineView.qml" line="+52"/>
|
<location filename="../qml/TimelineView.qml" line="+65"/>
|
||||||
<source>React</source>
|
<source>React</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -189,13 +189,13 @@
|
||||||
<context>
|
<context>
|
||||||
<name>EmojiPicker</name>
|
<name>EmojiPicker</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/emoji/EmojiPicker.qml" line="+33"/>
|
<location filename="../qml/emoji/EmojiPicker.qml" line="+104"/>
|
||||||
<location line="+133"/>
|
<location line="+135"/>
|
||||||
<source>Search</source>
|
<source>Search</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-16"/>
|
<location line="-42"/>
|
||||||
<source>People</source>
|
<source>People</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -751,7 +751,7 @@
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+15"/>
|
<location line="+16"/>
|
||||||
<source>Reply</source>
|
<source>Reply</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -764,7 +764,7 @@
|
||||||
<context>
|
<context>
|
||||||
<name>TimelineView</name>
|
<name>TimelineView</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/TimelineView.qml" line="+52"/>
|
<location filename="../qml/TimelineView.qml" line="+65"/>
|
||||||
<source>React</source>
|
<source>React</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -189,13 +189,13 @@
|
||||||
<context>
|
<context>
|
||||||
<name>EmojiPicker</name>
|
<name>EmojiPicker</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/emoji/EmojiPicker.qml" line="+33"/>
|
<location filename="../qml/emoji/EmojiPicker.qml" line="+104"/>
|
||||||
<location line="+133"/>
|
<location line="+135"/>
|
||||||
<source>Search</source>
|
<source>Search</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-16"/>
|
<location line="-42"/>
|
||||||
<source>People</source>
|
<source>People</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -751,7 +751,7 @@
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+15"/>
|
<location line="+16"/>
|
||||||
<source>Reply</source>
|
<source>Reply</source>
|
||||||
<translation>Reply</translation>
|
<translation>Reply</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -764,7 +764,7 @@
|
||||||
<context>
|
<context>
|
||||||
<name>TimelineView</name>
|
<name>TimelineView</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/TimelineView.qml" line="+52"/>
|
<location filename="../qml/TimelineView.qml" line="+65"/>
|
||||||
<source>React</source>
|
<source>React</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -189,13 +189,13 @@
|
||||||
<context>
|
<context>
|
||||||
<name>EmojiPicker</name>
|
<name>EmojiPicker</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/emoji/EmojiPicker.qml" line="+33"/>
|
<location filename="../qml/emoji/EmojiPicker.qml" line="+104"/>
|
||||||
<location line="+133"/>
|
<location line="+135"/>
|
||||||
<source>Search</source>
|
<source>Search</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-16"/>
|
<location line="-42"/>
|
||||||
<source>People</source>
|
<source>People</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -751,7 +751,7 @@
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+15"/>
|
<location line="+16"/>
|
||||||
<source>Reply</source>
|
<source>Reply</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -764,7 +764,7 @@
|
||||||
<context>
|
<context>
|
||||||
<name>TimelineView</name>
|
<name>TimelineView</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/TimelineView.qml" line="+52"/>
|
<location filename="../qml/TimelineView.qml" line="+65"/>
|
||||||
<source>React</source>
|
<source>React</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -189,13 +189,13 @@
|
||||||
<context>
|
<context>
|
||||||
<name>EmojiPicker</name>
|
<name>EmojiPicker</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/emoji/EmojiPicker.qml" line="+33"/>
|
<location filename="../qml/emoji/EmojiPicker.qml" line="+104"/>
|
||||||
<location line="+133"/>
|
<location line="+135"/>
|
||||||
<source>Search</source>
|
<source>Search</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-16"/>
|
<location line="-42"/>
|
||||||
<source>People</source>
|
<source>People</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -752,7 +752,7 @@
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+15"/>
|
<location line="+16"/>
|
||||||
<source>Reply</source>
|
<source>Reply</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -765,7 +765,7 @@
|
||||||
<context>
|
<context>
|
||||||
<name>TimelineView</name>
|
<name>TimelineView</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/TimelineView.qml" line="+52"/>
|
<location filename="../qml/TimelineView.qml" line="+65"/>
|
||||||
<source>React</source>
|
<source>React</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -189,13 +189,13 @@
|
||||||
<context>
|
<context>
|
||||||
<name>EmojiPicker</name>
|
<name>EmojiPicker</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/emoji/EmojiPicker.qml" line="+33"/>
|
<location filename="../qml/emoji/EmojiPicker.qml" line="+104"/>
|
||||||
<location line="+133"/>
|
<location line="+135"/>
|
||||||
<source>Search</source>
|
<source>Search</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-16"/>
|
<location line="-42"/>
|
||||||
<source>People</source>
|
<source>People</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -750,7 +750,7 @@
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+15"/>
|
<location line="+16"/>
|
||||||
<source>Reply</source>
|
<source>Reply</source>
|
||||||
<translation>返信</translation>
|
<translation>返信</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -763,7 +763,7 @@
|
||||||
<context>
|
<context>
|
||||||
<name>TimelineView</name>
|
<name>TimelineView</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/TimelineView.qml" line="+52"/>
|
<location filename="../qml/TimelineView.qml" line="+65"/>
|
||||||
<source>React</source>
|
<source>React</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -189,13 +189,13 @@
|
||||||
<context>
|
<context>
|
||||||
<name>EmojiPicker</name>
|
<name>EmojiPicker</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/emoji/EmojiPicker.qml" line="+33"/>
|
<location filename="../qml/emoji/EmojiPicker.qml" line="+104"/>
|
||||||
<location line="+133"/>
|
<location line="+135"/>
|
||||||
<source>Search</source>
|
<source>Search</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-16"/>
|
<location line="-42"/>
|
||||||
<source>People</source>
|
<source>People</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -751,7 +751,7 @@
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+15"/>
|
<location line="+16"/>
|
||||||
<source>Reply</source>
|
<source>Reply</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -764,7 +764,7 @@
|
||||||
<context>
|
<context>
|
||||||
<name>TimelineView</name>
|
<name>TimelineView</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/TimelineView.qml" line="+52"/>
|
<location filename="../qml/TimelineView.qml" line="+65"/>
|
||||||
<source>React</source>
|
<source>React</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -189,13 +189,13 @@
|
||||||
<context>
|
<context>
|
||||||
<name>EmojiPicker</name>
|
<name>EmojiPicker</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/emoji/EmojiPicker.qml" line="+33"/>
|
<location filename="../qml/emoji/EmojiPicker.qml" line="+104"/>
|
||||||
<location line="+133"/>
|
<location line="+135"/>
|
||||||
<source>Search</source>
|
<source>Search</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-16"/>
|
<location line="-42"/>
|
||||||
<source>People</source>
|
<source>People</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -752,7 +752,7 @@
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+15"/>
|
<location line="+16"/>
|
||||||
<source>Reply</source>
|
<source>Reply</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -765,7 +765,7 @@
|
||||||
<context>
|
<context>
|
||||||
<name>TimelineView</name>
|
<name>TimelineView</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/TimelineView.qml" line="+52"/>
|
<location filename="../qml/TimelineView.qml" line="+65"/>
|
||||||
<source>React</source>
|
<source>React</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -189,13 +189,13 @@
|
||||||
<context>
|
<context>
|
||||||
<name>EmojiPicker</name>
|
<name>EmojiPicker</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/emoji/EmojiPicker.qml" line="+33"/>
|
<location filename="../qml/emoji/EmojiPicker.qml" line="+104"/>
|
||||||
<location line="+133"/>
|
<location line="+135"/>
|
||||||
<source>Search</source>
|
<source>Search</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-16"/>
|
<location line="-42"/>
|
||||||
<source>People</source>
|
<source>People</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -752,7 +752,7 @@
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+15"/>
|
<location line="+16"/>
|
||||||
<source>Reply</source>
|
<source>Reply</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -765,7 +765,7 @@
|
||||||
<context>
|
<context>
|
||||||
<name>TimelineView</name>
|
<name>TimelineView</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/TimelineView.qml" line="+52"/>
|
<location filename="../qml/TimelineView.qml" line="+65"/>
|
||||||
<source>React</source>
|
<source>React</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -189,13 +189,13 @@
|
||||||
<context>
|
<context>
|
||||||
<name>EmojiPicker</name>
|
<name>EmojiPicker</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/emoji/EmojiPicker.qml" line="+33"/>
|
<location filename="../qml/emoji/EmojiPicker.qml" line="+104"/>
|
||||||
<location line="+133"/>
|
<location line="+135"/>
|
||||||
<source>Search</source>
|
<source>Search</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-16"/>
|
<location line="-42"/>
|
||||||
<source>People</source>
|
<source>People</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -750,7 +750,7 @@
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+15"/>
|
<location line="+16"/>
|
||||||
<source>Reply</source>
|
<source>Reply</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -763,7 +763,7 @@
|
||||||
<context>
|
<context>
|
||||||
<name>TimelineView</name>
|
<name>TimelineView</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../qml/TimelineView.qml" line="+52"/>
|
<location filename="../qml/TimelineView.qml" line="+65"/>
|
||||||
<source>React</source>
|
<source>React</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -81,6 +81,7 @@ MouseArea {
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
ToolTip.visible: hovered
|
ToolTip.visible: hovered
|
||||||
ToolTip.text: qsTr("React")
|
ToolTip.text: qsTr("React")
|
||||||
|
emojiPicker: emojiPopup
|
||||||
// onClicked: chat.model.reactAction(model.id)
|
// onClicked: chat.model.reactAction(model.id)
|
||||||
}
|
}
|
||||||
ImageButton {
|
ImageButton {
|
||||||
|
|
|
@ -6,8 +6,10 @@ import QtQuick.Window 2.2
|
||||||
import Qt.labs.settings 1.0
|
import Qt.labs.settings 1.0
|
||||||
|
|
||||||
import im.nheko 1.0
|
import im.nheko 1.0
|
||||||
|
import im.nheko.EmojiModel 1.0
|
||||||
|
|
||||||
import "./delegates"
|
import "./delegates"
|
||||||
|
import "./emoji"
|
||||||
|
|
||||||
Page {
|
Page {
|
||||||
property var colors: currentActivePalette
|
property var colors: currentActivePalette
|
||||||
|
@ -34,6 +36,17 @@ Page {
|
||||||
property bool buttons: true
|
property bool buttons: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EmojiPicker {
|
||||||
|
id: emojiPopup
|
||||||
|
width: 7 * 52 + 20
|
||||||
|
height: 6 * 52
|
||||||
|
colors: palette
|
||||||
|
model: EmojiProxyModel {
|
||||||
|
category: Emoji.Category.People
|
||||||
|
sourceModel: EmojiModel {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Menu {
|
Menu {
|
||||||
id: messageContextMenu
|
id: messageContextMenu
|
||||||
modal: true
|
modal: true
|
||||||
|
|
|
@ -7,21 +7,10 @@ import "../"
|
||||||
|
|
||||||
ImageButton {
|
ImageButton {
|
||||||
property var colors: currentActivePalette
|
property var colors: currentActivePalette
|
||||||
|
property var emojiPicker
|
||||||
|
|
||||||
image: ":/icons/icons/ui/smile.png"
|
image: ":/icons/icons/ui/smile.png"
|
||||||
id: emojiButton
|
id: emojiButton
|
||||||
onClicked: emojiPopup.open()
|
onClicked: emojiPicker.visible ? emojiPicker.close() : emojiPicker.show(emojiButton)
|
||||||
|
|
||||||
EmojiPicker {
|
|
||||||
id: emojiPopup
|
|
||||||
x: Math.round((emojiButton.width - width) / 2)
|
|
||||||
y: emojiButton.height
|
|
||||||
width: 7 * 52
|
|
||||||
height: 6 * 52
|
|
||||||
colors: emojiButton.colors
|
|
||||||
model: EmojiProxyModel {
|
|
||||||
category: Emoji.Category.People
|
|
||||||
sourceModel: EmojiModel {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
import QtQuick 2.9
|
import QtQuick 2.9
|
||||||
import QtQuick.Controls 2.9
|
import QtQuick.Controls 2.9
|
||||||
import QtQuick.Layouts 1.3
|
import QtQuick.Layouts 1.3
|
||||||
|
import QtGraphicalEffects 1.9
|
||||||
|
|
||||||
import im.nheko 1.0
|
import im.nheko 1.0
|
||||||
import im.nheko.EmojiModel 1.0
|
import im.nheko.EmojiModel 1.0
|
||||||
|
@ -8,6 +9,13 @@ import im.nheko.EmojiModel 1.0
|
||||||
import "../"
|
import "../"
|
||||||
|
|
||||||
Popup {
|
Popup {
|
||||||
|
|
||||||
|
function show(showAt) {
|
||||||
|
parent = showAt
|
||||||
|
x = Math.round((showAt.width - width) / 2)
|
||||||
|
y = showAt.height
|
||||||
|
open()
|
||||||
|
}
|
||||||
property var colors
|
property var colors
|
||||||
property alias model: gridView.model
|
property alias model: gridView.model
|
||||||
property var textArea
|
property var textArea
|
||||||
|
@ -16,20 +24,83 @@ Popup {
|
||||||
id: emojiPopup
|
id: emojiPopup
|
||||||
|
|
||||||
margins: 0
|
margins: 0
|
||||||
|
bottomPadding: 1
|
||||||
|
leftPadding: 1
|
||||||
|
rightPadding: 1
|
||||||
|
|
||||||
modal: true
|
modal: true
|
||||||
focus: true
|
focus: true
|
||||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
id: columnView
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
spacing: 0
|
||||||
|
Layout.bottomMargin: 0
|
||||||
|
Layout.leftMargin: 3
|
||||||
|
Layout.rightMargin: 3
|
||||||
|
Layout.topMargin: 2
|
||||||
|
|
||||||
|
// emoji grid
|
||||||
|
GridView {
|
||||||
|
id: gridView
|
||||||
|
|
||||||
|
Layout.preferredHeight: emojiPopup.height
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
Layout.leftMargin: 4
|
||||||
|
|
||||||
|
cellWidth: 52
|
||||||
|
cellHeight: 52
|
||||||
|
|
||||||
|
boundsBehavior: Flickable.DragOverBounds
|
||||||
|
|
||||||
|
clip: true
|
||||||
|
|
||||||
|
// Individual emoji
|
||||||
|
delegate: AbstractButton {
|
||||||
|
width: 48
|
||||||
|
height: 48
|
||||||
|
contentItem: Text {
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
font.family: settings.emoji_font_family
|
||||||
|
|
||||||
|
font.pixelSize: 36
|
||||||
|
text: model.unicode
|
||||||
|
}
|
||||||
|
|
||||||
|
background: Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
color: hovered ? colors.highlight : 'transparent'
|
||||||
|
radius: 5
|
||||||
|
}
|
||||||
|
|
||||||
|
hoverEnabled: true
|
||||||
|
ToolTip.text: model.shortName
|
||||||
|
ToolTip.visible: hovered
|
||||||
|
|
||||||
|
// give the emoji a little oomf
|
||||||
|
DropShadow {
|
||||||
|
width: parent.width;
|
||||||
|
height: parent.height;
|
||||||
|
horizontalOffset: 3
|
||||||
|
verticalOffset: 3
|
||||||
|
radius: 8.0
|
||||||
|
samples: 17
|
||||||
|
color: "#80000000"
|
||||||
|
source: parent.contentItem
|
||||||
|
}
|
||||||
|
// TODO: emit a signal and maybe add favorites at some point?
|
||||||
|
//onClicked: textArea.insert(textArea.cursorPosition, modelData.unicode)
|
||||||
|
}
|
||||||
|
|
||||||
// Search field
|
// Search field
|
||||||
TextField {
|
header: TextField {
|
||||||
id: emojiSearch
|
id: emojiSearch
|
||||||
Layout.alignment: Qt.AlignVCenter
|
anchors.left: parent.left
|
||||||
Layout.preferredWidth: parent.width - 4
|
anchors.right: parent.right
|
||||||
visible: emojiPopup.model.category === Emoji.Category.Search
|
anchors.rightMargin: emojiScroll.width + 4
|
||||||
placeholderText: qsTr("Search")
|
placeholderText: qsTr("Search")
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
rightPadding: clearSearch.width
|
rightPadding: clearSearch.width
|
||||||
|
@ -37,7 +108,10 @@ Popup {
|
||||||
Timer {
|
Timer {
|
||||||
id: searchTimer
|
id: searchTimer
|
||||||
interval: 350 // tweak as needed?
|
interval: 350 // tweak as needed?
|
||||||
onTriggered: emojiPopup.model.filter = emojiSearch.text
|
onTriggered: {
|
||||||
|
emojiPopup.model.filter = emojiSearch.text
|
||||||
|
emojiPopup.model.category = Emoji.Category.Search
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolButton {
|
ToolButton {
|
||||||
|
@ -58,89 +132,62 @@ Popup {
|
||||||
onVisibleChanged: if (visible) forceActiveFocus()
|
onVisibleChanged: if (visible) forceActiveFocus()
|
||||||
}
|
}
|
||||||
|
|
||||||
// emoji grid
|
ScrollBar.vertical: ScrollBar {
|
||||||
GridView {
|
id: emojiScroll
|
||||||
id: gridView
|
|
||||||
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
|
|
||||||
cellWidth: 52
|
|
||||||
cellHeight: 52
|
|
||||||
|
|
||||||
boundsBehavior: Flickable.DragOverBounds
|
|
||||||
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
// Individual emoji
|
|
||||||
delegate: AbstractButton {
|
|
||||||
width: 48
|
|
||||||
height: 48
|
|
||||||
|
|
||||||
contentItem: Text {
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
|
|
||||||
font.pointSize: 36
|
|
||||||
text: model.unicode
|
|
||||||
}
|
}
|
||||||
|
|
||||||
background: Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
color: hovered ? colors.highlight : 'transparent'
|
|
||||||
radius: 5
|
|
||||||
}
|
|
||||||
|
|
||||||
hoverEnabled: true
|
|
||||||
ToolTip.text: model.shortName
|
|
||||||
ToolTip.visible: hovered
|
|
||||||
// TODO: emit a signal and maybe add favorites at some point?
|
|
||||||
//onClicked: textArea.insert(textArea.cursorPosition, modelData.unicode)
|
|
||||||
}
|
|
||||||
|
|
||||||
ScrollBar.vertical: ScrollBar {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Separator
|
// Separator
|
||||||
Rectangle {
|
Rectangle {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: 2
|
Layout.preferredHeight: 1
|
||||||
|
|
||||||
color: emojiPopup.colors.highlight
|
color: emojiPopup.colors.dark
|
||||||
}
|
}
|
||||||
|
|
||||||
// Category picker row
|
// Category picker row
|
||||||
Row {
|
RowLayout {
|
||||||
|
Layout.bottomMargin: 0
|
||||||
|
Layout.preferredHeight: 42
|
||||||
|
implicitHeight: 42
|
||||||
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
|
||||||
|
// Display the normal categories
|
||||||
Repeater {
|
Repeater {
|
||||||
model: ListModel {
|
model: ListModel {
|
||||||
// TODO: Would like to get 'simple' icons for the categories
|
// TODO: Would like to get 'simple' icons for the categories
|
||||||
ListElement { label: "😏"; category: Emoji.Category.People }
|
ListElement { image: ":/icons/icons/emoji-categories/people.png"; category: Emoji.Category.People }
|
||||||
ListElement { label: "🌲"; category: Emoji.Category.Nature }
|
ListElement { image: ":/icons/icons/emoji-categories/nature.png"; category: Emoji.Category.Nature }
|
||||||
ListElement { label: "🍛"; category: Emoji.Category.Food }
|
ListElement { image: ":/icons/icons/emoji-categories/foods.png"; category: Emoji.Category.Food }
|
||||||
ListElement { label: "🚁"; category: Emoji.Category.Activity }
|
ListElement { image: ":/icons/icons/emoji-categories/activity.png"; category: Emoji.Category.Activity }
|
||||||
ListElement { label: "🚅"; category: Emoji.Category.Travel }
|
ListElement { image: ":/icons/icons/emoji-categories/travel.png"; category: Emoji.Category.Travel }
|
||||||
ListElement { label: "💡"; category: Emoji.Category.Objects }
|
ListElement { image: ":/icons/icons/emoji-categories/objects.png"; category: Emoji.Category.Objects }
|
||||||
ListElement { label: "🔣"; category: Emoji.Category.Symbols }
|
ListElement { image: ":/icons/icons/emoji-categories/symbols.png"; category: Emoji.Category.Symbols }
|
||||||
ListElement { label: "🏁"; category: Emoji.Category.Flags }
|
ListElement { image: ":/icons/icons/emoji-categories/flags.png"; category: Emoji.Category.Flags }
|
||||||
ListElement { label: "🔍"; category: Emoji.Category.Search }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delegate: AbstractButton {
|
delegate: AbstractButton {
|
||||||
width: 40
|
Layout.preferredWidth: 36
|
||||||
height: 40
|
Layout.preferredHeight: 36
|
||||||
|
|
||||||
contentItem: Text {
|
contentItem: Image {
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Image.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Image.AlignVCenter
|
||||||
|
fillMode: Image.Pad
|
||||||
font.pointSize: 30
|
smooth: true
|
||||||
text: model.label
|
sourceSize.width: 32
|
||||||
|
sourceSize.height: 32
|
||||||
|
source: "image://colorimage/" + model.image + "?" + (hovered ? colors.highlight : colors.buttonText)
|
||||||
}
|
}
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: emojiPopup.model.category === model.category ? colors.highlight : 'transparent'
|
property real highlightHue: colors.highlight.hslHue
|
||||||
|
property real highlightSat: colors.highlight.hslSaturation
|
||||||
|
property real highlightLight: colors.highlight.hslLightness
|
||||||
|
|
||||||
|
color: emojiPopup.model.category === model.category ? Qt.hsla(highlightHue, highlightSat, highlightLight, 0.25) : 'transparent'
|
||||||
radius: 5
|
radius: 5
|
||||||
|
border.color: emojiPopup.model.category === model.category ? colors.highlight : 'transparent'
|
||||||
}
|
}
|
||||||
|
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
@ -162,13 +209,55 @@ Popup {
|
||||||
return qsTr('Symbols');
|
return qsTr('Symbols');
|
||||||
case Emoji.Category.Flags:
|
case Emoji.Category.Flags:
|
||||||
return qsTr('Flags');
|
return qsTr('Flags');
|
||||||
case Emoji.Category.Search:
|
|
||||||
return qsTr('Search');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ToolTip.visible: hovered
|
ToolTip.visible: hovered
|
||||||
|
|
||||||
onClicked: emojiPopup.model.category = model.category
|
onClicked: {
|
||||||
|
emojiPopup.model.category = model.category
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Separator
|
||||||
|
Rectangle {
|
||||||
|
Layout.fillHeight: true
|
||||||
|
Layout.preferredWidth: 1
|
||||||
|
implicitWidth: 1
|
||||||
|
height: parent.height
|
||||||
|
|
||||||
|
color: emojiPopup.colors.dark
|
||||||
|
}
|
||||||
|
|
||||||
|
// Search Button is special
|
||||||
|
AbstractButton {
|
||||||
|
id: searchBtn
|
||||||
|
hoverEnabled: true
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
Layout.bottomMargin: 0
|
||||||
|
|
||||||
|
ToolTip.text: qsTr("Search")
|
||||||
|
ToolTip.visible: hovered
|
||||||
|
onClicked: {
|
||||||
|
// clear any filters
|
||||||
|
emojiPopup.model.category = Emoji.Category.Search
|
||||||
|
gridView.positionViewAtBeginning()
|
||||||
|
emojiSearch.forceActiveFocus()
|
||||||
|
}
|
||||||
|
Layout.preferredWidth: 36
|
||||||
|
Layout.preferredHeight: 36
|
||||||
|
implicitWidth: 36
|
||||||
|
implicitHeight: 36
|
||||||
|
|
||||||
|
contentItem: Image {
|
||||||
|
anchors.right: parent.right
|
||||||
|
horizontalAlignment: Image.AlignHCenter
|
||||||
|
verticalAlignment: Image.AlignVCenter
|
||||||
|
fillMode: Image.Pad
|
||||||
|
smooth: true
|
||||||
|
sourceSize.width: 32
|
||||||
|
sourceSize.height: 32
|
||||||
|
source: "image://colorimage/:/icons/icons/ui/search.png?" + (parent.hovered ? colors.highlight : colors.buttonText)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
<file>icons/ui/checkmark@2x.png</file>
|
<file>icons/ui/checkmark@2x.png</file>
|
||||||
<file>icons/ui/cursor.png</file>
|
<file>icons/ui/cursor.png</file>
|
||||||
<file>icons/ui/cursor@2x.png</file>
|
<file>icons/ui/cursor@2x.png</file>
|
||||||
|
<file>icons/ui/search.png</file>
|
||||||
|
<file>icons/ui/search@2x.png</file>
|
||||||
<file>icons/ui/settings.png</file>
|
<file>icons/ui/settings.png</file>
|
||||||
<file>icons/ui/settings@2x.png</file>
|
<file>icons/ui/settings@2x.png</file>
|
||||||
<file>icons/ui/smile.png</file>
|
<file>icons/ui/smile.png</file>
|
||||||
|
|
|
@ -9,19 +9,35 @@ set -eu
|
||||||
INPUT=$1
|
INPUT=$1
|
||||||
OUTPUT=nheko
|
OUTPUT=nheko
|
||||||
|
|
||||||
|
filename=$(basename -- "$1")
|
||||||
|
extension="${filename##*.}"
|
||||||
|
|
||||||
mkdir ${OUTPUT}.iconset
|
mkdir ${OUTPUT}.iconset
|
||||||
|
|
||||||
sips -z 16 16 "${INPUT}" --out ${OUTPUT}.iconset/icon_16x16.png
|
if [ extension = "svg" ]; then
|
||||||
sips -z 32 32 "${INPUT}" --out ${OUTPUT}.iconset/icon_16x16@2x.png
|
rsvg-convert -h 16 "${INPUT}" > ${OUTPUT}.iconset/icon_16x16.png
|
||||||
sips -z 32 32 "${INPUT}" --out ${OUTPUT}.iconset/icon_32x32.png
|
rsvg-convert -h 32 "${INPUT}" > ${OUTPUT}.iconset/icon_16x16@2x.png
|
||||||
sips -z 64 64 "${INPUT}" --out ${OUTPUT}.iconset/icon_32x32@2x.png
|
rsvg-convert -h 32 "${INPUT}" > ${OUTPUT}.iconset/icon_32x32.png
|
||||||
sips -z 128 128 "${INPUT}" --out ${OUTPUT}.iconset/icon_128x128.png
|
rsvg-convert -h 64 "${INPUT}" > ${OUTPUT}.iconset/icon_32x32@2x.png
|
||||||
sips -z 256 256 "${INPUT}" --out ${OUTPUT}.iconset/icon_128x128@2x.png
|
rsvg-convert -h 128 "${INPUT}" > ${OUTPUT}.iconset/icon_128x128.png
|
||||||
sips -z 256 256 "${INPUT}" --out ${OUTPUT}.iconset/icon_256x256.png
|
rsvg-convert -h 256 "${INPUT}" > ${OUTPUT}.iconset/icon_128x128@2x.png
|
||||||
sips -z 512 512 "${INPUT}" --out ${OUTPUT}.iconset/icon_256x256@2x.png
|
rsvg-convert -h 256 "${INPUT}" > ${OUTPUT}.iconset/icon_256x256.png
|
||||||
sips -z 512 512 "${INPUT}" --out ${OUTPUT}.iconset/icon_512x512.png
|
rsvg-convert -h 512 "${INPUT}" > ${OUTPUT}.iconset/icon_256x256@2x.png
|
||||||
|
rsvg-convert -h 512 "${INPUT}" > ${OUTPUT}.iconset/icon_512x512.png
|
||||||
|
rsvg-convert -h 1024 "${INPUT}" > ${OUTPUT}.iconset/icon_512x512@2x.png
|
||||||
|
else
|
||||||
|
sips -z 16 16 "${INPUT}" --out ${OUTPUT}.iconset/icon_16x16.png
|
||||||
|
sips -z 32 32 "${INPUT}" --out ${OUTPUT}.iconset/icon_16x16@2x.png
|
||||||
|
sips -z 32 32 "${INPUT}" --out ${OUTPUT}.iconset/icon_32x32.png
|
||||||
|
sips -z 64 64 "${INPUT}" --out ${OUTPUT}.iconset/icon_32x32@2x.png
|
||||||
|
sips -z 128 128 "${INPUT}" --out ${OUTPUT}.iconset/icon_128x128.png
|
||||||
|
sips -z 256 256 "${INPUT}" --out ${OUTPUT}.iconset/icon_128x128@2x.png
|
||||||
|
sips -z 256 256 "${INPUT}" --out ${OUTPUT}.iconset/icon_256x256.png
|
||||||
|
sips -z 512 512 "${INPUT}" --out ${OUTPUT}.iconset/icon_256x256@2x.png
|
||||||
|
sips -z 512 512 "${INPUT}" --out ${OUTPUT}.iconset/icon_512x512.png
|
||||||
|
|
||||||
cp "${INPUT}" ${OUTPUT}.iconset/icon_512x512@2x.png
|
cp "${INPUT}" ${OUTPUT}.iconset/icon_512x512@2x.png
|
||||||
|
fi
|
||||||
|
|
||||||
iconutil -c icns ${OUTPUT}.iconset
|
iconutil -c icns ${OUTPUT}.iconset
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue