on xenial help sign in
improve layout, add word wrap
commit25ab2d1785710de5cd8d7963f43fe400d15c0cba authorLukáš Tinkl <lukas.tinkl@canonical.com> dateMon 4 Apr 2016, 16:46 (11 years ago) parent1a484e5
1 file changed+39−5
qml/Components/KeyboardShortcutsOverlay.qml+39−5
qml/Components/KeyboardShortcutsOverlay.qml+39−5
@@ -20,16 +20,20 @@ import QtQuick.Layouts 1.1
2020import Ubuntu.Components 1.3
2121
2222Rectangle {
23+ id: root
2324 width: parent.width * 2/3
2425 height: parent.height * 2/3
2526 color: theme.palette.normal.background
2627 radius: units.gu(.5)
2728
29+ readonly property int maxTextSize: (root.width / 4) - padding
30+ readonly property int padding: units.gu(4)
31+
2832 GridLayout {
2933 anchors.fill: parent
30− anchors.margins: units.gu(4)
34+ anchors.margins: padding
3135 columns: 2
32− columnSpacing: units.gu(4)
36+ columnSpacing: padding
3337
3438 Label {
3539 Layout.columnSpan: 2
@@ -41,7 +45,6 @@ Rectangle {
4145
4246 GridLayout {
4347 columns: 2
44− rows: 10
4548 columnSpacing: units.gu(4)
4649 Layout.alignment: Qt.AlignTop
4750
@@ -63,6 +66,8 @@ Rectangle {
6366 text: i18n.tr("Takes a screenshot.")
6467 fontSize: "small"
6568 font.weight: Font.Light
69+ wrapMode: Text.Wrap
70+ Layout.maximumWidth: maxTextSize
6671 }
6772
6873 Label {
@@ -74,6 +79,8 @@ Rectangle {
7479 text: i18n.tr("Switches to next keyboard layout.")
7580 fontSize: "small"
7681 font.weight: Font.Light
82+ wrapMode: Text.Wrap
83+ Layout.maximumWidth: maxTextSize
7784 }
7885
7986 Label {
@@ -85,6 +92,8 @@ Rectangle {
8592 text: i18n.tr("Switches to previous keyboard layout.")
8693 fontSize: "small"
8794 font.weight: Font.Light
95+ wrapMode: Text.Wrap
96+ Layout.maximumWidth: maxTextSize
8897 }
8998
9099
@@ -107,6 +116,8 @@ Rectangle {
107116 text: i18n.tr("Opens the launcher, displays shortcuts.")
108117 fontSize: "small"
109118 font.weight: Font.Light
119+ wrapMode: Text.Wrap
120+ Layout.maximumWidth: maxTextSize
110121 }
111122
112123 Label {
@@ -118,6 +129,8 @@ Rectangle {
118129 text: i18n.tr("Opens launcher keyboard navigation mode.")
119130 fontSize: "small"
120131 font.weight: Font.Light
132+ wrapMode: Text.Wrap
133+ Layout.maximumWidth: maxTextSize
121134 }
122135
123136 Label {
@@ -129,6 +142,8 @@ Rectangle {
129142 text: i18n.tr("Switches applications via the launcher.")
130143 fontSize: "small"
131144 font.weight: Font.Light
145+ wrapMode: Text.Wrap
146+ Layout.maximumWidth: maxTextSize
132147 }
133148
134149 Label {
@@ -140,6 +155,8 @@ Rectangle {
140155 text: i18n.tr("Same as clicking on a launcher icon.")
141156 fontSize: "small"
142157 font.weight: Font.Light
158+ wrapMode: Text.Wrap
159+ Layout.maximumWidth: maxTextSize
143160 }
144161
145162
@@ -162,13 +179,14 @@ Rectangle {
162179 text: i18n.tr("Opens the Scopes home.")
163180 fontSize: "small"
164181 font.weight: Font.Light
182+ wrapMode: Text.Wrap
183+ Layout.maximumWidth: maxTextSize
165184 }
166185 }
167186
168187 GridLayout {
169188 columns: 2
170− rows: 10
171− columnSpacing: units.gu(4)
189+ columnSpacing: padding
172190 Layout.alignment: Qt.AlignTop
173191
174192 // Switching section
@@ -189,6 +207,8 @@ Rectangle {
189207 text: i18n.tr("Switches between applications.")
190208 fontSize: "small"
191209 font.weight: Font.Light
210+ wrapMode: Text.Wrap
211+ Layout.maximumWidth: maxTextSize
192212 }
193213
194214 Label {
@@ -200,6 +220,8 @@ Rectangle {
200220 text: i18n.tr("Opens the desktop spread.")
201221 fontSize: "small"
202222 font.weight: Font.Light
223+ wrapMode: Text.Wrap
224+ Layout.maximumWidth: maxTextSize
203225 }
204226
205227 Label {
@@ -211,6 +233,8 @@ Rectangle {
211233 text: i18n.tr("Moves the focus.")
212234 fontSize: "small"
213235 font.weight: Font.Light
236+ wrapMode: Text.Wrap
237+ Layout.maximumWidth: maxTextSize
214238 }
215239
216240
@@ -233,6 +257,8 @@ Rectangle {
233257 text: i18n.tr("Minimizes all windows.")
234258 fontSize: "small"
235259 font.weight: Font.Light
260+ wrapMode: Text.Wrap
261+ Layout.maximumWidth: maxTextSize
236262 }
237263
238264 Label {
@@ -244,6 +270,8 @@ Rectangle {
244270 text: i18n.tr("Maximizes the current window.")
245271 fontSize: "small"
246272 font.weight: Font.Light
273+ wrapMode: Text.Wrap
274+ Layout.maximumWidth: maxTextSize
247275 }
248276
249277 Label {
@@ -255,6 +283,8 @@ Rectangle {
255283 text: i18n.tr("Minimizes or restores the current window.")
256284 fontSize: "small"
257285 font.weight: Font.Light
286+ wrapMode: Text.Wrap
287+ Layout.maximumWidth: maxTextSize
258288 }
259289
260290 Label {
@@ -266,6 +296,8 @@ Rectangle {
266296 text: i18n.tr("Semi-maximizes the current window.")
267297 fontSize: "small"
268298 font.weight: Font.Light
299+ wrapMode: Text.Wrap
300+ Layout.maximumWidth: maxTextSize
269301 }
270302
271303 Label {
@@ -277,6 +309,8 @@ Rectangle {
277309 text: i18n.tr("Closes the current window.")
278310 fontSize: "small"
279311 font.weight: Font.Light
312+ wrapMode: Text.Wrap
313+ Layout.maximumWidth: maxTextSize
280314 }
281315 }
282316