Merge lp:~tpeeters/ubuntu-ui-toolkit/fixOskAnchors into lp:ubuntu-ui-toolkit

Proposed by Tim Peeters
Status: Rejected
Rejected by: Zoltan Balogh
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/fixOskAnchors
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 122 lines (+21/-55)
1 file modified
modules/Ubuntu/Components/OrientationHelper.qml (+21/-55)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/fixOskAnchors
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Zoltan Balogh Disapprove
Review via email: mp+226275@code.launchpad.net

Description of the change

Revert speed optimizations for orientation changes which caused an OSK anchoring regression.

To post a comment you must log in.
Revision history for this message
Zoltan Balogh (bzoltan) wrote :

OK

review: Approve
Revision history for this message
Zoltan Balogh (bzoltan) wrote :

kaleo has better solution

review: Disapprove
Revision history for this message
Florian Boucault (fboucault) wrote :
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

1053. By Tim Peeters

link bugs

1052. By Tim Peeters

revert r1109 of staging

1051. By Tim Peeters

revert r1112 of staging

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/OrientationHelper.qml'
2--- modules/Ubuntu/Components/OrientationHelper.qml 2014-06-18 08:23:20 +0000
3+++ modules/Ubuntu/Components/OrientationHelper.qml 2014-07-10 10:54:10 +0000
4@@ -14,7 +14,7 @@
5 * along with this program. If not, see <http://www.gnu.org/licenses/>.
6 */
7
8-import QtQuick 2.2
9+import QtQuick 2.0
10 import QtQuick.Window 2.0
11 import Ubuntu.Components 1.0
12
13@@ -136,17 +136,6 @@
14 target: orientationHelper
15 rotation: 0
16 }
17- StateChangeScript {
18- name: "anchorsScript"
19- script: {
20- orientationHelper.anchors.fill = null;
21- orientationHelper.anchors.leftMargin = 0;
22- orientationHelper.anchors.rightMargin = 0;
23- orientationHelper.anchors.topMargin = 0;
24- orientationHelper.anchors.bottomMargin = 0;
25- orientationHelper.anchors.fill = orientationHelper.parent;
26- }
27- }
28 },
29 State {
30 name: "180"
31@@ -154,33 +143,17 @@
32 target: orientationHelper
33 rotation: 180
34 }
35- StateChangeScript {
36- name: "anchorsScript"
37- script: {
38- orientationHelper.anchors.fill = null;
39- orientationHelper.anchors.leftMargin = 0;
40- orientationHelper.anchors.rightMargin = 0;
41- orientationHelper.anchors.topMargin = 0;
42- orientationHelper.anchors.bottomMargin = 0;
43- orientationHelper.anchors.fill = orientationHelper.parent;
44- }
45- }
46 },
47 State {
48 name: "270"
49 PropertyChanges {
50 target: orientationHelper
51 rotation: 270
52- }
53- StateChangeScript {
54- name: "anchorsScript"
55- script: {
56- orientationHelper.anchors.fill = null;
57- orientationHelper.anchors.topMargin = Qt.binding(function() {return -(parent.width - parent.height) / 2});
58- orientationHelper.anchors.bottomMargin = Qt.binding(function() {return -(parent.width - parent.height) / 2});
59- orientationHelper.anchors.leftMargin = Qt.binding(function() {return (parent.width - parent.height) / 2});
60- orientationHelper.anchors.rightMargin = Qt.binding(function() {return (parent.width - parent.height) / 2});
61- orientationHelper.anchors.fill = orientationHelper.parent;
62+ anchors {
63+ leftMargin: (parent.width - parent.height) / 2
64+ rightMargin: anchors.leftMargin
65+ topMargin: -anchors.leftMargin
66+ bottomMargin: anchors.topMargin
67 }
68 }
69 },
70@@ -189,16 +162,11 @@
71 PropertyChanges {
72 target: orientationHelper
73 rotation: 90
74- }
75- StateChangeScript {
76- name: "anchorsScript"
77- script: {
78- orientationHelper.anchors.fill = null;
79- orientationHelper.anchors.topMargin = Qt.binding(function() {return -(parent.width - parent.height) / 2});
80- orientationHelper.anchors.bottomMargin = Qt.binding(function() {return -(parent.width - parent.height) / 2});
81- orientationHelper.anchors.leftMargin = Qt.binding(function() {return (parent.width - parent.height) / 2});
82- orientationHelper.anchors.rightMargin = Qt.binding(function() {return (parent.width - parent.height) / 2});
83- orientationHelper.anchors.fill = orientationHelper.parent;
84+ anchors {
85+ leftMargin: (parent.width - parent.height) / 2
86+ rightMargin: anchors.leftMargin
87+ topMargin: -anchors.leftMargin
88+ bottomMargin: anchors.topMargin
89 }
90 }
91 }
92@@ -208,20 +176,18 @@
93 Transition {
94 id: orientationTransition
95 ParallelAnimation {
96- /* FIXME: this is a workaround for 2 issues that trigger too many changes
97- to the width and height of orientationHelper which creates intermediary
98- states of the UI with unexpected sizes:
99- 1) upon state change fast-forwarding is used which means that the final values are computed and applied
100- then immediately reverted before the actual transition is applied
101- 2) when margins are applied, width and height are updated separately
102-
103- Without these issues, regular PropertyChanges could be used to set the margins.
104- */
105- ScriptAction {
106- scriptName: "anchorsScript"
107+ SequentialAnimation {
108+ PauseAnimation {
109+ duration: 25
110+ }
111+ PropertyAction {
112+ target: orientationHelper
113+ properties: "anchors.topMargin,anchors.bottomMargin,anchors.rightMargin,anchors.leftMargin"
114+ }
115 }
116- RotationAnimator {
117+ RotationAnimation {
118 target: orientationHelper
119+ properties: "rotation"
120 duration: UbuntuAnimation.FastDuration
121 easing: UbuntuAnimation.StandardEasing
122 direction: RotationAnimation.Shortest

Subscribers

People subscribed via source and target branches

to status/vote changes: