Lomiri
Loading...
Searching...
No Matches
KeyboardShortcutsOverlay.qml
1/*
2 * Copyright (C) 2016 Canonical Ltd.
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; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.15
18import QtQuick.Layouts 1.1
19import Lomiri.Components 1.3
20
21Rectangle {
22 id: root
23 width: topLayout.childrenRect.width + topLayout.anchors.leftMargin + topLayout.anchors.rightMargin
24 height: topLayout.childrenRect.height + topLayout.anchors.topMargin + topLayout.anchors.bottomMargin
25 color: theme.palette.normal.background
26 radius: units.gu(.5)
27
28 readonly property int maxTextSize: (root.parent.width / 4) - padding
29 readonly property int padding: units.gu(4)
30
31 Item { // dummy container to break binding loops *and* keep the margins in topLayout working
32 GridLayout {
33 id: topLayout
34 anchors.fill: parent
35 anchors.margins: padding
36 columns: 2
37 columnSpacing: padding
38
39 Label {
40 Layout.columnSpan: 2
41 text: i18n.tr("Keyboard Shortcuts")
42 fontSize: "large"
43 font.weight: Font.Light
44 lineHeight: 1.6
45 }
46
47 GridLayout {
48 columns: 2
49 columnSpacing: units.gu(4)
50 Layout.alignment: Qt.AlignTop
51
52 // Lomiri section
53 Label {
54 Layout.columnSpan: 2
55 text: i18n.tr("Lomiri")
56 font.weight: Font.Light
57 color: theme.palette.normal.baseText
58 lineHeight: 1.3
59 }
60
61 Label {
62 text: i18n.tr("PrtScr")
63 fontSize: "small"
64 font.weight: Font.Medium
65 }
66 Label {
67 text: i18n.tr("Takes a screenshot.")
68 fontSize: "small"
69 font.weight: Font.Light
70 wrapMode: Text.Wrap
71 Layout.maximumWidth: maxTextSize
72 }
73
74 Label {
75 text: i18n.tr("Alt + PrtScr")
76 fontSize: "small"
77 font.weight: Font.Medium
78 }
79 Label {
80 text: i18n.tr("Takes a screenshot of the current window.")
81 fontSize: "small"
82 font.weight: Font.Light
83 wrapMode: Text.Wrap
84 Layout.maximumWidth: maxTextSize
85 }
86
87 Label {
88 text: i18n.tr("Super + Space")
89 fontSize: "small"
90 font.weight: Font.Medium
91 }
92 Label {
93 text: i18n.tr("Switches to next keyboard layout.")
94 fontSize: "small"
95 font.weight: Font.Light
96 wrapMode: Text.Wrap
97 Layout.maximumWidth: maxTextSize
98 }
99
100 Label {
101 text: i18n.tr("Super + Shift + Space")
102 fontSize: "small"
103 font.weight: Font.Medium
104 }
105 Label {
106 text: i18n.tr("Switches to previous keyboard layout.")
107 fontSize: "small"
108 font.weight: Font.Light
109 wrapMode: Text.Wrap
110 Layout.maximumWidth: maxTextSize
111 }
112
113 Label {
114 text: i18n.tr("Ctrl + Alt + T")
115 fontSize: "small"
116 font.weight: Font.Medium
117 }
118 Label {
119 text: i18n.tr("Starts the Terminal application.")
120 fontSize: "small"
121 font.weight: Font.Light
122 wrapMode: Text.Wrap
123 Layout.maximumWidth: maxTextSize
124 }
125
126
127 // Launcher section
128 Item { Layout.columnSpan: 2; height: units.gu(2) }
129 Label {
130 Layout.columnSpan: 2
131 text: i18n.tr("Launcher")
132 font.weight: Font.Light
133 color: theme.palette.normal.baseText
134 lineHeight: 1.3
135 }
136
137 Label {
138 text: i18n.tr("Super (Hold)")
139 fontSize: "small"
140 font.weight: Font.Medium
141 }
142 Label {
143 text: i18n.tr("Opens the launcher, displays shortcuts.")
144 fontSize: "small"
145 font.weight: Font.Light
146 wrapMode: Text.Wrap
147 Layout.maximumWidth: maxTextSize
148 }
149
150 Label {
151 text: i18n.tr("Alt + F1")
152 fontSize: "small"
153 font.weight: Font.Medium
154 }
155 Label {
156 text: i18n.tr("Opens launcher keyboard navigation mode.")
157 fontSize: "small"
158 font.weight: Font.Light
159 wrapMode: Text.Wrap
160 Layout.maximumWidth: maxTextSize
161 }
162
163 Label {
164 text: i18n.tr("Super + Tab")
165 fontSize: "small"
166 font.weight: Font.Medium
167 }
168 Label {
169 text: i18n.tr("Switches applications via the launcher.")
170 fontSize: "small"
171 font.weight: Font.Light
172 wrapMode: Text.Wrap
173 Layout.maximumWidth: maxTextSize
174 }
175
176 Label {
177 text: i18n.tr("Super + 1 to 0")
178 fontSize: "small"
179 font.weight: Font.Medium
180 }
181 Label {
182 text: i18n.tr("Same as clicking on a launcher icon.")
183 fontSize: "small"
184 font.weight: Font.Light
185 wrapMode: Text.Wrap
186 Layout.maximumWidth: maxTextSize
187 }
188
189 Label {
190 text: i18n.tr("Super + A")
191 fontSize: "small"
192 font.weight: Font.Medium
193 }
194 Label {
195 text: i18n.tr("Opens the Application Drawer.")
196 fontSize: "small"
197 font.weight: Font.Light
198 wrapMode: Text.Wrap
199 Layout.maximumWidth: maxTextSize
200 }
201
202 // Switching section
203 Item { Layout.columnSpan: 2; height: units.gu(2) }
204 Label {
205 Layout.columnSpan: 2
206 text: i18n.tr("Switching")
207 font.weight: Font.Light
208 color: theme.palette.normal.baseText
209 lineHeight: 1.3
210 }
211
212 Label {
213 text: i18n.tr("Alt + Tab")
214 fontSize: "small"
215 font.weight: Font.Medium
216 }
217 Label {
218 text: i18n.tr("Switches between applications.")
219 fontSize: "small"
220 font.weight: Font.Light
221 wrapMode: Text.Wrap
222 Layout.maximumWidth: maxTextSize
223 }
224
225 Label {
226 text: i18n.tr("Super + W")
227 fontSize: "small"
228 font.weight: Font.Medium
229 }
230 Label {
231 text: i18n.tr("Opens the desktop spread.")
232 fontSize: "small"
233 font.weight: Font.Light
234 wrapMode: Text.Wrap
235 Layout.maximumWidth: maxTextSize
236 }
237
238 Label {
239 text: i18n.tr("Cursor Left or Right")
240 fontSize: "small"
241 font.weight: Font.Medium
242 }
243 Label {
244 text: i18n.tr("Moves the focus.")
245 fontSize: "small"
246 font.weight: Font.Light
247 wrapMode: Text.Wrap
248 Layout.maximumWidth: maxTextSize
249 }
250 }
251
252 GridLayout {
253 columns: 2
254 columnSpacing: padding
255 Layout.alignment: Qt.AlignTop
256
257 // Windows section
258 Label {
259 Layout.columnSpan: 2
260 text: i18n.tr("Windows")
261 font.weight: Font.Light
262 color: theme.palette.normal.baseText
263 lineHeight: 1.3
264 }
265
266 Label {
267 text: i18n.tr("Ctrl + Super + D")
268 fontSize: "small"
269 font.weight: Font.Medium
270 }
271 Label {
272 text: i18n.tr("Minimizes all windows.")
273 fontSize: "small"
274 font.weight: Font.Light
275 wrapMode: Text.Wrap
276 Layout.maximumWidth: maxTextSize
277 }
278
279 Label {
280 text: i18n.tr("Ctrl + Super + Up")
281 fontSize: "small"
282 font.weight: Font.Medium
283 }
284 Label {
285 text: i18n.tr("Maximizes the current window.")
286 fontSize: "small"
287 font.weight: Font.Light
288 wrapMode: Text.Wrap
289 Layout.maximumWidth: maxTextSize
290 }
291
292 Label {
293 text: i18n.tr("Ctrl + Super + Down")
294 fontSize: "small"
295 font.weight: Font.Medium
296 }
297 Label {
298 text: i18n.tr("Minimizes or restores the current window.")
299 fontSize: "small"
300 font.weight: Font.Light
301 wrapMode: Text.Wrap
302 Layout.maximumWidth: maxTextSize
303 }
304
305 Label {
306 text: i18n.tr("Ctrl + Super + Left or Right")
307 fontSize: "small"
308 font.weight: Font.Medium
309 }
310 Label {
311 text: i18n.tr("Semi-maximizes the current window.")
312 fontSize: "small"
313 font.weight: Font.Light
314 wrapMode: Text.Wrap
315 Layout.maximumWidth: maxTextSize
316 }
317
318 Label {
319 text: i18n.tr("Alt + F4")
320 fontSize: "small"
321 font.weight: Font.Medium
322 }
323 Label {
324 text: i18n.tr("Closes the current window.")
325 fontSize: "small"
326 font.weight: Font.Light
327 wrapMode: Text.Wrap
328 Layout.maximumWidth: maxTextSize
329 }
330
331 // Workspace section
332 Item { Layout.columnSpan: 2; height: units.gu(2) }
333 Label {
334 Layout.columnSpan: 2
335 text: i18n.tr("Screens and Workspaces")
336 font.weight: Font.Light
337 color: theme.palette.normal.baseText
338 lineHeight: 1.3
339 }
340
341 Label {
342 text: i18n.tr("Ctrl + Alt + Left or Right")
343 fontSize: "small"
344 font.weight: Font.Medium
345 }
346 Label {
347 text: i18n.tr("Switches between workspaces.")
348 fontSize: "small"
349 font.weight: Font.Light
350 wrapMode: Text.Wrap
351 Layout.maximumWidth: maxTextSize
352 }
353
354 Label {
355 text: i18n.tr("Ctrl + Alt + Up or Down")
356 fontSize: "small"
357 font.weight: Font.Medium
358 }
359 Label {
360 text: i18n.tr("Switches between screens.")
361 fontSize: "small"
362 font.weight: Font.Light
363 wrapMode: Text.Wrap
364 Layout.maximumWidth: maxTextSize
365 }
366
367 Label {
368 text: i18n.tr("Ctrl + Alt + Shift + Left or Right")
369 fontSize: "small"
370 font.weight: Font.Medium
371 }
372 Label {
373 text: i18n.tr("Moves current app between workspaces.")
374 fontSize: "small"
375 font.weight: Font.Light
376 wrapMode: Text.Wrap
377 Layout.maximumWidth: maxTextSize
378 }
379
380 Label {
381 text: i18n.tr("Ctrl + Alt + Shift + Up or Down")
382 fontSize: "small"
383 font.weight: Font.Medium
384 }
385 Label {
386 text: i18n.tr("Moves current app between screens.")
387 fontSize: "small"
388 font.weight: Font.Light
389 wrapMode: Text.Wrap
390 Layout.maximumWidth: maxTextSize
391 }
392
393 // Stages section
394 Item { Layout.columnSpan: 2; height: units.gu(2) }
395 Label {
396 Layout.columnSpan: 2
397 text: i18n.tr("Stages")
398 font.weight: Font.Light
399 color: theme.palette.normal.baseText
400 lineHeight: 1.3
401 }
402
403 Label {
404 text: i18n.tr("Super + S")
405 fontSize: "small"
406 font.weight: Font.Medium
407 }
408 Label {
409 text: i18n.tr("Shows or hides the side stage.")
410 fontSize: "small"
411 font.weight: Font.Light
412 wrapMode: Text.Wrap
413 Layout.maximumWidth: maxTextSize
414 }
415
416 Label {
417 text: i18n.tr("Ctrl + Super + Left or Right")
418 fontSize: "small"
419 font.weight: Font.Medium
420 }
421
422 Label {
423 text: i18n.tr("Moves app between main stage and side stage.")
424 fontSize: "small"
425 font.weight: Font.Light
426 wrapMode: Text.Wrap
427 Layout.maximumWidth: maxTextSize
428 }
429 }
430
431 Item { Layout.fillHeight: true; Layout.columnSpan: 2 } // spacer
432 }
433 }
434}