Changeset View
Changeset View
Standalone View
Standalone View
applets/kimpanel/package/contents/ui/StatusPanel.qml
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2019 Guo Yunhe <i@guoyunhe.me> | ||||
3 | * | ||||
4 | * This program is free software; you can redistribute it and/or modify | ||||
5 | * it under the terms of the GNU General Public License as published by | ||||
6 | * the Free Software Foundation; either version 2 of the License, or | ||||
7 | * (at your option) any later version. | ||||
8 | * | ||||
9 | * This program is distributed in the hope that it will be useful, | ||||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
12 | * GNU General Public License for more details. | ||||
13 | * | ||||
14 | * You should have received a copy of the GNU General Public License | ||||
15 | * along with this program; if not, write to the Free Software | ||||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | ||||
17 | */ | ||||
18 | | ||||
19 | import QtQuick 2.6 | ||||
20 | import QtQuick.Layouts 1.1 | ||||
21 | import org.kde.plasma.plasmoid 2.0 | ||||
22 | import org.kde.plasma.core 2.0 as PlasmaCore | ||||
23 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||||
24 | import org.kde.plasma.extras 2.0 as PlasmaExtras | ||||
25 | import org.kde.plasma.private.kimpanel 0.1 as Kimpanel | ||||
26 | | ||||
27 | // Expanded view after clicking the icon | ||||
28 | Column { | ||||
29 | anchors.fill: parent | ||||
30 | spacing: 10 | ||||
31 | | ||||
32 | // Status bar icons | ||||
33 | Row { | ||||
34 | id: statusbar | ||||
35 | height: units.iconSizes.medium | ||||
36 | width: parent.width | ||||
37 | spacing: units.smallSpacing | ||||
38 | | ||||
39 | PlasmaCore.IconItem { | ||||
40 | anchors.verticalCenter: parent.verticalCenter | ||||
41 | width: units.iconSizes.medium | ||||
42 | height: units.iconSizes.medium | ||||
43 | source: "fcitx" | ||||
44 | } | ||||
45 | | ||||
46 | PlasmaComponents.Label { | ||||
47 | anchors.verticalCenter: parent.verticalCenter | ||||
48 | width: parent.width - units.iconSizes.medium * 5 - parent.spacing * 5 | ||||
49 | height: units.iconSizes.medium | ||||
50 | text: "Fcitx" | ||||
51 | } | ||||
52 | | ||||
53 | PlasmaCore.IconItem { | ||||
54 | anchors.verticalCenter: parent.verticalCenter | ||||
55 | width: units.iconSizes.medium | ||||
56 | height: units.iconSizes.medium | ||||
57 | source: "fcitx-fullwidth-inactive" | ||||
58 | } | ||||
59 | | ||||
60 | PlasmaCore.IconItem { | ||||
61 | anchors.verticalCenter: parent.verticalCenter | ||||
62 | width: units.iconSizes.medium | ||||
63 | height: units.iconSizes.medium | ||||
64 | source: "fcitx-punc-active" | ||||
65 | } | ||||
66 | | ||||
67 | PlasmaCore.IconItem { | ||||
68 | anchors.verticalCenter: parent.verticalCenter | ||||
69 | width: units.iconSizes.medium | ||||
70 | height: units.iconSizes.medium | ||||
71 | source: "fcitx-chttrans-inactive" | ||||
72 | } | ||||
73 | | ||||
74 | PlasmaCore.IconItem { | ||||
75 | anchors.verticalCenter: parent.verticalCenter | ||||
76 | width: units.iconSizes.medium | ||||
77 | height: units.iconSizes.medium | ||||
78 | source: "fcitx-vk-inactive" | ||||
79 | } | ||||
80 | } | ||||
81 | | ||||
82 | // List of input methods | ||||
83 | PlasmaExtras.ScrollArea { | ||||
84 | width: parent.width | ||||
85 | height: parent.height - statusbar.height - parent.spacing | ||||
86 | | ||||
87 | ListView { | ||||
88 | id: layoutlist | ||||
89 | width: parent.width | ||||
90 | height: childrenRect.height | ||||
91 | | ||||
92 | model: ListModel { | ||||
93 | ListElement { | ||||
94 | icon: "input-keyboard" | ||||
95 | name: "Keyboard (US)" | ||||
96 | } | ||||
97 | ListElement { | ||||
98 | icon: "input-keyboard" | ||||
99 | name: "Keyboard (FI)" | ||||
100 | } | ||||
101 | ListElement { | ||||
102 | icon: "fcitx-pinyin" | ||||
103 | name: "Pinyin" | ||||
104 | } | ||||
105 | ListElement { | ||||
106 | icon: "fcitx-wubi" | ||||
107 | name: "Wubi" | ||||
108 | } | ||||
109 | ListElement { | ||||
110 | icon: "fcitx-erbi" | ||||
111 | name: "Erbi" | ||||
112 | } | ||||
113 | } | ||||
114 | | ||||
115 | delegate: Row { | ||||
116 | width: parent.width | ||||
117 | height: units.iconSizes.medium + units.smallSpacing * 2 | ||||
118 | spacing: units.smallSpacing | ||||
119 | | ||||
120 | PlasmaCore.IconItem { | ||||
121 | anchors.verticalCenter: parent.verticalCenter | ||||
122 | width: units.iconSizes.medium | ||||
123 | height: units.iconSizes.medium | ||||
124 | source: model.icon | ||||
125 | } | ||||
126 | | ||||
127 | PlasmaComponents.Label { | ||||
128 | anchors.verticalCenter: parent.verticalCenter | ||||
129 | text: model.name | ||||
130 | } | ||||
131 | } | ||||
132 | } | ||||
133 | } | ||||
134 | } |