Merge lp:~aacid/unity8/new-scopes-scope-activation into lp:~unity-team/unity8/new-scopes

Proposed by Albert Astals Cid
Status: Superseded
Proposed branch: lp:~aacid/unity8/new-scopes-scope-activation
Merge into: lp:~unity-team/unity8/new-scopes
Diff against target: 276 lines (+177/-6)
4 files modified
qml/Dash/Dash.qml (+44/-2)
qml/Dash/DashContent.qml (+21/-4)
qml/Dash/PreviewListView.qml (+1/-0)
qml/Dash/ScopeItem.qml (+111/-0)
To merge this branch: bzr merge lp:~aacid/unity8/new-scopes-scope-activation
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+206958@code.launchpad.net

This proposal has been superseded by a proposal from 2014-02-18.

Commit message

Scope activation support

To post a comment you must log in.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qml/Dash/Dash.qml'
--- qml/Dash/Dash.qml 2014-01-09 09:05:57 +0000
+++ qml/Dash/Dash.qml 2014-02-18 15:14:40 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2013 Canonical, Ltd.2 * Copyright (C) 2013, 2014 Canonical, Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * 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 by5 * it under the terms of the GNU General Public License as published by
@@ -62,10 +62,19 @@
62 DashContent {62 DashContent {
63 id: dashContent63 id: dashContent
64 objectName: "dashContent"64 objectName: "dashContent"
65 anchors.fill: parent65 width: parent.width
66 height: parent.height
66 model: filteredScopes67 model: filteredScopes
67 scopes: scopes68 scopes: scopes
68 searchHistory: dash.searchHistory69 searchHistory: dash.searchHistory
70 visible: x != -width
71 onGotoScope: {
72 dash.setCurrentScope(scopeId, true, false);
73 }
74 onOpenScope: {
75 scopeItem.scope = scope;
76 x = -width;
77 }
69 onScopeLoaded: {78 onScopeLoaded: {
70 if (scopeId == dash.showScopeOnLoaded) {79 if (scopeId == dash.showScopeOnLoaded) {
71 dash.setCurrentScope(scopeId, false, false)80 dash.setCurrentScope(scopeId, false, false)
@@ -74,5 +83,38 @@
74 }83 }
75 scale: dash.contentScale84 scale: dash.contentScale
76 clip: scale != 1.085 clip: scale != 1.0
86 Behavior on x {
87 UbuntuNumberAnimation {
88 onStopped: {
89 if (dashContent.x == 0) {
90 dashContent.closeScope(scopeItem.scope);
91 scopeItem.scope = null;
92 }
93 }
94 }
95 }
96 }
97
98 ScopeItem {
99 id: scopeItem
100 anchors.left: dashContent.right
101 width: parent.width
102 height: parent.height
103 searchHistory: dash.searchHistory
104 scale: dash.contentScale
105 clip: scale != 1.0
106 visible: scope != null
107 onBack: {
108 dashContent.x = 0;
109 }
110 onGotoScope: {
111 // TODO
112 console.log("gotoScope from an openScope scope is not implemented");
113 }
114 onOpenScope: {
115 // TODO
116 console.log("openScope from an openScope scope is not implemented");
117 }
118
77 }119 }
78}120}
79121
=== modified file 'qml/Dash/DashContent.qml'
--- qml/Dash/DashContent.qml 2014-02-14 15:36:43 +0000
+++ qml/Dash/DashContent.qml 2014-02-18 15:14:40 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2013 Canonical, Ltd.2 * Copyright (C) 2013, 2014 Canonical, Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * 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 by5 * it under the terms of the GNU General Public License as published by
@@ -36,6 +36,8 @@
36 signal contentEndReached()36 signal contentEndReached()
37 signal scopeLoaded(string scopeId)37 signal scopeLoaded(string scopeId)
38 signal positionedAtBeginning()38 signal positionedAtBeginning()
39 signal gotoScope(string scopeId)
40 signal openScope(var scope)
3941
40 // If we set the current scope index before the scopes have been added,42 // If we set the current scope index before the scopes have been added,
41 // then we need to wait until the loaded signals gets emitted from the scopes43 // then we need to wait until the loaded signals gets emitted from the scopes
@@ -80,6 +82,10 @@
80 }82 }
81 }83 }
8284
85 function closeScope(scope) {
86 dashContentList.currentItem.theScope.closeScope(scope)
87 }
88
83 Item {89 Item {
84 id: dashContentListHolder90 id: dashContentListHolder
85 anchors.fill: parent91 anchors.fill: parent
@@ -136,8 +142,8 @@
136 onLoaded: {142 onLoaded: {
137 item.scope = Qt.binding(function() { return scope })143 item.scope = Qt.binding(function() { return scope })
138 item.isCurrent = Qt.binding(function() { return visible && ListView.isCurrentItem })144 item.isCurrent = Qt.binding(function() { return visible && ListView.isCurrentItem })
139 item.tabBarHeight = pageHeader.implicitHeight;145 item.tabBarHeight = dashPageHeader.implicitHeight;
140 item.pageHeader = pageHeader;146 item.pageHeader = dashPageHeader;
141 item.openEffect = openEffect;147 item.openEffect = openEffect;
142 item.previewListView = previewListView;148 item.previewListView = previewListView;
143 dashContentList.movementStarted.connect(item.movementStarted)149 dashContentList.movementStarted.connect(item.movementStarted)
@@ -149,13 +155,23 @@
149 ignoreUnknownSignals: true155 ignoreUnknownSignals: true
150 onEndReached: contentEndReached()156 onEndReached: contentEndReached()
151 }157 }
158 Connections {
159 target: isCurrent ? scope : null
160 onGotoScope: {
161 // Note here scopeId is the signal parameter and not the loader property
162 dashContent.gotoScope(scopeId);
163 }
164 onOpenScope: {
165 dashContent.openScope(scope);
166 }
167 }
152168
153 Component.onDestruction: active = false169 Component.onDestruction: active = false
154 }170 }
155 }171 }
156172
157 PageHeader {173 PageHeader {
158 id: pageHeader174 id: dashPageHeader
159 objectName: "pageHeader"175 objectName: "pageHeader"
160 width: parent.width176 width: parent.width
161 searchEntryEnabled: true177 searchEntryEnabled: true
@@ -218,6 +234,7 @@
218 openEffect: openEffect234 openEffect: openEffect
219 categoryView: dashContentList.currentItem ? dashContentList.currentItem.categoryView : null235 categoryView: dashContentList.currentItem ? dashContentList.currentItem.categoryView : null
220 scope: dashContentList.currentItem ? dashContentList.currentItem.theScope : null236 scope: dashContentList.currentItem ? dashContentList.currentItem.theScope : null
237 pageHeader: dashPageHeader
221 anchors.fill: parent238 anchors.fill: parent
222 }239 }
223}240}
224241
=== modified file 'qml/Dash/PreviewListView.qml'
--- qml/Dash/PreviewListView.qml 2014-02-14 13:10:46 +0000
+++ qml/Dash/PreviewListView.qml 2014-02-18 15:14:40 +0000
@@ -26,6 +26,7 @@
26 property OpenEffect openEffect: null26 property OpenEffect openEffect: null
27 property ScopeListView categoryView: null27 property ScopeListView categoryView: null
28 property Scope scope: null28 property Scope scope: null
29 property var pageHeader: null
2930
30 property alias open: previewListView.open31 property alias open: previewListView.open
31 property alias onScreen: previewListView.onScreen32 property alias onScreen: previewListView.onScreen
3233
=== added file 'qml/Dash/ScopeItem.qml'
--- qml/Dash/ScopeItem.qml 1970-01-01 00:00:00 +0000
+++ qml/Dash/ScopeItem.qml 2014-02-18 15:14:40 +0000
@@ -0,0 +1,111 @@
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 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
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19import Unity 0.2
20import "../Components"
21
22Item {
23 id: root
24
25 property alias scope: scopeView.scope
26
27 property ListModel searchHistory
28
29 signal back
30 signal gotoScope(string scopeId)
31 signal openScope(var scope)
32
33 Item {
34 id: scopeViewHolder
35 anchors.fill: parent
36
37 GenericScopeView {
38 id: scopeView
39 width: parent.width
40 height: parent.height
41 isCurrent: scope != null
42 tabBarHeight: scopeItemPageHeader.implicitHeight
43 pageHeader: scopeItemPageHeader
44 openEffect: openEffect
45 previewListView: previewListView
46
47 Connections {
48 target: isCurrent ? scope : null
49 onGotoScope: root.gotoScope(scopeId);
50 onOpenScope: root.openScope(scope);
51 }
52 }
53
54 PageHeader {
55 id: scopeItemPageHeader
56 width: parent.width
57 searchEntryEnabled: true
58 searchHistory: root.searchHistory
59 scope: root.scope
60 height: units.gu(7)
61
62 childItem: Row {
63 anchors {
64 fill: parent
65 leftMargin: units.gu(2)
66 }
67 spacing: units.gu(1)
68 Image {
69 anchors.verticalCenter: parent.verticalCenter
70 source: "graphics/dashback.png"
71 MouseArea {
72 anchors.fill: parent
73 onClicked: root.back();
74 }
75 }
76 Label {
77 id: label
78 anchors.verticalCenter: parent.verticalCenter
79
80 text: scope ? scope.name : ""
81 color: "grey"
82 font.family: "Ubuntu"
83 font.weight: Font.Light
84 fontSize: "x-large"
85 elide: Text.ElideRight
86 style: Text.Raised
87 styleColor: "black"
88 }
89 }
90 }
91 }
92
93 DashContentOpenEffect {
94 id: openEffect
95 anchors {
96 fill: parent
97 bottomMargin: -bottomOverflow
98 }
99 sourceItem: scopeViewHolder
100 previewListView: previewListView
101 }
102
103 PreviewListView {
104 id: previewListView
105 openEffect: openEffect
106 categoryView: scopeView.categoryView
107 pageHeader: scopeItemPageHeader
108 scope: root.scope
109 anchors.fill: parent
110 }
111}
0112
=== added file 'qml/Dash/graphics/dashback@27.png'
1Binary files qml/Dash/graphics/dashback@27.png 1970-01-01 00:00:00 +0000 and qml/Dash/graphics/dashback@27.png 2014-02-18 15:14:40 +0000 differ113Binary files qml/Dash/graphics/dashback@27.png 1970-01-01 00:00:00 +0000 and qml/Dash/graphics/dashback@27.png 2014-02-18 15:14:40 +0000 differ

Subscribers

People subscribed via source and target branches

to all changes: