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