on xenial help sign in
improve layout, add word wrap
25ab2d1Lukáš Tinkl
qml/Components/KeyboardShortcutsOverlay.qml+39−5
@@ -20,16 +20,20 @@ import QtQuick.Layouts 1.1
20import Ubuntu.Components 1.3
20import Ubuntu.Components 1.3
21
21
22Rectangle {
22Rectangle {
23+ id: root
23 width: parent.width * 2/3
24 width: parent.width * 2/3
24 height: parent.height * 2/3
25 height: parent.height * 2/3
25 color: theme.palette.normal.background
26 color: theme.palette.normal.background
26 radius: units.gu(.5)
27 radius: units.gu(.5)
27
28
29+ readonly property int maxTextSize: (root.width / 4) - padding
30+ readonly property int padding: units.gu(4)
31+
28 GridLayout {
32 GridLayout {
29 anchors.fill: parent
33 anchors.fill: parent
30− anchors.margins: units.gu(4)
34+ anchors.margins: padding
31 columns: 2
35 columns: 2
32− columnSpacing: units.gu(4)
36+ columnSpacing: padding
33
37
34 Label {
38 Label {
35 Layout.columnSpan: 2
39 Layout.columnSpan: 2
@@ -41,7 +45,6 @@ Rectangle {
41
45
42 GridLayout {
46 GridLayout {
43 columns: 2
47 columns: 2
44− rows: 10
45 columnSpacing: units.gu(4)
48 columnSpacing: units.gu(4)
46 Layout.alignment: Qt.AlignTop
49 Layout.alignment: Qt.AlignTop
47
50
@@ -63,6 +66,8 @@ Rectangle {
63 text: i18n.tr("Takes a screenshot.")
66 text: i18n.tr("Takes a screenshot.")
64 fontSize: "small"
67 fontSize: "small"
65 font.weight: Font.Light
68 font.weight: Font.Light
69+ wrapMode: Text.Wrap
70+ Layout.maximumWidth: maxTextSize
66 }
71 }
67
72
68 Label {
73 Label {
@@ -74,6 +79,8 @@ Rectangle {
74 text: i18n.tr("Switches to next keyboard layout.")
79 text: i18n.tr("Switches to next keyboard layout.")
75 fontSize: "small"
80 fontSize: "small"
76 font.weight: Font.Light
81 font.weight: Font.Light
82+ wrapMode: Text.Wrap
83+ Layout.maximumWidth: maxTextSize
77 }
84 }
78
85
79 Label {
86 Label {
@@ -85,6 +92,8 @@ Rectangle {
85 text: i18n.tr("Switches to previous keyboard layout.")
92 text: i18n.tr("Switches to previous keyboard layout.")
86 fontSize: "small"
93 fontSize: "small"
87 font.weight: Font.Light
94 font.weight: Font.Light
95+ wrapMode: Text.Wrap
96+ Layout.maximumWidth: maxTextSize
88 }
97 }
89
98
90
99
@@ -107,6 +116,8 @@ Rectangle {
107 text: i18n.tr("Opens the launcher, displays shortcuts.")
116 text: i18n.tr("Opens the launcher, displays shortcuts.")
108 fontSize: "small"
117 fontSize: "small"
109 font.weight: Font.Light
118 font.weight: Font.Light
119+ wrapMode: Text.Wrap
120+ Layout.maximumWidth: maxTextSize
110 }
121 }
111
122
112 Label {
123 Label {
@@ -118,6 +129,8 @@ Rectangle {
118 text: i18n.tr("Opens launcher keyboard navigation mode.")
129 text: i18n.tr("Opens launcher keyboard navigation mode.")
119 fontSize: "small"
130 fontSize: "small"
120 font.weight: Font.Light
131 font.weight: Font.Light
132+ wrapMode: Text.Wrap
133+ Layout.maximumWidth: maxTextSize
121 }
134 }
122
135
123 Label {
136 Label {
@@ -129,6 +142,8 @@ Rectangle {
129 text: i18n.tr("Switches applications via the launcher.")
142 text: i18n.tr("Switches applications via the launcher.")
130 fontSize: "small"
143 fontSize: "small"
131 font.weight: Font.Light
144 font.weight: Font.Light
145+ wrapMode: Text.Wrap
146+ Layout.maximumWidth: maxTextSize
132 }
147 }
133
148
134 Label {
149 Label {
@@ -140,6 +155,8 @@ Rectangle {
140 text: i18n.tr("Same as clicking on a launcher icon.")
155 text: i18n.tr("Same as clicking on a launcher icon.")
141 fontSize: "small"
156 fontSize: "small"
142 font.weight: Font.Light
157 font.weight: Font.Light
158+ wrapMode: Text.Wrap
159+ Layout.maximumWidth: maxTextSize
143 }
160 }
144
161
145
162
@@ -162,13 +179,14 @@ Rectangle {
162 text: i18n.tr("Opens the Scopes home.")
179 text: i18n.tr("Opens the Scopes home.")
163 fontSize: "small"
180 fontSize: "small"
164 font.weight: Font.Light
181 font.weight: Font.Light
182+ wrapMode: Text.Wrap
183+ Layout.maximumWidth: maxTextSize
165 }
184 }
166 }
185 }
167
186
168 GridLayout {
187 GridLayout {
169 columns: 2
188 columns: 2
170− rows: 10
171− columnSpacing: units.gu(4)
189+ columnSpacing: padding
172 Layout.alignment: Qt.AlignTop
190 Layout.alignment: Qt.AlignTop
173
191
174 // Switching section
192 // Switching section
@@ -189,6 +207,8 @@ Rectangle {
189 text: i18n.tr("Switches between applications.")
207 text: i18n.tr("Switches between applications.")
190 fontSize: "small"
208 fontSize: "small"
191 font.weight: Font.Light
209 font.weight: Font.Light
210+ wrapMode: Text.Wrap
211+ Layout.maximumWidth: maxTextSize
192 }
212 }
193
213
194 Label {
214 Label {
@@ -200,6 +220,8 @@ Rectangle {
200 text: i18n.tr("Opens the desktop spread.")
220 text: i18n.tr("Opens the desktop spread.")
201 fontSize: "small"
221 fontSize: "small"
202 font.weight: Font.Light
222 font.weight: Font.Light
223+ wrapMode: Text.Wrap
224+ Layout.maximumWidth: maxTextSize
203 }
225 }
204
226
205 Label {
227 Label {
@@ -211,6 +233,8 @@ Rectangle {
211 text: i18n.tr("Moves the focus.")
233 text: i18n.tr("Moves the focus.")
212 fontSize: "small"
234 fontSize: "small"
213 font.weight: Font.Light
235 font.weight: Font.Light
236+ wrapMode: Text.Wrap
237+ Layout.maximumWidth: maxTextSize
214 }
238 }
215
239
216
240
@@ -233,6 +257,8 @@ Rectangle {
233 text: i18n.tr("Minimizes all windows.")
257 text: i18n.tr("Minimizes all windows.")
234 fontSize: "small"
258 fontSize: "small"
235 font.weight: Font.Light
259 font.weight: Font.Light
260+ wrapMode: Text.Wrap
261+ Layout.maximumWidth: maxTextSize
236 }
262 }
237
263
238 Label {
264 Label {
@@ -244,6 +270,8 @@ Rectangle {
244 text: i18n.tr("Maximizes the current window.")
270 text: i18n.tr("Maximizes the current window.")
245 fontSize: "small"
271 fontSize: "small"
246 font.weight: Font.Light
272 font.weight: Font.Light
273+ wrapMode: Text.Wrap
274+ Layout.maximumWidth: maxTextSize
247 }
275 }
248
276
249 Label {
277 Label {
@@ -255,6 +283,8 @@ Rectangle {
255 text: i18n.tr("Minimizes or restores the current window.")
283 text: i18n.tr("Minimizes or restores the current window.")
256 fontSize: "small"
284 fontSize: "small"
257 font.weight: Font.Light
285 font.weight: Font.Light
286+ wrapMode: Text.Wrap
287+ Layout.maximumWidth: maxTextSize
258 }
288 }
259
289
260 Label {
290 Label {
@@ -266,6 +296,8 @@ Rectangle {
266 text: i18n.tr("Semi-maximizes the current window.")
296 text: i18n.tr("Semi-maximizes the current window.")
267 fontSize: "small"
297 fontSize: "small"
268 font.weight: Font.Light
298 font.weight: Font.Light
299+ wrapMode: Text.Wrap
300+ Layout.maximumWidth: maxTextSize
269 }
301 }
270
302
271 Label {
303 Label {
@@ -277,6 +309,8 @@ Rectangle {
277 text: i18n.tr("Closes the current window.")
309 text: i18n.tr("Closes the current window.")
278 fontSize: "small"
310 fontSize: "small"
279 font.weight: Font.Light
311 font.weight: Font.Light
312+ wrapMode: Text.Wrap
313+ Layout.maximumWidth: maxTextSize
280 }
314 }
281 }
315 }
282
316