diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2026-09-02 18:26:45 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2026-09-02 18:26:45 +0800 |
| commit | f7a43077fe4e139dd7e3f46f448e0951740ec148 (patch) | |
| tree | f6a68248fe42bd899e99049bab7fdb7e5d26ea60 /services/Emoji.qml | |
| parent | 2f7576faf493b4667b02dcb60ddbf3aa0a9f654b (diff) | |
fix: qmlfmt
IListView: animation
Diffstat (limited to 'services/Emoji.qml')
| -rw-r--r-- | services/Emoji.qml | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/services/Emoji.qml b/services/Emoji.qml index 108fbd9..697840b 100644 --- a/services/Emoji.qml +++ b/services/Emoji.qml @@ -6,49 +6,49 @@ import QtQuick import qs.components Searchable { - id: root - - property var _emojis: [] - property var _emojiFile: FileView { - path: "/usr/share/rofi-emoji/all_emojis.txt" - onTextChanged: _parseEmojis() - } - - list: _emojis - keys: ["name", "keywords", "category", "subcategory", "emoji"] - algorithm: Searchable.SearchAlgorithm.Include - - function transformSearch(search) { - return search.toLowerCase(); - } - - function _parseEmojis() { - const text = _emojiFile.text(); - if (!text) { - console.warn("Emoji service: failed to load", _emojiFile.path); - _emojis = []; - return; - } - - const lines = text.split("\n").filter(l => l.trim()); - const out = []; - for (let i = 0; i < lines.length; ++i) { - const parts = lines[i].split("\t"); - if (parts.length < 5) - continue; - const [emoji, category, subcategory, name, keywords] = parts; - out.push({ - emoji: emoji, - category: category, - subcategory: subcategory, - name: name, - keywords: keywords - }); - } - _emojis = out; - } - - function copy(emoji) { - Clip.copy(emoji); - } + id: root + + property var _emojis: [] + property var _emojiFile: FileView { + path: "/usr/share/rofi-emoji/all_emojis.txt" + onTextChanged: _parseEmojis() + } + + list: _emojis + keys: ["name", "keywords", "category", "subcategory", "emoji"] + algorithm: Searchable.SearchAlgorithm.Include + + function transformSearch(search) { + return search.toLowerCase(); + } + + function _parseEmojis() { + const text = _emojiFile.text(); + if (!text) { + console.warn("Emoji service: failed to load", _emojiFile.path); + _emojis = []; + return; + } + + const lines = text.split("\n").filter(l => l.trim()); + const out = []; + for (let i = 0; i < lines.length; ++i) { + const parts = lines[i].split("\t"); + if (parts.length < 5) + continue; + const [emoji, category, subcategory, name, keywords] = parts; + out.push({ + emoji: emoji, + category: category, + subcategory: subcategory, + name: name, + keywords: keywords + }); + } + _emojis = out; + } + + function copy(emoji) { + Clip.copy(emoji); + } } |
