Merge lp:~bzoltan/ubuntu-ui-toolkit/landing_120514 into lp:ubuntu-ui-toolkit

Proposed by Zoltan Balogh
Status: Merged
Approved by: Zsombor Egri
Approved revision: 1044
Merged at revision: 1019
Proposed branch: lp:~bzoltan/ubuntu-ui-toolkit/landing_120514
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 479 lines (+171/-43)
19 files modified
components.api (+1/-0)
modules/Ubuntu/Components/Header.qml (+0/-3)
modules/Ubuntu/Components/MainView.qml (+3/-0)
modules/Ubuntu/Components/Page.qml (+7/-0)
modules/Ubuntu/Components/Popups/internalPopupUtils.js (+1/-1)
modules/Ubuntu/Components/TabBar.qml (+1/-1)
modules/Ubuntu/Components/TextArea.qml (+1/-1)
modules/Ubuntu/Components/TextCursor.qml (+5/-3)
modules/Ubuntu/Components/TextField.qml (+4/-5)
modules/Ubuntu/Components/Themes/Ambiance/BubbleShape.qml (+15/-7)
modules/Ubuntu/Components/Themes/Ambiance/NewHeaderStyle.qml (+24/-2)
modules/Ubuntu/Components/Themes/Ambiance/TabBarStyle.qml (+7/-7)
modules/Ubuntu/Components/Themes/Ambiance/TextCursorStyle.qml (+1/-1)
modules/Ubuntu/Components/Themes/Ambiance/TextSelectionEndCursorStyle.qml (+1/-1)
modules/Ubuntu/Components/Themes/Ambiance/TextSelectionStartCursorStyle.qml (+1/-1)
tests/resources/inputs/TextInputs.qml (+6/-0)
tests/resources/navigation/StackWithTabs.qml (+10/-10)
tests/resources/toolbar/headerTextInput.qml (+66/-0)
tests/unit/tst_components/tst_pagestack.qml (+17/-0)
To merge this branch: bzr merge lp:~bzoltan/ubuntu-ui-toolkit/landing_120514
Reviewer Review Type Date Requested Status
Zsombor Egri Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+219179@code.launchpad.net

Commit message

[ Tim Peeters ]
* Make it possible to replace the title in the header with a
  custom Item. Fixes: https://bugs.launchpad.net/bugs/1314948
* Use selectedIndex of the tabs model instead of the TabBar
  everywhere in TabBarStyle to fix a bug that uses Tabs on a
  PageStack. Fixes: https://bugs.launchpad.net/bugs/1316736
* Fix the positioning of a popover pointer on a small screen
  in portrait mode. Fixes: https://bugs.launchpad.net/bugs/1208833

[ Christian Dywan ]
* Export to load modules from source and allow arguments.
* linearSecondsPicker check it's not resetting and
  count is correct

[ Zsombor Egri ]
* Text input caret positioning fix for the cases when TextField
  has overlay primary items and when RTL is enabled.

Description of the change

[ Tim Peeters ]
* Make it possible to replace the title in the header with a
  custom Item. Fixes: https://bugs.launchpad.net/bugs/1314948
* Use selectedIndex of the tabs model instead of the TabBar
  everywhere in TabBarStyle to fix a bug that uses Tabs on a
  PageStack. Fixes: https://bugs.launchpad.net/bugs/1316736
* Fix the positioning of a popover pointer on a small screen
  in portrait mode. Fixes: https://bugs.launchpad.net/bugs/1208833

[ Christian Dywan ]
* Export to load modules from source and allow arguments.
* linearSecondsPicker check it's not resetting and
  count is correct

[ Zsombor Egri ]
* Text input caret positioning fix for the cases when TextField
  has overlay primary items and when RTL is enabled.

To post a comment you must log in.
1044. By Tim Peeters

merge trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Zsombor Egri (zsombi) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'components.api'
--- components.api 2014-05-06 12:15:15 +0000
+++ components.api 2014-05-12 12:41:11 +0000
@@ -235,6 +235,7 @@
235Page 0.1 1.0235Page 0.1 1.0
236PageTreeNode236PageTreeNode
237 property string title237 property string title
238 property Item __customHeaderContents
238 property Flickable flickable239 property Flickable flickable
239 property list<Action> actions240 property list<Action> actions
240PageStack 0.1 1.0241PageStack 0.1 1.0
241242
=== modified file 'modules/Ubuntu/Components/Header.qml'
--- modules/Ubuntu/Components/Header.qml 2014-05-02 11:09:58 +0000
+++ modules/Ubuntu/Components/Header.qml 2014-05-12 12:41:11 +0000
@@ -78,13 +78,10 @@
78 }78 }
7979
80 /*!80 /*!
81 \deprecated
82 The contents of the header. If this is set, \l title will be ignored.81 The contents of the header. If this is set, \l title will be ignored.
83 This property is now DEPRECATED. Set tabsModel to show tabs navigation in header.
84 */82 */
85 property Item contents: null83 property Item contents: null
86 onContentsChanged: {84 onContentsChanged: {
87 print("Header.contents property is now DEPRECATED. Set tabsModel to show tabs navigation.");
88 header.show();85 header.show();
89 }86 }
9087
9188
=== modified file 'modules/Ubuntu/Components/MainView.qml'
--- modules/Ubuntu/Components/MainView.qml 2014-05-02 14:02:40 +0000
+++ modules/Ubuntu/Components/MainView.qml 2014-05-12 12:41:11 +0000
@@ -348,6 +348,9 @@
348 internal.activePage.tools.back.hasOwnProperty("action") ?348 internal.activePage.tools.back.hasOwnProperty("action") ?
349 internal.activePage.tools.back.action : null349 internal.activePage.tools.back.action : null
350350
351 contents: internal.activePage ?
352 internal.activePage.__customHeaderContents : null
353
351 property Item tabBar: null354 property Item tabBar: null
352 Binding {355 Binding {
353 target: headerItem356 target: headerItem
354357
=== modified file 'modules/Ubuntu/Components/Page.qml'
--- modules/Ubuntu/Components/Page.qml 2014-05-02 10:26:18 +0000
+++ modules/Ubuntu/Components/Page.qml 2014-05-12 12:41:11 +0000
@@ -89,6 +89,13 @@
89 property Item tools: ToolbarItems { }89 property Item tools: ToolbarItems { }
9090
91 /*!91 /*!
92 \internal
93 Set this property to replace the title label in the header by any Item.
94 It will be automatically anchored to fill the title space in the header.
95 */
96 property Item __customHeaderContents: null
97
98 /*!
92 Optional flickable that controls the header. This property99 Optional flickable that controls the header. This property
93 is automatically set to the first child of the page that is Flickable100 is automatically set to the first child of the page that is Flickable
94 and anchors to the top of the page or fills the page. For example:101 and anchors to the top of the page or fills the page. For example:
95102
=== modified file 'modules/Ubuntu/Components/Popups/internalPopupUtils.js'
--- modules/Ubuntu/Components/Popups/internalPopupUtils.js 2013-07-13 03:11:26 +0000
+++ modules/Ubuntu/Components/Popups/internalPopupUtils.js 2014-05-12 12:41:11 +0000
@@ -154,7 +154,7 @@
154 if (simplePos.checkVerticalPosition(foreground, ycoord, 0, area.height/4)) {154 if (simplePos.checkVerticalPosition(foreground, ycoord, 0, area.height/4)) {
155 foreground.y = ycoord;155 foreground.y = ycoord;
156 pointer.direction = "up";156 pointer.direction = "up";
157 pointer.y = this.above(null, callerMargins, caller);157 pointer.y = this.below(null, callerMargins, caller);
158 pointer.x = this.closestToHorizontalCenter(pointerTarget, pointer.horizontalMargin);158 pointer.x = this.closestToHorizontalCenter(pointerTarget, pointer.horizontalMargin);
159 return;159 return;
160 }160 }
161161
=== modified file 'modules/Ubuntu/Components/TabBar.qml'
--- modules/Ubuntu/Components/TabBar.qml 2014-04-24 17:44:56 +0000
+++ modules/Ubuntu/Components/TabBar.qml 2014-05-12 12:41:11 +0000
@@ -151,7 +151,7 @@
151151
152 if (model.count > 0) {152 if (model.count > 0) {
153 if (internal.checkRoles()) {153 if (internal.checkRoles()) {
154 model.selectedIndex = Math.max(Math.min(tabBar.selectedIndex, model.count - 1), 0);154 model.selectedIndex = Math.max(Math.min(model.selectedIndex, model.count - 1), 0);
155 }155 }
156 } else {156 } else {
157 internal.modelChecked = false;157 internal.modelChecked = false;
158158
=== modified file 'modules/Ubuntu/Components/TextArea.qml'
--- modules/Ubuntu/Components/TextArea.qml 2014-05-02 12:00:30 +0000
+++ modules/Ubuntu/Components/TextArea.qml 2014-05-12 12:41:11 +0000
@@ -875,7 +875,7 @@
875 input: editor875 input: editor
876 flickable: flicker876 flickable: flicker
877 selectionModeTimeout: control.__styleInstance.selectionModeTimeout877 selectionModeTimeout: control.__styleInstance.selectionModeTimeout
878 frameDistance: Qt.point(internal.frameSpacing, internal.frameSpacing)878 frameDistance: Qt.point(flicker.x, flicker.y)
879 }879 }
880 }880 }
881 }881 }
882882
=== modified file 'modules/Ubuntu/Components/TextCursor.qml'
--- modules/Ubuntu/Components/TextCursor.qml 2014-05-06 09:20:16 +0000
+++ modules/Ubuntu/Components/TextCursor.qml 2014-05-12 12:41:11 +0000
@@ -199,9 +199,11 @@
199 // positions caret to the dragged position199 // positions caret to the dragged position
200 function positionCaret() {200 function positionCaret() {
201 if (dragger.drag.active) {201 if (dragger.drag.active) {
202 handler.positionCaret(positionProperty,202 var dx = dragger.thumbStartX + dragger.dragAmountX + handler.flickable.contentX;
203 dragger.thumbStartX + dragger.dragAmountX + handler.flickable.contentX,203 var dy = dragger.thumbStartY + dragger.dragAmountY + handler.flickable.contentY;
204 dragger.thumbStartY + dragger.dragAmountY + handler.flickable.contentY);204 // consider only the x-distance because of the overlays
205 dx -= handler.frameDistance.x;
206 handler.positionCaret(positionProperty, dx, dy);
205 }207 }
206 }208 }
207 }209 }
208210
=== modified file 'modules/Ubuntu/Components/TextField.qml'
--- modules/Ubuntu/Components/TextField.qml 2014-05-02 12:00:30 +0000
+++ modules/Ubuntu/Components/TextField.qml 2014-05-12 12:41:11 +0000
@@ -1006,12 +1006,11 @@
1006 flickable: flicker1006 flickable: flicker
1007 selectionModeTimeout: control.__styleInstance.selectionModeTimeout1007 selectionModeTimeout: control.__styleInstance.selectionModeTimeout
1008 /*1008 /*
1009 In x direction we use 2 times the configured spacing, as we have1009 In x direction we use the Flickable x position as we can have overlays
1010 both the overlay and the Flickable aligned with margins. On y1010 which can shift the cursor caret. On y direction we only use the topMargin
1011 direction we only use the simple spacing, the Flickable moves the1011 spacing.
1012 top downwards.
1013 */1012 */
1014 frameDistance: Qt.point(2 * internal.spacing, internal.spacing)1013 frameDistance: Qt.point(flicker.x, flicker.topMargin)
1015 }1014 }
1016 }1015 }
1017 }1016 }
10181017
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/BubbleShape.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/BubbleShape.qml 2014-04-23 08:50:20 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/BubbleShape.qml 2014-05-12 12:41:11 +0000
@@ -137,16 +137,24 @@
137 id: arrow137 id: arrow
138138
139 visible: bubbleShape.direction != "none"139 visible: bubbleShape.direction != "none"
140 property var directionToRotation: {"down": 0,140
141 "up": 180,141 function directionToRotation(direction) {
142 "left": 90,142 switch (direction) {
143 "right": -90,143 case "up":
144 "none": 0144 return 180;
145 }145 case "left":
146 return 90;
147 case "right":
148 return -90;
149 default: // "down" or "none"
150 return 0;
151 }
152 }
153
146 x: -width / 2.0154 x: -width / 2.0
147 y: -height155 y: -height
148 transformOrigin: Item.Bottom156 transformOrigin: Item.Bottom
149 rotation: directionToRotation[bubbleShape.direction]157 rotation: directionToRotation(bubbleShape.direction)
150 source: "artwork/bubble_arrow.png"158 source: "artwork/bubble_arrow.png"
151 }159 }
152 }160 }
153161
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/NewHeaderStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/NewHeaderStyle.qml 2014-05-02 11:15:25 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/NewHeaderStyle.qml 2014-05-12 12:41:11 +0000
@@ -152,23 +152,45 @@
152 left: leftButtonContainer.right152 left: leftButtonContainer.right
153 right: actionsContainer.left153 right: actionsContainer.left
154 top: parent.top154 top: parent.top
155 // don't keep a margin if there is already a button with spacing
156 leftMargin: leftButtonContainer.width > 0 ? 0 : headerStyle.textLeftMargin
155 }157 }
156 height: headerStyle.contentHeight158 height: headerStyle.contentHeight
157159
158 Label {160 Label {
159 LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft161 LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
160162
163 visible: !styledItem.contents
161 anchors {164 anchors {
162 left: parent.left165 left: parent.left
163 verticalCenter: parent.verticalCenter166 verticalCenter: parent.verticalCenter
164 // don't keep a margin if there is already a button with spacing
165 leftMargin: leftButtonContainer.width > 0 ? 0 : headerStyle.textLeftMargin
166 }167 }
167 text: styledItem.title168 text: styledItem.title
168 font.weight: headerStyle.fontWeight169 font.weight: headerStyle.fontWeight
169 fontSize: headerStyle.fontSize170 fontSize: headerStyle.fontSize
170 color: headerStyle.textColor171 color: headerStyle.textColor
171 }172 }
173
174 Item {
175 // This Item is used to make the custom header item invisible
176 // when styledItem.contents is unset and its parent is not updated
177 // when the bindings below is no longer active
178 id: contentsContainer
179 anchors.fill: parent
180 visible: styledItem.contents
181 }
182 Binding {
183 target: styledItem.contents
184 property: "anchors.fill"
185 value: contentsContainer
186 when: styledItem.contents
187 }
188 Binding {
189 target: styledItem.contents
190 property: "parent"
191 value: contentsContainer
192 when: styledItem.contents
193 }
172 }194 }
173195
174 Row {196 Row {
175197
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/TabBarStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/TabBarStyle.qml 2014-04-24 17:44:56 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/TabBarStyle.qml 2014-05-12 12:41:11 +0000
@@ -59,7 +59,7 @@
59 automaytically through ListModel changes.59 automaytically through ListModel changes.
60 */60 */
61 function sync() {61 function sync() {
62 buttonView.selectButton(styledItem.selectedIndex);62 buttonView.selectButton(styledItem.model.selectedIndex);
63 }63 }
6464
65 property var tabsModel : styledItem ? styledItem.model : null65 property var tabsModel : styledItem ? styledItem.model : null
@@ -69,14 +69,14 @@
6969
70 onSelectionModeChanged: {70 onSelectionModeChanged: {
71 if (!styledItem.selectionMode) {71 if (!styledItem.selectionMode) {
72 buttonView.selectButton(styledItem.selectedIndex);72 buttonView.selectButton(styledItem.model.selectedIndex);
73 }73 }
74 }74 }
75 }75 }
7676
77 Connections {77 Connections {
78 target: styledItem78 target: styledItem.model
79 onSelectedIndexChanged: buttonView.selectButton(styledItem.selectedIndex)79 onSelectedIndexChanged: buttonView.selectButton(styledItem.model.selectedIndex)
80 }80 }
8181
82 /*82 /*
@@ -126,7 +126,7 @@
126 // to avoid seeing fading animations of the unselected button when switching126 // to avoid seeing fading animations of the unselected button when switching
127 // tabs from outside the tab bar.127 // tabs from outside the tab bar.
128 property bool selected: (styledItem.selectionMode && buttonView.needsScrolling) ?128 property bool selected: (styledItem.selectionMode && buttonView.needsScrolling) ?
129 styledItem.selectedIndex === index :129 styledItem.model.selectedIndex === index :
130 buttonView.selectedButtonIndex === button.buttonIndex130 buttonView.selectedButtonIndex === button.buttonIndex
131 property real offset: theRow.rowNumber + 1 - button.x / theRow.width;131 property real offset: theRow.rowNumber + 1 - button.x / theRow.width;
132 property int buttonIndex: index + theRow.rowNumber*repeater.count132 property int buttonIndex: index + theRow.rowNumber*repeater.count
@@ -171,9 +171,9 @@
171 // The indicator image must be visible after the selected tab button, when the171 // The indicator image must be visible after the selected tab button, when the
172 // tab bar is not in selection mode, or after the "last" button (starting with172 // tab bar is not in selection mode, or after the "last" button (starting with
173 // the selected one), when the tab bar is in selection mode.173 // the selected one), when the tab bar is in selection mode.
174 property bool isLastAfterSelected: index === (styledItem.selectedIndex === 0 ?174 property bool isLastAfterSelected: index === (styledItem.model.selectedIndex === 0 ?
175 repeater.count-1 :175 repeater.count-1 :
176 styledItem.selectedIndex - 1)176 styledItem.model.selectedIndex - 1)
177 opacity: (styledItem.selectionMode ? isLastAfterSelected : selected) ? 1 : 0177 opacity: (styledItem.selectionMode ? isLastAfterSelected : selected) ? 1 : 0
178 Behavior on opacity {178 Behavior on opacity {
179 NumberAnimation {179 NumberAnimation {
180180
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/TextCursorStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/TextCursorStyle.qml 2014-05-06 09:20:16 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/TextCursorStyle.qml 2014-05-12 12:41:11 +0000
@@ -75,7 +75,7 @@
75 top: parent.bottom75 top: parent.bottom
76 horizontalCenter: parent.horizontalCenter76 horizontalCenter: parent.horizontalCenter
77 topMargin: -units.gu(0.5)77 topMargin: -units.gu(0.5)
78 horizontalCenterOffset: units.gu(0.7)78 horizontalCenterOffset: LayoutMirroring.enabled ? -units.gu(0.7) : units.gu(0.7)
79 }79 }
80 }80 }
81}81}
8282
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/TextSelectionEndCursorStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/TextSelectionEndCursorStyle.qml 2014-05-06 09:20:16 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/TextSelectionEndCursorStyle.qml 2014-05-12 12:41:11 +0000
@@ -60,7 +60,7 @@
60 top: parent.bottom60 top: parent.bottom
61 horizontalCenter: parent.horizontalCenter61 horizontalCenter: parent.horizontalCenter
62 topMargin: -units.gu(0.5)62 topMargin: -units.gu(0.5)
63 horizontalCenterOffset: units.gu(0.7)63 horizontalCenterOffset: LayoutMirroring.enabled ? -units.gu(0.7) : units.gu(0.7)
64 }64 }
65 }65 }
66}66}
6767
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/TextSelectionStartCursorStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/TextSelectionStartCursorStyle.qml 2014-05-06 09:20:16 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/TextSelectionStartCursorStyle.qml 2014-05-12 12:41:11 +0000
@@ -60,7 +60,7 @@
60 top: parent.bottom60 top: parent.bottom
61 horizontalCenter: parent.horizontalCenter61 horizontalCenter: parent.horizontalCenter
62 topMargin: -units.gu(0.5)62 topMargin: -units.gu(0.5)
63 horizontalCenterOffset: -units.gu(0.7)63 horizontalCenterOffset: LayoutMirroring.enabled ? -(units.gu(0.7) - caretItem.width) : units.gu(0.7)
64 }64 }
65 }65 }
66}66}
6767
=== modified file 'tests/resources/inputs/TextInputs.qml'
--- tests/resources/inputs/TextInputs.qml 2014-05-02 12:00:30 +0000
+++ tests/resources/inputs/TextInputs.qml 2014-05-12 12:41:11 +0000
@@ -48,6 +48,12 @@
48 id: field48 id: field
49 objectName: "Standard"49 objectName: "Standard"
50 width: units.gu(30)50 width: units.gu(30)
51 primaryItem: Icon {
52 width: height
53 height: parent.height - units.gu(1)
54 name: "search"
55 }
56
51 text: "The orange (specifically, the sweet orange) is the fruit of the citrus species Citrus × ​sinensis in the family Rutaceae."57 text: "The orange (specifically, the sweet orange) is the fruit of the citrus species Citrus × ​sinensis in the family Rutaceae."
52 }58 }
53 Button {59 Button {
5460
=== modified file 'tests/resources/navigation/StackWithTabs.qml'
--- tests/resources/navigation/StackWithTabs.qml 2014-04-28 15:39:24 +0000
+++ tests/resources/navigation/StackWithTabs.qml 2014-05-12 12:41:11 +0000
@@ -32,16 +32,6 @@
32 Tab {32 Tab {
33 title: "Tab 1"33 title: "Tab 1"
34 page: Page {34 page: Page {
35 Button {
36 anchors.centerIn: parent
37 onClicked: pageStack.push(page3)
38 text: "Press"
39 }
40 }
41 }
42 Tab {
43 title: "Tab 2"
44 page: Page {
45 Column {35 Column {
46 anchors {36 anchors {
47 centerIn: parent37 centerIn: parent
@@ -76,6 +66,16 @@
76 }66 }
77 }67 }
78 }68 }
69 Tab {
70 title: "Tab 2"
71 page: Page {
72 Button {
73 anchors.centerIn: parent
74 onClicked: pageStack.push(page3)
75 text: "Press"
76 }
77 }
78 }
79 }79 }
80 Page {80 Page {
81 id: page381 id: page3
8282
=== added file 'tests/resources/toolbar/headerTextInput.qml'
--- tests/resources/toolbar/headerTextInput.qml 1970-01-01 00:00:00 +0000
+++ tests/resources/toolbar/headerTextInput.qml 2014-05-12 12:41:11 +0000
@@ -0,0 +1,66 @@
1/*
2 * Copyright (C) 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.1
19
20MainView {
21 width: units.gu(50)
22 height: units.gu(80)
23 useDeprecatedToolbar: false
24
25 Page {
26 title: "test page"
27
28 id: page
29
30 __customHeaderContents: Item {
31 TextField {
32 anchors {
33 left: parent.left
34 verticalCenter: parent.verticalCenter
35 }
36 }
37 }
38
39 Label {
40 anchors.centerIn: parent
41 text: "Hello, world"
42 }
43
44 tools: ToolbarItems {
45 ToolbarButton {
46 action: Action {
47 iconName: "contact"
48 text: "oh"
49 onTriggered: print("lala")
50 enabled: false
51 }
52 }
53
54 back: ToolbarButton {
55 action: Action {
56 text: "cancel"
57 iconName: "cancel"
58 onTriggered: {
59 page.__customHeaderContents = null;
60 }
61 }
62 anchors.verticalCenter: parent.verticalCenter
63 }
64 }
65 }
66}
067
=== modified file 'tests/unit/tst_components/tst_pagestack.qml'
--- tests/unit/tst_components/tst_pagestack.qml 2014-04-25 05:28:37 +0000
+++ tests/unit/tst_components/tst_pagestack.qml 2014-05-12 12:41:11 +0000
@@ -96,6 +96,17 @@
96 pageStack.clear();96 pageStack.clear();
97 }97 }
9898
99 function test_pop_to_tabs_bug1316736() {
100 pageStack.push(tabs);
101 tabs.selectedTabIndex = 1;
102 pageStack.push(page1);
103 compare(tabs.active, false, "Tabs on a PageStack, but not on top, are inactive");
104 pageStack.pop();
105 compare(tabs.active, true, "Tabs on top of PageStack is active");
106 compare(tabs.selectedTabIndex, 1, "Pushing and popping another page on top of Tabs does not change selectedTabsIndex");
107 pageStack.clear();
108 }
109
99 MainView {110 MainView {
100 id: mainView111 id: mainView
101 PageStack {112 PageStack {
@@ -119,5 +130,11 @@
119130
120 Tabs {131 Tabs {
121 id: tabs132 id: tabs
133 Tab {
134 id: tab1
135 }
136 Tab {
137 id: tab2
138 }
122 }139 }
123}140}

Subscribers

People subscribed via source and target branches

to status/vote changes: