Changeset View
Changeset View
Standalone View
Standalone View
applets/kimpanel/backend/ibus/emojier/ui/CategoryAction.qml
Show All 15 Lines | |||||
16 | * | 16 | * | ||
17 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import org.kde.kirigami 2.6 as Kirigami | 21 | import org.kde.kirigami 2.6 as Kirigami | ||
22 | 22 | | |||
23 | Kirigami.Action { | 23 | Kirigami.Action { | ||
24 | function getIcon(category) { | ||||
25 | switch (category.trim()) { | ||||
26 | case 'Activities': return 'games-highscores' | ||||
27 | case 'Animals & Nature': return 'animal' | ||||
28 | case 'Flags': return 'flag' | ||||
29 | case 'Food & Drink': return 'food' | ||||
30 | case 'Objects': return 'object' | ||||
31 | case 'Smileys & People': return 'smiley' | ||||
32 | case 'Symbols': return 'love' | ||||
33 | case 'Travel & Places': return 'globe' | ||||
34 | default: return 'folder' | ||||
35 | } | ||||
36 | } | ||||
37 | | ||||
24 | property string category | 38 | property string category | ||
25 | checked: window.pageStack.get(0).title === text | 39 | checked: window.pageStack.get(0).title === text | ||
26 | text: i18nd("ibus10", category) //Get the translation of emoji categories from ibus10.mo installed by ibus | 40 | text: i18nd("ibus10", category) //Get the translation of emoji categories from ibus10.mo installed by ibus | ||
27 | 41 | | |||
28 | icon.name: "image://text/" + emoji.findFirstEmojiForCategory(category) | 42 | icon.name: getIcon(category) | ||
29 | onTriggered: { | 43 | onTriggered: { | ||
30 | window.pageStack.replace("qrc:/ui/CategoryPage.qml", {title: text, category: category, model: emoji }) | 44 | window.pageStack.replace("qrc:/ui/CategoryPage.qml", {title: text, category: category, model: emoji }) | ||
31 | } | 45 | } | ||
32 | } | 46 | } |