Changeset View
Changeset View
Standalone View
Standalone View
applets/kicker/package/contents/ui/ConfigGeneral.qml
Show All 11 Lines | |||||
12 | * GNU General Public License for more details. * | 12 | * GNU General Public License for more details. * | ||
13 | * * | 13 | * * | ||
14 | * You should have received a copy of the GNU General Public License * | 14 | * You should have received a copy of the GNU General Public License * | ||
15 | * along with this program; if not, write to the * | 15 | * along with this program; if not, write to the * | ||
16 | * Free Software Foundation, Inc., * | 16 | * Free Software Foundation, Inc., * | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * | ||
18 | ***************************************************************************/ | 18 | ***************************************************************************/ | ||
19 | 19 | | |||
20 | import QtQuick 2.0 | 20 | import QtQuick 2.5 | ||
21 | import QtQuick.Controls 1.0 | 21 | import QtQuick.Controls 2.5 | ||
22 | import QtQuick.Dialogs 1.2 | | |||
23 | import QtQuick.Layouts 1.0 | | |||
24 | 22 | | |||
25 | import org.kde.plasma.core 2.0 as PlasmaCore | 23 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
26 | import org.kde.plasma.components 2.0 as PlasmaComponents | | |||
27 | | ||||
28 | import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons | 24 | import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons | ||
29 | import org.kde.draganddrop 2.0 as DragDrop | 25 | import org.kde.draganddrop 2.0 as DragDrop | ||
26 | import org.kde.kirigami 2.5 as Kirigami | ||||
30 | 27 | | |||
31 | import org.kde.plasma.private.kicker 0.1 as Kicker | 28 | import org.kde.plasma.private.kicker 0.1 as Kicker | ||
32 | 29 | | |||
33 | Item { | 30 | Kirigami.FormLayout { | ||
34 | id: configGeneral | 31 | id: configGeneral | ||
35 | 32 | | |||
36 | width: childrenRect.width | 33 | anchors.left: parent.left | ||
37 | height: childrenRect.height | 34 | anchors.right: parent.right | ||
38 | 35 | | |||
39 | property bool isDash: (plasmoid.pluginName === "org.kde.plasma.kickerdash") | 36 | property bool isDash: (plasmoid.pluginName === "org.kde.plasma.kickerdash") | ||
40 | 37 | | |||
41 | property string cfg_icon: plasmoid.configuration.icon | 38 | property string cfg_icon: plasmoid.configuration.icon | ||
42 | property bool cfg_useCustomButtonImage: plasmoid.configuration.useCustomButtonImage | 39 | property bool cfg_useCustomButtonImage: plasmoid.configuration.useCustomButtonImage | ||
43 | property string cfg_customButtonImage: plasmoid.configuration.customButtonImage | 40 | property string cfg_customButtonImage: plasmoid.configuration.customButtonImage | ||
44 | 41 | | |||
45 | property alias cfg_appNameFormat: appNameFormat.currentIndex | 42 | property alias cfg_appNameFormat: appNameFormat.currentIndex | ||
46 | property alias cfg_limitDepth: limitDepth.checked | 43 | property alias cfg_limitDepth: limitDepth.checked | ||
47 | property alias cfg_alphaSort: alphaSort.checked | 44 | property alias cfg_alphaSort: alphaSort.checked | ||
48 | 45 | | |||
49 | property alias cfg_recentOrdering: recentOrdering.currentIndex | 46 | property alias cfg_recentOrdering: recentOrdering.currentIndex | ||
50 | property alias cfg_showRecentApps: showRecentApps.checked | 47 | property alias cfg_showRecentApps: showRecentApps.checked | ||
51 | property alias cfg_showRecentDocs: showRecentDocs.checked | 48 | property alias cfg_showRecentDocs: showRecentDocs.checked | ||
52 | property alias cfg_showRecentContacts: showRecentContacts.checked | 49 | property alias cfg_showRecentContacts: showRecentContacts.checked | ||
53 | 50 | | |||
54 | property alias cfg_useExtraRunners: useExtraRunners.checked | 51 | property alias cfg_useExtraRunners: useExtraRunners.checked | ||
55 | property alias cfg_alignResultsToBottom: alignResultsToBottom.checked | 52 | property alias cfg_alignResultsToBottom: alignResultsToBottom.checked | ||
56 | 53 | | |||
57 | ColumnLayout { | | |||
58 | anchors.left: parent.left | | |||
59 | | ||||
60 | RowLayout { | | |||
61 | spacing: units.smallSpacing | | |||
62 | | ||||
63 | Label { | | |||
64 | text: i18n("Icon:") | | |||
65 | } | | |||
66 | 54 | | |||
67 | Button { | 55 | Button { | ||
68 | id: iconButton | 56 | id: iconButton | ||
69 | Layout.minimumWidth: previewFrame.width + units.smallSpacing * 2 | 57 | | ||
70 | Layout.maximumWidth: Layout.minimumWidth | 58 | Kirigami.FormData.label: i18n("Icon:") | ||
71 | Layout.minimumHeight: previewFrame.height + units.smallSpacing * 2 | 59 | | ||
72 | Layout.maximumHeight: Layout.minimumWidth | 60 | implicitWidth: previewFrame.width + units.smallSpacing * 2 | ||
61 | implicitHeight: previewFrame.height + units.smallSpacing * 2 | ||||
62 | | ||||
63 | // Just to provide some visual feedback when dragging; | ||||
64 | // cannot have checked without checkable enabled | ||||
65 | checkable: true | ||||
66 | checked: dropArea.containsAcceptableDrag | ||||
67 | | ||||
68 | onPressed: iconMenu.opened ? iconMenu.close() : iconMenu.open() | ||||
73 | 69 | | |||
74 | DragDrop.DropArea { | 70 | DragDrop.DropArea { | ||
75 | id: dropArea | 71 | id: dropArea | ||
76 | 72 | | |||
77 | property bool containsAcceptableDrag: false | 73 | property bool containsAcceptableDrag: false | ||
78 | 74 | | |||
79 | anchors.fill: parent | 75 | anchors.fill: parent | ||
80 | 76 | | |||
Show All 28 Lines | 102 | KQuickAddons.IconDialog { | |||
109 | function setCustomButtonImage(image) { | 105 | function setCustomButtonImage(image) { | ||
110 | cfg_customButtonImage = image || cfg_icon || "start-here-kde" | 106 | cfg_customButtonImage = image || cfg_icon || "start-here-kde" | ||
111 | cfg_useCustomButtonImage = true; | 107 | cfg_useCustomButtonImage = true; | ||
112 | } | 108 | } | ||
113 | 109 | | |||
114 | onIconNameChanged: setCustomButtonImage(iconName); | 110 | onIconNameChanged: setCustomButtonImage(iconName); | ||
115 | } | 111 | } | ||
116 | 112 | | |||
117 | // just to provide some visual feedback, cannot have checked without checkable enabled | | |||
118 | checkable: true | | |||
119 | checked: dropArea.containsAcceptableDrag | | |||
120 | onClicked: { | | |||
121 | checked = Qt.binding(function() { // never actually allow it being checked | | |||
122 | return iconMenu.status === PlasmaComponents.DialogStatus.Open || dropArea.containsAcceptableDrag; | | |||
123 | }) | | |||
124 | | ||||
125 | iconMenu.open(0, height) | | |||
126 | } | | |||
127 | | ||||
128 | PlasmaCore.FrameSvgItem { | 113 | PlasmaCore.FrameSvgItem { | ||
129 | id: previewFrame | 114 | id: previewFrame | ||
130 | anchors.centerIn: parent | 115 | anchors.centerIn: parent | ||
131 | imagePath: plasmoid.location === PlasmaCore.Types.Vertical || plasmoid.location === PlasmaCore.Types.Horizontal | 116 | imagePath: plasmoid.location === PlasmaCore.Types.Vertical || plasmoid.location === PlasmaCore.Types.Horizontal | ||
132 | ? "widgets/panel-background" : "widgets/background" | 117 | ? "widgets/panel-background" : "widgets/background" | ||
133 | width: units.iconSizes.large + fixedMargins.left + fixedMargins.right | 118 | width: units.iconSizes.large + fixedMargins.left + fixedMargins.right | ||
134 | height: units.iconSizes.large + fixedMargins.top + fixedMargins.bottom | 119 | height: units.iconSizes.large + fixedMargins.top + fixedMargins.bottom | ||
135 | 120 | | |||
136 | PlasmaCore.IconItem { | 121 | PlasmaCore.IconItem { | ||
137 | anchors.centerIn: parent | 122 | anchors.centerIn: parent | ||
138 | width: units.iconSizes.large | 123 | width: units.iconSizes.large | ||
139 | height: width | 124 | height: width | ||
140 | source: cfg_useCustomButtonImage ? cfg_customButtonImage : cfg_icon | 125 | source: cfg_useCustomButtonImage ? cfg_customButtonImage : cfg_icon | ||
141 | } | 126 | } | ||
142 | } | 127 | } | ||
143 | } | | |||
144 | 128 | | |||
145 | // QQC Menu can only be opened at cursor position, not a random one | 129 | Menu { | ||
146 | PlasmaComponents.ContextMenu { | | |||
147 | id: iconMenu | 130 | id: iconMenu | ||
148 | visualParent: iconButton | | |||
149 | 131 | | |||
150 | PlasmaComponents.MenuItem { | 132 | // Appear below the button | ||
133 | y: +parent.height | ||||
134 | | ||||
135 | onClosed: iconButton.checked = false; | ||||
136 | | ||||
137 | MenuItem { | ||||
151 | text: i18nc("@item:inmenu Open icon chooser dialog", "Choose...") | 138 | text: i18nc("@item:inmenu Open icon chooser dialog", "Choose...") | ||
152 | icon: "document-open-folder" | 139 | icon.name: "document-open-folder" | ||
153 | onClicked: iconDialog.open() | 140 | onClicked: iconDialog.open() | ||
154 | } | 141 | } | ||
155 | PlasmaComponents.MenuItem { | 142 | MenuItem { | ||
156 | text: i18nc("@item:inmenu Reset icon to default", "Clear Icon") | 143 | text: i18nc("@item:inmenu Reset icon to default", "Clear Icon") | ||
157 | icon: "edit-clear" | 144 | icon.name: "edit-clear" | ||
158 | onClicked: { | 145 | onClicked: { | ||
159 | cfg_useCustomButtonImage = false; | 146 | cfg_icon = "start-here-kde" | ||
147 | cfg_useCustomButtonImage = false | ||||
160 | } | 148 | } | ||
161 | } | 149 | } | ||
162 | } | 150 | } | ||
163 | } | 151 | } | ||
164 | 152 | | |||
165 | GroupBox { | | |||
166 | Layout.fillWidth: true | | |||
167 | | ||||
168 | title: i18n("Behavior") | | |||
169 | 153 | | |||
170 | flat: true | 154 | Item { | ||
171 | 155 | Kirigami.FormData.isSection: true | |||
172 | ColumnLayout { | | |||
173 | RowLayout { | | |||
174 | Label { | | |||
175 | text: i18n("Show applications as:") | | |||
176 | } | 156 | } | ||
177 | 157 | | |||
178 | ComboBox { | 158 | ComboBox { | ||
179 | id: appNameFormat | 159 | id: appNameFormat | ||
180 | 160 | | |||
181 | Layout.fillWidth: true | 161 | Kirigami.FormData.label: i18n("Show applications as:") | ||
182 | 162 | | |||
183 | model: [i18n("Name only"), i18n("Description only"), i18n("Name (Description)"), i18n("Description (Name)")] | 163 | model: [i18n("Name only"), i18n("Description only"), i18n("Name (Description)"), i18n("Description (Name)")] | ||
184 | } | 164 | } | ||
185 | } | | |||
186 | | ||||
187 | CheckBox { | | |||
188 | id: limitDepth | | |||
189 | | ||||
190 | visible: !isDash | | |||
191 | 165 | | |||
192 | text: i18n("Flatten menu to a single level") | 166 | Item { | ||
167 | Kirigami.FormData.isSection: true | ||||
193 | } | 168 | } | ||
194 | 169 | | |||
195 | CheckBox { | 170 | CheckBox { | ||
196 | id: alphaSort | 171 | id: alphaSort | ||
197 | 172 | | |||
198 | text: i18n("Sort alphabetically") | 173 | Kirigami.FormData.label: i18n("Behavior:") | ||
199 | } | | |||
200 | } | | |||
201 | } | | |||
202 | 174 | | |||
203 | GroupBox { | 175 | text: i18n("Sort applications alphabetically") | ||
204 | Layout.fillWidth: true | 176 | } | ||
205 | 177 | | |||
206 | title: i18n("Categories") | 178 | CheckBox { | ||
179 | id: limitDepth | ||||
207 | 180 | | |||
208 | flat: true | 181 | visible: !isDash | ||
209 | 182 | | |||
210 | ColumnLayout { | 183 | text: i18n("Flatten sub-menus to a single level") | ||
211 | RowLayout { | | |||
212 | Label { | | |||
213 | text: i18n("Show:") | | |||
214 | } | 184 | } | ||
215 | 185 | | |||
216 | ComboBox { | | |||
217 | id: recentOrdering | | |||
218 | | ||||
219 | Layout.fillWidth: true | | |||
220 | 186 | | |||
221 | model: [i18n("Recently used"), i18n("Often used")] | 187 | Item { | ||
222 | } | 188 | Kirigami.FormData.isSection: true | ||
223 | } | 189 | } | ||
224 | 190 | | |||
225 | CheckBox { | 191 | CheckBox { | ||
226 | id: showRecentApps | 192 | id: showRecentApps | ||
227 | 193 | | |||
194 | Kirigami.FormData.label: i18n("Show Categories:") | ||||
GB_2: Categories -> categories | |||||
195 | | ||||
228 | text: recentOrdering.currentIndex == 0 | 196 | text: recentOrdering.currentIndex == 0 | ||
229 | ? i18n("Show recent applications") | 197 | ? i18n("Recent applications") | ||
230 | : i18n("Show often used applications") | 198 | : i18n("Often used applications") | ||
231 | } | 199 | } | ||
232 | 200 | | |||
233 | CheckBox { | 201 | CheckBox { | ||
234 | id: showRecentDocs | 202 | id: showRecentDocs | ||
235 | 203 | | |||
236 | text: recentOrdering.currentIndex == 0 | 204 | text: recentOrdering.currentIndex == 0 | ||
237 | ? i18n("Show recent documents") | 205 | ? i18n("Recent documents") | ||
238 | : i18n("Show often used documents") | 206 | : i18n("Often used documents") | ||
239 | } | 207 | } | ||
240 | 208 | | |||
241 | CheckBox { | 209 | CheckBox { | ||
242 | id: showRecentContacts | 210 | id: showRecentContacts | ||
243 | 211 | | |||
244 | text: recentOrdering.currentIndex == 0 | 212 | text: recentOrdering.currentIndex == 0 | ||
245 | ? i18n("Show recent contacts") | 213 | ? i18n("Recent contacts") | ||
246 | : i18n("Show often used contacts") | 214 | : i18n("Often used contacts") | ||
247 | } | | |||
248 | } | | |||
249 | } | 215 | } | ||
250 | 216 | | |||
251 | GroupBox { | 217 | ComboBox { | ||
252 | Layout.fillWidth: true | 218 | id: recentOrdering | ||
253 | 219 | | |||
254 | title: i18n("Search") | 220 | Kirigami.FormData.label: i18n("Sort items in categories by:") | ||
221 | model: [i18nc("@item:inlistbox Sort items in categories by [Recently used | Often used]", "Recently used"), i18nc("@item:inlistbox Sort items in categories by [Recently used | Ofetn used]", "Often used")] | ||||
222 | } | ||||
255 | 223 | | |||
256 | flat: true | 224 | Item { | ||
225 | Kirigami.FormData.isSection: true | ||||
226 | } | ||||
257 | 227 | | |||
258 | ColumnLayout { | | |||
259 | CheckBox { | 228 | CheckBox { | ||
260 | id: useExtraRunners | 229 | id: useExtraRunners | ||
261 | 230 | | |||
231 | Kirigami.FormData.label: i18n("Search:") | ||||
232 | | ||||
262 | text: i18n("Expand search to bookmarks, files and emails") | 233 | text: i18n("Expand search to bookmarks, files and emails") | ||
263 | } | 234 | } | ||
264 | 235 | | |||
265 | CheckBox { | 236 | CheckBox { | ||
266 | id: alignResultsToBottom | 237 | id: alignResultsToBottom | ||
267 | 238 | | |||
268 | visible: !isDash | 239 | visible: !isDash | ||
269 | 240 | | |||
270 | text: i18n("Align search results to bottom") | 241 | text: i18n("Align search results to bottom") | ||
271 | } | 242 | } | ||
272 | } | 243 | } | ||
273 | } | | |||
274 | } | | |||
275 | } | |
Categories -> categories