Merge lp:~tpeeters/ubuntu-ui-toolkit/back-in-header into lp:ubuntu-ui-toolkit

Proposed by Tim Peeters
Status: Work in progress
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/back-in-header
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 110 lines (+48/-3)
4 files modified
modules/Ubuntu/Components/Header.qml (+3/-0)
modules/Ubuntu/Components/MainView.qml (+9/-0)
modules/Ubuntu/Components/Themes/Ambiance/HeaderStyle.qml (+33/-2)
modules/Ubuntu/Components/ToolbarItems.qml (+3/-1)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/back-in-header
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu SDK team Pending
Review via email: mp+202471@code.launchpad.net

Description of the change

Don't review yet, I just need to see the diff

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Zsombor Egri (zsombi) wrote :

Then should be set to work-in-progress

Unmerged revisions

889. By Tim Peeters

merge trunk

888. By Tim Peeters

remove test program that was meant for another branch

887. By Tim Peeters

add test program

886. By Tim Peeters

lock empty toolbar even when there is back

885. By Tim Peeters

adjust text margin if there are controls

884. By Tim Peeters

move the back button to the header

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'modules/Ubuntu/Components/Header.qml'
--- modules/Ubuntu/Components/Header.qml 2014-01-09 12:02:58 +0000
+++ modules/Ubuntu/Components/Header.qml 2014-01-21 14:52:29 +0000
@@ -85,6 +85,9 @@
85 property Item contents: null85 property Item contents: null
86 onContentsChanged: header.show()86 onContentsChanged: header.show()
8787
88 // TODO TIM: description
89 property Item controls: null
90
88 /*!91 /*!
89 The flickable that controls the movement of the header.92 The flickable that controls the movement of the header.
90 Will be set automatically by Pages inside a MainView, but can93 Will be set automatically by Pages inside a MainView, but can
9194
=== modified file 'modules/Ubuntu/Components/MainView.qml'
--- modules/Ubuntu/Components/MainView.qml 2013-12-05 17:28:54 +0000
+++ modules/Ubuntu/Components/MainView.qml 2014-01-21 14:52:29 +0000
@@ -321,6 +321,15 @@
321 property real bottomY: headerItem.y + headerItem.height321 property real bottomY: headerItem.y + headerItem.height
322 animate: canvas.animate322 animate: canvas.animate
323323
324 Binding {
325 target: header
326 property: "controls"
327 when: mainView.activeLeafNode && mainView.activeLeafNode.hasOwnProperty("tools") &&
328 mainView.activeLeafNode.tools && mainView.activeLeafNode.tools.hasOwnProperty("back") &&
329 mainView.activeLeafNode.tools.back && mainView.activeLeafNode.tools.back.visible
330 value: mainView.activeLeafNode.tools.back
331 }
332
324 property Item tabBar: null333 property Item tabBar: null
325 Binding {334 Binding {
326 target: headerItem335 target: headerItem
327336
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/HeaderStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/HeaderStyle.qml 2013-11-12 06:41:24 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/HeaderStyle.qml 2014-01-21 14:52:29 +0000
@@ -39,7 +39,7 @@
39 property int fontWeight: Font.Light39 property int fontWeight: Font.Light
40 property string fontSize: "x-large"40 property string fontSize: "x-large"
41 property color textColor: Theme.palette.selected.backgroundText41 property color textColor: Theme.palette.selected.backgroundText
42 property real textLeftMargin: units.gu(2)42 property real textLeftMargin: styledItem.controls ? 0 : units.gu(2)
4343
44 implicitHeight: headerStyle.contentHeight + separator.height + separatorBottom.height44 implicitHeight: headerStyle.contentHeight + separator.height + separatorBottom.height
4545
@@ -63,9 +63,40 @@
63 }63 }
6464
65 Item {65 Item {
66 id: controlContainer
67 anchors {
68 left: parent.left
69 top: parent.top
70 }
71 height: headerStyle.contentHeight
72 width: styledItem.controls ? styledItem.controls.width : 0
73
74 Binding {
75 target: styledItem.controls
76 property: "parent"
77 value: controlContainer
78 when: styledItem.controls
79 }
80
81 // Compensate for the lack of a MouseArea in the ToolbarButton by
82 // adding a MouseArea on top of it.
83 MouseArea {
84 // FIXME: Currently this only works if the controls is a single
85 // ToolbarButton. To support multiple controls, use a similar
86 // detection of the clicked item as in Panel.qml.
87 anchors.fill: parent
88 onClicked: {
89 styledItem.controls.trigger();
90 }
91 visible: styledItem.controls && styledItem.controls.hasOwnProperty("trigger") &&
92 !styledItem.controls.hasOwnProperty("clicked")
93 }
94 }
95
96 Item {
66 id: foreground97 id: foreground
67 anchors {98 anchors {
68 left: parent.left99 left: controlContainer.right
69 right: parent.right100 right: parent.right
70 top: parent.top101 top: parent.top
71 }102 }
72103
=== modified file 'modules/Ubuntu/Components/ToolbarItems.qml'
--- modules/Ubuntu/Components/ToolbarItems.qml 2013-11-06 22:52:15 +0000
+++ modules/Ubuntu/Components/ToolbarItems.qml 2014-01-21 14:52:29 +0000
@@ -175,7 +175,7 @@
175 Determine whether this ToolbarItems has any visible Items175 Determine whether this ToolbarItems has any visible Items
176 */176 */
177 function hasVisibleItems() {177 function hasVisibleItems() {
178 if (back && back.visible) return true;178// if (back && back.visible) return true;
179 for (var i=0; i < toolsContainer.children.length; i++) {179 for (var i=0; i < toolsContainer.children.length; i++) {
180 if (toolsContainer.children[i].visible) return true;180 if (toolsContainer.children[i].visible) return true;
181 }181 }
@@ -197,6 +197,8 @@
197 // when toolbarItems.back is updated.197 // when toolbarItems.back is updated.
198 property Item previousBackItem: null198 property Item previousBackItem: null
199199
200 // FIXME TIM: Don't set the parent of backItem to be the backContainer if the
201 // back item is in the header. Why not use a Connection for this?
200 function updateBackItem() {202 function updateBackItem() {
201 if (backContainer.previousBackItem) backContainer.previousBackItem.parent = null;203 if (backContainer.previousBackItem) backContainer.previousBackItem.parent = null;
202 backContainer.previousBackItem = toolbarItems.back;204 backContainer.previousBackItem = toolbarItems.back;

Subscribers

People subscribed via source and target branches

to status/vote changes: