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.12
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
203 GridLayout {
204 columns: 2
205 columnSpacing: padding
206 Layout.alignment: Qt.AlignTop
207
208 // Switching section
209 Label {
210 Layout.columnSpan: 2
211 text: i18n.tr("Switching")
212 font.weight: Font.Light
213 color: theme.palette.normal.baseText
214 lineHeight: 1.3
215 }
216
217 Label {
218 text: i18n.tr("Alt + Tab")
219 fontSize: "small"
220 font.weight: Font.Medium
221 }
222 Label {
223 text: i18n.tr("Switches between applications.")
224 fontSize: "small"
225 font.weight: Font.Light
226 wrapMode: Text.Wrap
227 Layout.maximumWidth: maxTextSize
228 }
229
230 Label {
231 text: i18n.tr("Super + W")
232 fontSize: "small"
233 font.weight: Font.Medium
234 }
235 Label {
236 text: i18n.tr("Opens the desktop spread.")
237 fontSize: "small"
238 font.weight: Font.Light
239 wrapMode: Text.Wrap
240 Layout.maximumWidth: maxTextSize
241 }
242
243 Label {
244 text: i18n.tr("Cursor Left or Right")
245 fontSize: "small"
246 font.weight: Font.Medium
247 }
248 Label {
249 text: i18n.tr("Moves the focus.")
250 fontSize: "small"
251 font.weight: Font.Light
252 wrapMode: Text.Wrap
253 Layout.maximumWidth: maxTextSize
254 }
255
256
257 // Windows section
258 Item { Layout.columnSpan: 2; height: units.gu(2) }
259 Label {
260 Layout.columnSpan: 2
261 text: i18n.tr("Windows")
262 font.weight: Font.Light
263 color: theme.palette.normal.baseText
264 lineHeight: 1.3
265 }
266
267 Label {
268 text: i18n.tr("Ctrl + Super + D")
269 fontSize: "small"
270 font.weight: Font.Medium
271 }
272 Label {
273 text: i18n.tr("Minimizes all windows.")
274 fontSize: "small"
275 font.weight: Font.Light
276 wrapMode: Text.Wrap
277 Layout.maximumWidth: maxTextSize
278 }
279
280 Label {
281 text: i18n.tr("Ctrl + Super + Up")
282 fontSize: "small"
283 font.weight: Font.Medium
284 }
285 Label {
286 text: i18n.tr("Maximizes the current window.")
287 fontSize: "small"
288 font.weight: Font.Light
289 wrapMode: Text.Wrap
290 Layout.maximumWidth: maxTextSize
291 }
292
293 Label {
294 text: i18n.tr("Ctrl + Super + Down")
295 fontSize: "small"
296 font.weight: Font.Medium
297 }
298 Label {
299 text: i18n.tr("Minimizes or restores the current window.")
300 fontSize: "small"
301 font.weight: Font.Light
302 wrapMode: Text.Wrap
303 Layout.maximumWidth: maxTextSize
304 }
305
306 Label {
307 text: i18n.tr("Ctrl + Super + Left or Right")
308 fontSize: "small"
309 font.weight: Font.Medium
310 }
311 Label {
312 text: i18n.tr("Semi-maximizes the current window.")
313 fontSize: "small"
314 font.weight: Font.Light
315 wrapMode: Text.Wrap
316 Layout.maximumWidth: maxTextSize
317 }
318
319 Label {
320 text: i18n.tr("Alt + F4")
321 fontSize: "small"
322 font.weight: Font.Medium
323 }
324 Label {
325 text: i18n.tr("Closes the current window.")
326 fontSize: "small"
327 font.weight: Font.Light
328 wrapMode: Text.Wrap
329 Layout.maximumWidth: maxTextSize
330 }
331 }
332
333 Item { Layout.fillHeight: true; Layout.columnSpan: 2 } // spacer
334 }
335 }
336}