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
1=== modified file 'modules/Ubuntu/Components/Header.qml'
2--- modules/Ubuntu/Components/Header.qml 2014-01-09 12:02:58 +0000
3+++ modules/Ubuntu/Components/Header.qml 2014-01-21 14:52:29 +0000
4@@ -85,6 +85,9 @@
5 property Item contents: null
6 onContentsChanged: header.show()
7
8+ // TODO TIM: description
9+ property Item controls: null
10+
11 /*!
12 The flickable that controls the movement of the header.
13 Will be set automatically by Pages inside a MainView, but can
14
15=== modified file 'modules/Ubuntu/Components/MainView.qml'
16--- modules/Ubuntu/Components/MainView.qml 2013-12-05 17:28:54 +0000
17+++ modules/Ubuntu/Components/MainView.qml 2014-01-21 14:52:29 +0000
18@@ -321,6 +321,15 @@
19 property real bottomY: headerItem.y + headerItem.height
20 animate: canvas.animate
21
22+ Binding {
23+ target: header
24+ property: "controls"
25+ when: mainView.activeLeafNode && mainView.activeLeafNode.hasOwnProperty("tools") &&
26+ mainView.activeLeafNode.tools && mainView.activeLeafNode.tools.hasOwnProperty("back") &&
27+ mainView.activeLeafNode.tools.back && mainView.activeLeafNode.tools.back.visible
28+ value: mainView.activeLeafNode.tools.back
29+ }
30+
31 property Item tabBar: null
32 Binding {
33 target: headerItem
34
35=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/HeaderStyle.qml'
36--- modules/Ubuntu/Components/Themes/Ambiance/HeaderStyle.qml 2013-11-12 06:41:24 +0000
37+++ modules/Ubuntu/Components/Themes/Ambiance/HeaderStyle.qml 2014-01-21 14:52:29 +0000
38@@ -39,7 +39,7 @@
39 property int fontWeight: Font.Light
40 property string fontSize: "x-large"
41 property color textColor: Theme.palette.selected.backgroundText
42- property real textLeftMargin: units.gu(2)
43+ property real textLeftMargin: styledItem.controls ? 0 : units.gu(2)
44
45 implicitHeight: headerStyle.contentHeight + separator.height + separatorBottom.height
46
47@@ -63,9 +63,40 @@
48 }
49
50 Item {
51+ id: controlContainer
52+ anchors {
53+ left: parent.left
54+ top: parent.top
55+ }
56+ height: headerStyle.contentHeight
57+ width: styledItem.controls ? styledItem.controls.width : 0
58+
59+ Binding {
60+ target: styledItem.controls
61+ property: "parent"
62+ value: controlContainer
63+ when: styledItem.controls
64+ }
65+
66+ // Compensate for the lack of a MouseArea in the ToolbarButton by
67+ // adding a MouseArea on top of it.
68+ MouseArea {
69+ // FIXME: Currently this only works if the controls is a single
70+ // ToolbarButton. To support multiple controls, use a similar
71+ // detection of the clicked item as in Panel.qml.
72+ anchors.fill: parent
73+ onClicked: {
74+ styledItem.controls.trigger();
75+ }
76+ visible: styledItem.controls && styledItem.controls.hasOwnProperty("trigger") &&
77+ !styledItem.controls.hasOwnProperty("clicked")
78+ }
79+ }
80+
81+ Item {
82 id: foreground
83 anchors {
84- left: parent.left
85+ left: controlContainer.right
86 right: parent.right
87 top: parent.top
88 }
89
90=== modified file 'modules/Ubuntu/Components/ToolbarItems.qml'
91--- modules/Ubuntu/Components/ToolbarItems.qml 2013-11-06 22:52:15 +0000
92+++ modules/Ubuntu/Components/ToolbarItems.qml 2014-01-21 14:52:29 +0000
93@@ -175,7 +175,7 @@
94 Determine whether this ToolbarItems has any visible Items
95 */
96 function hasVisibleItems() {
97- if (back && back.visible) return true;
98+// if (back && back.visible) return true;
99 for (var i=0; i < toolsContainer.children.length; i++) {
100 if (toolsContainer.children[i].visible) return true;
101 }
102@@ -197,6 +197,8 @@
103 // when toolbarItems.back is updated.
104 property Item previousBackItem: null
105
106+ // FIXME TIM: Don't set the parent of backItem to be the backContainer if the
107+ // back item is in the header. Why not use a Connection for this?
108 function updateBackItem() {
109 if (backContainer.previousBackItem) backContainer.previousBackItem.parent = null;
110 backContainer.previousBackItem = toolbarItems.back;

Subscribers

People subscribed via source and target branches

to status/vote changes: