on xenial help sign in
self review fixes
commitcfc6b8ca2b85b99078fabf5092f67672e43f0bb9 authorNick Dedekind <nick.dedekind@canonical.com> dateMon 6 Oct 2014, 10:17 (12 years ago) parent0de431b
20 files changed+105−180
qml/Components/ScrollCalculator.qml+16−14 qml/Panel/IndicatorItem.qml+1−4 qml/Panel/IndicatorItemRow.qml+15−25 qml/Panel/IndicatorPage.qml+1−5 qml/Panel/Indicators/VisibleIndicators.qml+1−3 qml/Panel/IndicatorsBar.qml+13−13 qml/Panel/IndicatorsMenu.qml+17−20 qml/Panel/MenuContent.qml+2−2 qml/Panel/Panel.qml+1−1 qml/Shell.qml+2 tests/mocks/Unity/Indicators/FakeMenuPage.qml−58 tests/mocks/Unity/Indicators/qmldir−1 tests/qmltests/Panel/IndicatorTest.qml+1−1 tests/qmltests/Panel/tst_IndicatorItem.qml+1−1 tests/qmltests/Panel/tst_IndicatorItemRow.qml+15−13 tests/qmltests/Panel/tst_IndicatorPage.qml+6−6 tests/qmltests/Panel/tst_IndicatorsBar.qml+7−6 tests/qmltests/Panel/tst_IndicatorsMenu.qml+4−5 tests/qmltests/Panel/tst_MenuContent.qml+1−1 tests/qmltests/Panel/tst_Panel.qml+1−1
qml/Components/ScrollCalculator.qml+16−14
@@ -29,9 +29,9 @@ Item {
2929 readonly property bool areaActive: lateralPosition >= 0
3030 onAreaActiveChanged: {
3131 if (areaActive) {
32− handleEnter()
32+ handleEnter();
3333 } else {
34− handleExit()
34+ handleExit();
3535 }
3636 }
3737
@@ -44,37 +44,39 @@ Item {
4444 rotation: direction == Qt.LeftToRight ? 0 : 180
4545
4646 function handleEnter() {
47− d.threasholdAreaX = -scrollArea.thresholdAreaWidth
48− scrollTimer.restart()
47+ d.threasholdAreaX = -scrollArea.thresholdAreaWidth;
48+ scrollTimer.restart();
4949 }
5050 onLateralPositionChanged: {
5151 if (scrollArea.areaActive) {
5252
5353 if (lateralPosition > width * (1 - forceScrollingPercentage)) {
54− d.threasholdAreaX = width * (1 - forceScrollingPercentage)
55− if (!scrollTimer.running) scrollTimer.restart()
54+ d.threasholdAreaX = width * (1 - forceScrollingPercentage);
55+ if (!scrollTimer.running) scrollTimer.restart();
5656 } else if (lateralPosition > d.threasholdAreaX + scrollArea.thresholdAreaWidth) {
57− d.threasholdAreaX = lateralPosition - scrollArea.thresholdAreaWidth
58− if (!scrollTimer.running) scrollTimer.restart()
57+ d.threasholdAreaX = lateralPosition - scrollArea.thresholdAreaWidth;
58+ if (!scrollTimer.running) scrollTimer.restart();
5959 } else if (lateralPosition < d.threasholdAreaX) {
60− d.threasholdAreaX = lateralPosition
61− scrollTimer.stop()
60+ d.threasholdAreaX = lateralPosition;
61+ scrollTimer.stop();
6262 }
6363
64− d.progression = lateralPosition / width
64+ d.progression = lateralPosition / width;
6565 }
6666 }
6767
6868 function handleExit() {
69− d.threasholdAreaX = -scrollArea.thresholdAreaWidth
70− scrollTimer.stop()
69+ d.threasholdAreaX = -scrollArea.thresholdAreaWidth;
70+ scrollTimer.stop();
7171 }
7272
7373 Timer {
7474 id: scrollTimer
7575 interval: 5
7676 repeat: true
77− onTriggered: scrollArea.scroll(scrollArea.baseScrollAmount + scrollArea.maximumScrollAmount * d.progression)
77+ onTriggered: {
78+ scrollArea.scroll(scrollArea.baseScrollAmount + scrollArea.maximumScrollAmount * d.progression);
79+ }
7880 }
7981
8082 QtObject {
qml/Panel/IndicatorItem.qml+1−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2013-2014 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU Lesser General Public License as published by
@@ -12,9 +12,6 @@
1212 *
1313 * You should have received a copy of the GNU Lesser General Public License
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors:
17− * Nick Dedekind <nick.dedekind@canonical.com>
1815 */
1916
2017import QtQuick 2.1
qml/Panel/IndicatorItemRow.qml+15−25
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013-2014 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -19,10 +19,11 @@ import Ubuntu.Components 0.1
1919
2020Item {
2121 id: root
22+ width: row.width
23+ height: units.gu(3)
2224
2325 property QtObject indicatorsModel: null
2426 property real overFlowWidth: width
25− property bool showAll: false
2627 property bool expanded: false
2728 property var currentItem: null
2829 readonly property int currentItemIndex: currentItem ? currentItem.ownIndex : -1
@@ -30,6 +31,7 @@ Item {
3031 property real unitProgress: 0.0
3132 property real selectionChangeBuffer: units.gu(2)
3233 property bool enableLateralChanges: false
34+ property color hightlightColor: "#ededed"
3335
3436 property real lateralPosition: -1
3537 onLateralPositionChanged: {
@@ -53,11 +55,11 @@ Item {
5355 } else {
5456 var currentItemLateralPosition = root.mapToItem(proposedItem, lateralPosition, 0).x;
5557
56− // is the distance into proposed item greater than max buffer?
57− // proposed item is before current item
58+ // Is the distance into proposed item greater than max buffer?
59+ // Poposed item is before current item
5860 if (proposedItem.x < currentItem.x) {
5961 bufferExceeded = (proposedItem.width - currentItemLateralPosition) > maximumBufferOffset;
60− } else { // after
62+ } else { // After
6163 bufferExceeded = currentItemLateralPosition > maximumBufferOffset;
6264 }
6365 }
@@ -70,12 +72,9 @@ Item {
7072 }
7173 }
7274
73− width: row.width
74− height: units.gu(3)
75−
7675 function indicatorAt(x, y) {
7776 var item = row.childAt(x, y);
78− return item && item.hasOwnProperty("ownIndex") ? item : null
77+ return item && item.hasOwnProperty("ownIndex") ? item : null;
7978 }
8079
8180 function resetCurrentItem() {
@@ -99,11 +98,11 @@ Item {
9998 if (item && item.opacity > 0) {
10099 currentItem = item;
101100 } else {
101+ // Select default item.
102102 var searchIndex = lateralPosition > width ? repeater.count-1 : 0;
103103
104104 for (var i = 0; i < row.children.length; i++) {
105− if (row.children[i].hasOwnProperty("ownIndex") &&
106− row.children[i].ownIndex === searchIndex) {
105+ if (row.children[i].hasOwnProperty("ownIndex") && row.children[i].ownIndex === searchIndex) {
107106 item = row.children[i];
108107 break;
109108 }
@@ -125,15 +124,6 @@ Item {
125124 d.previousItem = currentItem;
126125 }
127126
128− Timer {
129− id: allVisible
130− interval: 1000
131−
132− onTriggered: {
133− showAll = false;
134− }
135− }
136−
137127 Row {
138128 id: row
139129 anchors {
@@ -175,7 +165,7 @@ Item {
175165
176166 anchors.bottom: row.bottom
177167 height: units.dp(2)
178− color: "#ededed"
168+ color: root.hightlightColor
179169 visible: root.currentItem !== null
180170 opacity: 0.0
181171
@@ -193,11 +183,11 @@ Item {
193183
194184 var itemMapped = root.mapToItem(currentItem, lateralPosition, 0);
195185
196− var distanceFromCenter = itemMapped.x - currentItem.width/2;
186+ var distanceFromCenter = itemMapped.x - currentItem.width / 2;
197187 if (distanceFromCenter > 0) {
198− distanceFromCenter = Math.max(0, distanceFromCenter-currentItem.width/8);
188+ distanceFromCenter = Math.max(0, distanceFromCenter-currentItem.width / 8);
199189 } else {
200− distanceFromCenter = Math.min(0, distanceFromCenter+currentItem.width/8);
190+ distanceFromCenter = Math.min(0, distanceFromCenter+currentItem.width / 8);
201191 }
202192
203193 if (currentItem && currentItem.ownIndex === 0 && distanceFromCenter < 0) {
@@ -206,7 +196,7 @@ Item {
206196 return 0;
207197 }
208198
209− var shiftPercentageOffset = (distanceFromCenter / (currentItem.width/4));
199+ var shiftPercentageOffset = (distanceFromCenter / (currentItem.width / 4));
210200 return shiftPercentageOffset * units.gu(1);
211201 }
212202 Behavior on highlightCenterOffset {
qml/Panel/IndicatorPage.qml+1−5
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2013-2014 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU Lesser General Public License as published by
@@ -12,10 +12,6 @@
1212 *
1313 * You should have received a copy of the GNU Lesser General Public License
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors:
17− * Renato Araujo Oliveira Filho <renato@canonical.com>
18− * Nick Dedekind <nick.dedekind@canonical.com>
1915 */
2016
2117import QtQuick 2.0
qml/Panel/Indicators/VisibleIndicators.qml+1−3
@@ -24,9 +24,8 @@ import Utils 0.1
2424Item {
2525 id: root
2626 property SortFilterProxyModel model: filterModel
27− property string profile: indicatorProfile
2827
29− function initialise() {
28+ function initialise(profile) {
3029 indicatorsModel.load(profile);
3130 }
3231
@@ -44,7 +43,6 @@ Item {
4443
4544 Indicators.IndicatorsModel {
4645 id: indicatorsModel
47− Component.onCompleted: root.initialise();
4846 }
4947
5048 Repeater {
qml/Panel/IndicatorsBar.qml+13−13
@@ -45,13 +45,13 @@ Item {
4545
4646 function addScrollOffset(scrollAmmout) {
4747 var proposedScrollOffset = d.scrollOffset + scrollAmmout;
48− var proposedCombinedOffset = d.combinedOffset - scrollAmmout
48+ var proposedCombinedOffset = d.combinedOffset - scrollAmmout;
4949
5050 if (scrollAmmout < 0 && d.combinedOffset > (row.width - rowContainer.width)) return;
5151
5252 if (scrollAmmout > 0 && proposedCombinedOffset < 0) {
5353 // get the combined offset back to 0
54− proposedScrollOffset = proposedScrollOffset + proposedCombinedOffset
54+ proposedScrollOffset = proposedScrollOffset + proposedCombinedOffset;
5555 } else if (scrollAmmout < 0 && proposedCombinedOffset > row.width - rowContainer.width) {
5656 // get the combined offset back to max
5757 proposedScrollOffset = proposedScrollOffset + (proposedCombinedOffset - (row.width - rowContainer.width));
@@ -148,7 +148,9 @@ Item {
148148 interactive: root.expanded
149149
150150 property bool moved: false
151− onMovingChanged: { moved = true }
151+ onMovingChanged: {
152+ moved = true;
153+ }
152154
153155 rebound: Transition {
154156 NumberAnimation {
@@ -201,7 +203,7 @@ Item {
201203 // keep flickable inline with row
202204 PropertyChanges {
203205 target: flickable
204− contentX: (flickable.contentWidth - flickable.width) - d.combinedOffset;
206+ contentX: (flickable.contentWidth - flickable.width) - d.combinedOffset
205207 restoreEntryValues: false
206208 }
207209 },
@@ -227,13 +229,11 @@ Item {
227229 Transition {
228230 from: "expanded"
229231 to: "minimized"
230− SequentialAnimation {
231− PropertyAnimation {
232− target: d;
233− properties: "rowOffset, scrollOffset";
234− duration: UbuntuAnimation.SnapDuration;
235− easing: UbuntuAnimation.StandardEasing
236− }
232+ PropertyAnimation {
233+ target: d;
234+ properties: "rowOffset, scrollOffset"
235+ duration: UbuntuAnimation.SnapDuration
236+ easing: UbuntuAnimation.StandardEasing
237237 }
238238 },
239239 Transition {
@@ -243,8 +243,8 @@ Item {
243243 PropertyAction { target: d; properties: "rowOffset, rowOffsetAdjustment, scrollOffset" }
244244 PropertyAnimation {
245245 target: row;
246− properties: "anchors.rightMargin";
247− duration: UbuntuAnimation.SnapDuration;
246+ properties: "anchors.rightMargin"
247+ duration: UbuntuAnimation.SnapDuration
248248 easing: UbuntuAnimation.StandardEasing
249249 }
250250 }
qml/Panel/IndicatorsMenu.qml+17−20
@@ -33,10 +33,8 @@ Showable {
3333 readonly property bool fullyOpened: unitProgress >= 1
3434 readonly property bool partiallyOpened: unitProgress > 0 && unitProgress < 1.0
3535 readonly property bool fullyClosed: unitProgress == 0
36− readonly property real unitProgress: Math.max(0, (height - minimizedPanelHeight) /
37− (openedHeight - minimizedPanelHeight))
36+ readonly property real unitProgress: Math.max(0, (height - minimizedPanelHeight) / (openedHeight - minimizedPanelHeight))
3837 property color panelColor: "black"
39− // TODO: This should be sourced by device type (eg "desktop", "tablet", "phone"...)
4038
4139 signal showTapped(point position)
4240
@@ -88,34 +86,34 @@ Showable {
8886 indicatorsModel: root.indicatorsModel
8987 visible: root.unitProgress > 0
9088 enabled: contentEnabled
89+ }
90+
91+ Handle {
92+ id: handle
93+ anchors {
94+ left: parent.left
95+ right: parent.right
96+ bottom: parent.bottom
97+ }
98+ height: units.gu(2)
99+ active: d.activeDragHandle ? true : false
91100
92101 //small shadow gradient at bottom of menu
93102 Rectangle {
94103 anchors {
95104 left: parent.left
96105 right: parent.right
97− bottom: parent.bottom
106+ bottom: parent.top
98107 }
99108 height: units.gu(0.5)
100109 gradient: Gradient {
101110 GradientStop { position: 0.0; color: "transparent" }
102111 GradientStop { position: 1.0; color: "black" }
103112 }
104− opacity: 0.4
113+ opacity: 0.3
105114 }
106115 }
107116
108− Handle {
109− id: handle
110− anchors {
111− left: parent.left
112− right: parent.right
113− bottom: parent.bottom
114− }
115− height: units.gu(2)
116− active: d.activeDragHandle ? true : false
117− }
118−
119117 Rectangle {
120118 anchors.fill: bar
121119 color: panelColor
@@ -176,12 +174,12 @@ Showable {
176174 autoCompleteDragThreshold: maxTotalDragDistance / 2
177175 stretch: true
178176 distanceThreshold: minimizedPanelHeight
177+ onTapped: showTapped(Qt.point(touchSceneX, touchSceneY));
179178
180179 // using hint regulates minimum to hint displacement, but in fullscreen mode, we need to do it manually.
181180 overrideStartValue: enableHint ? minimizedPanelHeight : expandedPanelHeight + handle.height
182181 maxTotalDragDistance: openedHeight - (enableHint ? minimizedPanelHeight : expandedPanelHeight + handle.height)
183182 hintDisplacement: enableHint ? expandedPanelHeight - minimizedPanelHeight + handle.height : 0
184− onTapped: showTapped(Qt.point(touchSceneX, touchSceneY));
185183 }
186184
187185 DragHandle {
@@ -238,7 +236,7 @@ Showable {
238236 if (!oldActive) return;
239237 d.enableIndexChangeSignal = false;
240238
241− content.setCurrentMenuIndex(bar.currentItemIndex, fullyOpened || partiallyOpened);
239+ content.setCurrentMenuIndex(bar.currentItemIndex);
242240
243241 d.enableIndexChangeSignal = oldActive;
244242 }
@@ -265,7 +263,6 @@ Showable {
265263 StateChangeScript {
266264 script: {
267265 yVelocityCalculator.reset();
268−
269266 // initial item selection
270267 bar.selectItemAt(d.activeDragHandle ? d.activeDragHandle.touchX : -1);
271268 }
@@ -280,7 +277,7 @@ Showable {
280277 if (!d.activeDragHandle) return false;
281278 if (!d.activeDragHandle.dragging) return false;
282279
283− yVelocityCalculator.trackedPosition = d.activeDragHandle ? d.activeDragHandle.touchSceneY : 0
280+ yVelocityCalculator.trackedPosition = d.activeDragHandle ? d.activeDragHandle.touchSceneY : 0;
284281 return Math.abs(yVelocityCalculator.calculate()) < 0.2;
285282 }
286283 }
qml/Panel/MenuContent.qml+2−2
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013-2014 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@ Rectangle {
3131 width: units.gu(40)
3232 height: units.gu(42)
3333
34− function setCurrentMenuIndex(index, animate) {
34+ function setCurrentMenuIndex(index) {
3535 // FIXME - https://bugreports.qt-project.org/browse/QTBUG-41229
3636 listViewContent.currentIndex = -1;
3737 listViewContent.currentIndex = index;
qml/Panel/Panel.qml+1−1
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013-2014 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
qml/Shell.qml+2
@@ -583,6 +583,8 @@ Item {
583583
584584 VisibleIndicators {
585585 id: visibleIndicators
586+ // TODO: This should be sourced by device type (eg "desktop", "tablet", "phone"...)
587+ Component.onCompleted: initialise(indicatorProfile)
586588 }
587589
588590 property bool topmostApplicationIsFullscreen:
tests/mocks/Unity/Indicators/FakeMenuPage.qmldeleted−58
@@ -1,58 +0,0 @@
1−/*
2− * Copyright 2013 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.0
18−import Ubuntu.Components 1.1
19−
20−Flickable {
21− id: root
22− objectName: "fakeMenuPlugin"
23−
24− property string identifier
25− property color color: "transparent"
26−
27− Label {
28− text: identifier
29− anchors {
30− horizontalCenter: parent.horizontalCenter
31− bottom: contents.top
32− bottomMargin: units.gu(3)
33− }
34− color: Theme.palette.normal.foregroundText
35− fontSize: "x-large"
36−
37− }
38−
39− Rectangle {
40− id: contents
41− color: root.color
42−
43− height: 150
44− width: 150
45−
46− anchors {
47− horizontalCenter: parent.horizontalCenter
48− verticalCenter: parent.verticalCenter
49− }
50− }
51−
52− // Make it compatible with the PluginItem interface
53− function reset() {
54− if (shell != undefined && shell.indicator_status != undefined) {
55− shell.indicator_status[objectName].reset++;
56− }
57− }
58−}
tests/mocks/Unity/Indicators/qmldir−1
@@ -3,5 +3,4 @@ plugin IndicatorsFakeQml
33typeinfo Indicators.qmltypes
44
55IndicatorsModel 0.1 IndicatorsModel.qml
6−FakeMenuPage 0.1 FakeMenuPage.qml
76RootActionState 0.1 RootActionState.qml
tests/qmltests/Panel/IndicatorTest.qml+1−1
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2014 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
tests/qmltests/Panel/tst_IndicatorItem.qml+1−1
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2013-2014 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
tests/qmltests/Panel/tst_IndicatorItemRow.qml+15−13
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2013-2014 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -61,7 +61,9 @@ IndicatorTest {
6161 MouseArea {
6262 id: ma
6363 anchors.fill: parent
64− onPositionChanged: { indicatorsRow.lateralPosition = mouse.x }
64+ onPositionChanged: {
65+ indicatorsRow.lateralPosition = mouse.x;
66+ }
6567 onPressed: {
6668 if (pressed) {
6769 indicatorsRow.selectItemAt(mouse.x);
@@ -137,7 +139,7 @@ IndicatorTest {
137139
138140 verify(indicatorsModel.originalModelData.length > 0);
139141 for (i = 0; i < indicatorsModel.originalModelData.length; i++) {
140− item = findChild(indicatorsRow, indicatorsModel.originalModelData[i]["identifier"]+"-panelItem");
142+ item = findChild(indicatorsRow, indicatorsModel.originalModelData[i]["identifier"] + "-panelItem");
141143 verify(item);
142144
143145 compare(item.ownIndex, i, "Item at incorrect index");
@@ -149,7 +151,7 @@ IndicatorTest {
149151
150152 // test removals
151153 for (i = 0; i < indicatorsModel.originalModelData.length; i++) {
152− item = findChild(indicatorsRow, indicatorsModel.originalModelData[i]["identifier"]+"-panelItem");
154+ item = findChild(indicatorsRow, indicatorsModel.originalModelData[i]["identifier"] + "-panelItem");
153155
154156 verify(data.remove.indexOf(i) !== -1 ? (item === null) : (item !== null));
155157 }
@@ -160,7 +162,7 @@ IndicatorTest {
160162 }
161163
162164 for (i = 0; i < indicatorsModel.originalModelData.length; i++) {
163− item = findChild(indicatorsRow, indicatorsModel.originalModelData[i]["identifier"]+"-panelItem");
165+ item = findChild(indicatorsRow, indicatorsModel.originalModelData[i]["identifier"] + "-panelItem");
164166 verify(item);
165167
166168 compare(item.ownIndex, i, "Item at incorrect index");
@@ -177,7 +179,7 @@ IndicatorTest {
177179
178180 // test selecting the item at it's position sets the current item of the row.
179181 function test_validCurrentItem(data) {
180− var dataItem = findChild(indicatorsRow, indicatorsModel.originalModelData[data.index]["identifier"]+"-panelItem");
182+ var dataItem = findChild(indicatorsRow, indicatorsModel.originalModelData[data.index]["identifier"] + "-panelItem");
181183 verify(dataItem !== null);
182184
183185 indicatorsRow.selectItemAt(dataItem.x + dataItem.width/2);
@@ -187,7 +189,7 @@ IndicatorTest {
187189 // tests item default selection (no item at position X)
188190 function test_invalidCurrentItem() {
189191 indicatorsRow.selectItemAt(-100);
190− var item = findChild(indicatorsRow, indicatorsModel.originalModelData[0]["identifier"]+"-panelItem");
192+ var item = findChild(indicatorsRow, indicatorsModel.originalModelData[0]["identifier"] + "-panelItem");
191193 compare(indicatorsRow.currentItem, item);
192194 }
193195
@@ -203,10 +205,10 @@ IndicatorTest {
203205 indicatorsRow.expanded = true;
204206 wait_for_expansion_to_settle();
205207
206− var fromItem = findChild(indicatorsRow, indicatorsModel.originalModelData[data.from]["identifier"]+"-panelItem");
208+ var fromItem = findChild(indicatorsRow, indicatorsModel.originalModelData[data.from]["identifier"] + "-panelItem");
207209 verify(fromItem !== null);
208210
209− var toItem = findChild(indicatorsRow, indicatorsModel.originalModelData[data.to]["identifier"]+"-panelItem");
211+ var toItem = findChild(indicatorsRow, indicatorsModel.originalModelData[data.to]["identifier"] + "-panelItem");
210212 verify(toItem !== null);
211213
212214 var fromPosition = indicatorsRow.mapFromItem(fromItem, fromItem.width/2, fromItem.height/2);
@@ -228,12 +230,12 @@ IndicatorTest {
228230 wait_for_expansion_to_settle();
229231
230232 var highlight = findChild(indicatorsRow, "highlight");
231− var item = findChild(indicatorsRow, indicatorsModel.originalModelData[2]["identifier"]+"-panelItem");
233+ var item = findChild(indicatorsRow, indicatorsModel.originalModelData[2]["identifier"] + "-panelItem");
232234 verify(item !== null);
233235 var mappedPosition = indicatorsRow.mapFromItem(item, item.width/2, item.height/2);
234236
235237 mousePress(indicatorsRow, mappedPosition.x, mappedPosition.y);
236− var originalHightlightX = highlight.x
238+ var originalHightlightX = highlight.x;
237239 var offset = 1;
238240 while((highlight.x - originalHightlightX) <= units.gu(0.5) && offset < units.gu(10)) {
239241 mouseMove(indicatorsRow, mappedPosition.x + offset, mappedPosition.y, 10);
@@ -253,12 +255,12 @@ IndicatorTest {
253255 wait_for_expansion_to_settle();
254256
255257 var highlight = findChild(indicatorsRow, "highlight");
256− var item = findChild(indicatorsRow, indicatorsModel.originalModelData[2]["identifier"]+"-panelItem");
258+ var item = findChild(indicatorsRow, indicatorsModel.originalModelData[2]["identifier"] + "-panelItem");
257259 verify(item !== null);
258260 var mappedPosition = indicatorsRow.mapFromItem(item, item.width/2, item.height/2);
259261
260262 mousePress(indicatorsRow, mappedPosition.x, mappedPosition.y);
261− var originalHightlightX = highlight.x
263+ var originalHightlightX = highlight.x;
262264 var offset = 1;
263265 while((highlight.x - originalHightlightX) >= -units.gu(0.5) && offset < units.gu(10)) {
264266 mouseMove(indicatorsRow, mappedPosition.x - offset, mappedPosition.y, 10);
tests/qmltests/Panel/tst_IndicatorPage.qml+6−6
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2013-2014 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -109,7 +109,7 @@ Item {
109109 "submenu": []
110110 }]; // end row 1
111111
112− function initMenuData(data) {
112+ function initializeMenuData(data) {
113113 Indicators.UnityMenuModelCache.setCachedModelData("com.canonical.indicator.test",
114114 "/com/canonical/indicator/test",
115115 "/com/canonical/indicator/test",
@@ -120,7 +120,7 @@ Item {
120120 name: "IndicatorPage"
121121
122122 function init() {
123− initMenuData([]);
123+ initializeMenuData([]);
124124 }
125125
126126 function test_reloadData() {
@@ -128,10 +128,10 @@ Item {
128128
129129 tryCompare(mainMenu, "count", 0);
130130
131− initMenuData(fullMenuData);
131+ initializeMenuData(fullMenuData);
132132 tryCompare(mainMenu, "count", 3);
133133
134− initMenuData([]);
134+ initializeMenuData([]);
135135 tryCompare(mainMenu, "count", 0);
136136 }
137137
@@ -144,7 +144,7 @@ Item {
144144
145145 function test_traverse_rootMenuType(data) {
146146 page.rootMenuType = data.rootMenuType;
147− initMenuData(fullMenuData);
147+ initializeMenuData(fullMenuData);
148148
149149 var mainMenu = findChild(page, "mainMenu");
150150 tryCompare(mainMenu, "count", data.expectedCount);
tests/qmltests/Panel/tst_IndicatorsBar.qml+7−6
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2013-2014 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -121,7 +121,7 @@ IndicatorTest {
121121
122122 // Rough check that expanding a selected item keeps it within the area of the original item.
123123 function test_expandSelectedItem(data) {
124− var dataItem = findChild(indicatorsBar, indicatorsModel.originalModelData[data.index]["identifier"]+"-panelItem");
124+ var dataItem = findChild(indicatorsBar, indicatorsModel.originalModelData[data.index]["identifier"] + "-panelItem");
125125 verify(dataItem !== null);
126126
127127 var mappedPosition = indicatorsBar.mapFromItem(dataItem, dataItem.width/2, dataItem.height/2);
@@ -133,15 +133,16 @@ IndicatorTest {
133133 var mappedRect = indicatorsBar.mapFromItem(dataItem, 0, 0, dataItem.width, dataItem.height);
134134
135135 // mappedPosition contained within mappedRect
136− verify(mappedRect.x <= mappedPosition.x)
137− verify(mappedRect.x + mappedRect.width >= mappedPosition.x)
136+ verify(mappedRect.x <= mappedPosition.x);
137+ verify(mappedRect.x + mappedRect.width >= mappedPosition.x);
138138 }
139139
140140 function test_scrollOffset() {
141141 indicatorsBar.expanded = true;
142142 wait_for_expansion_to_settle();
143143
144− var dataItem = findChild(indicatorsBar, indicatorsModel.originalModelData[indicatorsModel.originalModelData.length-1]["identifier"]+"-panelItem");
144+ var lastItemIndex = indicatorsModel.originalModelData.length-1;
145+ var dataItem = findChild(indicatorsBar, indicatorsModel.originalModelData[lastItemIndex]["identifier"] + "-panelItem");
145146 verify(dataItem !== null);
146147
147148 var row = findChild(indicatorsBar, "indicatorItemRow");
@@ -166,7 +167,7 @@ IndicatorTest {
166167 indicatorsBar.expanded = true;
167168 wait_for_expansion_to_settle();
168169
169− var dataItem = findChild(indicatorsBar, indicatorsModel.originalModelData[data.index]["identifier"]+"-panelItem");
170+ var dataItem = findChild(indicatorsBar, indicatorsModel.originalModelData[data.index]["identifier"] + "-panelItem");
170171 if (indicatorsBar.mapFromItem(dataItem, dataItem.width/2, dataItem.height/2).x < 0) {
171172 skip("Out of bounds");
172173 }
tests/qmltests/Panel/tst_IndicatorsMenu.qml+4−5
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2013-2014 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -103,7 +103,7 @@ IndicatorTest {
103103 }
104104
105105 function get_indicator_item(index) {
106− var indicatorItem = findChild(indicatorsMenu, indicatorsModel.originalModelData[index]["identifier"]+"-panelItem");
106+ var indicatorItem = findChild(indicatorsMenu, indicatorsModel.originalModelData[index]["identifier"] + "-panelItem");
107107 verify(indicatorItem !== null);
108108
109109 return indicatorItem;
@@ -163,14 +163,13 @@ IndicatorTest {
163163 // tests swiping on an indicator item activates the correct item.
164164 function test_swipeForCurrentItem()
165165 {
166− var indicatorItemRow = findChild(indicatorsMenu, "indicatorItemRow")
166+ var indicatorItemRow = findChild(indicatorsMenu, "indicatorItemRow");
167167 verify(indicatorItemRow !== null);
168168
169169 for (var i = 0; i < indicatorsModel.originalModelData.length; i++) {
170170 var indicatorItem = get_indicator_item(i);
171171
172− var mappedPosition = root.mapFromItem(indicatorItem,
173− indicatorItem.width/2, indicatorItem.height/2);
172+ var mappedPosition = root.mapFromItem(indicatorItem, indicatorItem.width/2, indicatorItem.height/2);
174173
175174 touchFlick(indicatorsMenu,
176175 mappedPosition.x, mappedPosition.y,
tests/qmltests/Panel/tst_MenuContent.qml+1−1
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2013-2014 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
tests/qmltests/Panel/tst_Panel.qml+1−1
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2013-2014 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by