Merge lp:~michael-sheldon/ubuntu-keyboard/desktop-improvements into lp:ubuntu-keyboard

Proposed by Michael Sheldon
Status: Merged
Approved by: Bill Filler
Approved revision: 545
Merged at revision: 544
Proposed branch: lp:~michael-sheldon/ubuntu-keyboard/desktop-improvements
Merge into: lp:ubuntu-keyboard
Diff against target: 136 lines (+25/-14)
5 files modified
qml/keys/CharKey.qml (+2/-2)
qml/keys/ExtendedKeysSelector.qml (+15/-2)
qml/keys/Magnifier.qml (+4/-2)
qml/keys/SpaceKey.qml (+2/-2)
qml/keys/key_constants.js (+2/-6)
To merge this branch: bzr merge lp:~michael-sheldon/ubuntu-keyboard/desktop-improvements
Reviewer Review Type Date Requested Status
system-apps-ci-bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+319932@code.launchpad.net

Commit message

Tweak sizes for desktop use

Description of the change

Tweak sizes for desktop use

To post a comment you must log in.
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

PASSED: Continuous integration, rev:543
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-keyboard-ci/3/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/2316
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/2315
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2137
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2137/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=zesty/2137
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=zesty/2137/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2137
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2137/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=zesty/2137
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=zesty/2137/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/2137
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/2137/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=zesty/2137
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=zesty/2137/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-keyboard-ci/3/rebuild

review: Approve (continuous-integration)
544. By Michael Sheldon

Fix scaling on magnifier and extended keys

545. By Michael Sheldon

Fix magnifier centering

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/keys/CharKey.qml'
2--- qml/keys/CharKey.qml 2016-08-08 16:56:58 +0000
3+++ qml/keys/CharKey.qml 2017-03-17 14:01:41 +0000
4@@ -74,7 +74,7 @@
5 // be used, depending on the state. If no extended/extendedShifted arrays exist, no annotation is shown
6 property string annotation: ""
7
8- /*! indicates if te key is currently pressed/down*/
9+ /*! indicates if the key is currently pressed/down*/
10 property alias currentlyPressed: keyMouseArea.pressed
11
12 /* internal */
13@@ -176,7 +176,7 @@
14 anchors.topMargin: units.gu(UI.annotationTopMargin)
15 anchors.rightMargin: units.gu(UI.annotationRightMargin)
16 font.family: UI.annotationFont
17- font.pixelSize: fullScreenItem.tablet ? units.dp(UI.tabletAnnotationFontSize) : units.dp(UI.phoneAnnotationFontSize)
18+ font.pixelSize: fontSize / 3
19 font.weight: Font.Light
20 color: UI.annotationFontColor
21 }
22
23=== modified file 'qml/keys/ExtendedKeysSelector.qml'
24--- qml/keys/ExtendedKeysSelector.qml 2016-01-26 12:35:10 +0000
25+++ qml/keys/ExtendedKeysSelector.qml 2017-03-17 14:01:41 +0000
26@@ -30,6 +30,7 @@
27 property alias keys: rowOfKeys.children
28 property alias rowX: rowOfKeys.x
29 property alias rowY: rowOfKeys.y
30+ property int fontSize: 0
31
32 property int __width: 0
33 property string __commitStr: ""
34@@ -44,7 +45,19 @@
35 reorderedModel.shift();
36 keyRepeater.model = reorderedModel;
37 } else {
38- keyRepeater.model = extendedKeysModel
39+ keyRepeater.model = extendedKeysModel;
40+ }
41+
42+ var longestKey = 1;
43+ // Calculate font size based on longest key
44+ if (extendedKeysModel != null) {
45+ for(var i = 0; i < extendedKeysModel.length; i++) {
46+ if (extendedKeysModel[i].length > longestKey) {
47+ longestKey = extendedKeysModel[i].length;
48+ }
49+ }
50+ fontSize = (fullScreenItem.landscape ? (panel.keyHeight / 2) : (panel.keyHeight / 2.8))
51+ * (4 / (longestKey >= 2 ? (longestKey <= 6 ? longestKey + 2.5 : 8) : 4));
52 }
53 }
54
55@@ -115,7 +128,7 @@
56 anchors.centerIn: parent;
57 text: modelData
58 font.family: UI.fontFamily
59- font.pixelSize: text.length > 2 ? units.gu( UI.smallFontSize ) : units.gu( UI.fontSize )
60+ font.pixelSize: fontSize
61 font.weight: Font.Light
62 color: key.highlight ? UI.selectionColor : UI.fontColor
63 Component.onCompleted: __width += (textCell.width + units.gu( UI.popoverCellPadding));
64
65=== modified file 'qml/keys/Magnifier.qml'
66--- qml/keys/Magnifier.qml 2016-01-26 12:35:10 +0000
67+++ qml/keys/Magnifier.qml 2017-03-17 14:01:41 +0000
68@@ -54,7 +54,6 @@
69 height: parent.height
70
71 anchors.centerIn: anchorItem
72- anchors.verticalCenterOffset: -units.dp(UI.popoverTopMargin)
73
74 // this property is used to synchronize scale and opacity animation
75 property real animationStep: 0
76@@ -81,10 +80,13 @@
77 Text {
78 id: label
79 anchors.centerIn: parent
80+ height: parent.height
81 text: currentlyAssignedKey ? currentlyAssignedKey.valueToSubmit : ""
82 font.family: UI.fontFamily
83 font.weight: Font.Light
84- font.pixelSize: units.gu( UI.fontSizeMagnified )
85+ font.pixelSize: panel.keyHeight * 0.6
86+ verticalAlignment: Text.AlignVCenter
87+
88 color: UI.fontColor
89 }
90
91
92=== modified file 'qml/keys/SpaceKey.qml'
93--- qml/keys/SpaceKey.qml 2016-04-18 15:23:00 +0000
94+++ qml/keys/SpaceKey.qml 2017-03-17 14:01:41 +0000
95@@ -33,9 +33,9 @@
96 Label {
97 anchors.centerIn: parent
98 anchors.verticalCenterOffset: -parent.rowMargin / 2 - units.gu(0.15)
99- font.family: UI.spaceFontFamily
100+ font.family: UI.fontFamily
101 font.weight: Font.Light
102- fontSize: fullScreenItem.tablet ? UI.tabletSpaceFontSize : UI.phoneSpaceFontSize
103+ font.pixelSize: parent.fontSize * 0.6
104 opacity: UI.spaceOpacity
105 text: Languages.languageIdToName(maliit_input_method.activeLanguage)
106 horizontalAlignment: Text.AlignHCenter
107
108=== modified file 'qml/keys/key_constants.js'
109--- qml/keys/key_constants.js 2016-01-28 19:06:37 +0000
110+++ qml/keys/key_constants.js 2017-03-17 14:01:41 +0000
111@@ -19,7 +19,6 @@
112 var tabletKeyMargins = 0.5; // gu
113 var phoneKeyMargins = 0.25 // gu
114 var fontSize = 2.5; // gu
115-var fontSizeMagnified = 4; // gu
116 var fontFamily = "Ubuntu";
117 var fontColor = "#333333";
118 var fontBold = false;
119@@ -35,9 +34,6 @@
120 var annotationFontColor = "#333333";
121 var annotationFont = "Ubuntu";
122
123-var spaceFontFamily = "Ubuntu";
124-var tabletSpaceFontSize = "large";
125-var phoneSpaceFontSize = "small";
126 var spaceOpacity = 0.33;
127
128 /* magnifier */
129@@ -81,5 +77,5 @@
130 var phoneKeyboardHeightPortrait = 0.40; // percent of screen
131 var phoneKeyboardHeightLandscape = 0.49; // percent of screen
132
133-var tabletKeyboardHeightPortrait = 0.39; // percent of screen
134-var tabletKeyboardHeightLandscape = 0.42; // percent of screen
135+var tabletKeyboardHeightPortrait = 0.31; // percent of screen
136+var tabletKeyboardHeightLandscape = 0.34; // percent of screen

Subscribers

People subscribed via source and target branches