Merge lp:~aacid/unity8/scopeListPageHeaderScopeStyle into lp:unity8

Proposed by Albert Astals Cid
Status: Rejected
Rejected by: Albert Astals Cid
Proposed branch: lp:~aacid/unity8/scopeListPageHeaderScopeStyle
Merge into: lp:unity8
Prerequisite: lp:~aacid/unity8/bottom_list_drag
Diff against target: 127 lines (+45/-1)
5 files modified
qml/Dash/ScopesList.qml (+6/-1)
qml/Dash/ScopesListCategory.qml (+1/-0)
tests/mocks/Unity/fake_scopesoverview.cpp (+18/-0)
tests/mocks/Unity/fake_scopesoverview.h (+4/-0)
tests/qmltests/Dash/tst_Dash.qml (+16/-0)
To merge this branch: bzr merge lp:~aacid/unity8/scopeListPageHeaderScopeStyle
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Michał Sawicz Needs Fixing
Review via email: mp+244578@code.launchpad.net

This proposal supersedes a proposal from 2014-12-10.

Commit message

Bind scopeStyle for the scope list header

Description of the change

This does nothing since the backend is not exposing any scopeStyle for the overview scope but in the case they do it'll be ready

 * Are there any related MPs required for this MP to build/function as expected?
Prerequisite

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal

Think it would make sense setting this from a mock and testing if some of the style elements are properly applied?

review: Needs Information
Revision history for this message
Michał Sawicz (saviq) wrote :

This results in a white-on-grey in the Manage header. Please just hardcode the colour as the header would be the only place that would actually follow the scope's setting, and I feel like this is a custom enough component that we should just control the whole of its UI.

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?

yes

 * Did CI run pass? If not, please explain why.

not running yet. but modified tests are passing here

 * Did you make sure that the branch does not contain spurious tags?

yes

review: Approve
Revision history for this message
Michał Sawicz (saviq) wrote :

See my previous comment please.

Unmerged revisions

1506. By Albert Astals Cid

Use the default scope style for the header

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Dash/ScopesList.qml'
2--- qml/Dash/ScopesList.qml 2014-12-02 12:04:11 +0000
3+++ qml/Dash/ScopesList.qml 2014-12-12 13:05:01 +0000
4@@ -34,6 +34,10 @@
5
6 state: "browse"
7
8+ property var scopeStyle: ScopeStyle {
9+ style: scope ? scope.customizations : {}
10+ }
11+
12 onStateChanged: {
13 if (state == "edit") {
14 // As per design entering edit mode clears the possible existing search
15@@ -66,6 +70,7 @@
16 backIsClose: root.state == "edit"
17 storeEntryEnabled: root.state == "browse"
18 searchEntryEnabled: false // Disable search for now
19+ scopeStyle: root.scopeStyle
20 onBackClicked: {
21 if (backIsClose) {
22 root.state = "browse"
23@@ -111,7 +116,7 @@
24
25 editMode: root.state == "edit"
26
27- scopeStyle: root.scope.scopeStyle
28+ scopeStyle: root.scopeStyle
29 isFavoritesFeed: categoryId == "favorites"
30 isAlsoInstalled: categoryId == "other"
31
32
33=== modified file 'qml/Dash/ScopesListCategory.qml'
34--- qml/Dash/ScopesListCategory.qml 2014-12-12 13:05:01 +0000
35+++ qml/Dash/ScopesListCategory.qml 2014-12-12 13:05:01 +0000
36@@ -40,6 +40,7 @@
37
38 ListItems.Header {
39 id: header
40+ objectName: "scopesListCategoryHeader"
41 width: root.width
42 height: units.gu(5)
43 color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
44
45=== modified file 'tests/mocks/Unity/fake_scopesoverview.cpp'
46--- tests/mocks/Unity/fake_scopesoverview.cpp 2014-10-06 08:52:00 +0000
47+++ tests/mocks/Unity/fake_scopesoverview.cpp 2014-12-12 13:05:01 +0000
48@@ -22,6 +22,7 @@
49
50 ScopesOverview::ScopesOverview(Scopes* parent)
51 : Scope("scopesOverview", "Scopes Overview", false, parent)
52+ , m_headerBlue(false)
53 {
54 delete m_categories; // delete the usual categories, we're not going to use it
55 m_scopesOverviewCategories = new ScopesOverviewCategories(parent, this);
56@@ -52,6 +53,23 @@
57 }
58 }
59
60+void ScopesOverview::setHeaderBlue(bool blue)
61+{
62+ if (m_headerBlue != blue) {
63+ m_headerBlue = blue;
64+ Q_EMIT customizationsChanged();
65+ }
66+}
67+
68+QVariantMap ScopesOverview::customizations() const
69+{
70+ QVariantMap res;
71+ if (m_headerBlue) {
72+ res["foreground-color"] = "blue";
73+ }
74+ return res;
75+}
76+
77 void ScopesOverview::setFavorite(Scope *scope, bool favorite)
78 {
79 m_scopesOverviewCategories->setFavorite(scope, favorite);
80
81=== modified file 'tests/mocks/Unity/fake_scopesoverview.h'
82--- tests/mocks/Unity/fake_scopesoverview.h 2014-09-26 11:21:19 +0000
83+++ tests/mocks/Unity/fake_scopesoverview.h 2014-12-12 13:05:01 +0000
84@@ -34,6 +34,9 @@
85 void setSearchQuery(const QString& search_query) override;
86 Q_INVOKABLE void activate(QVariant const& result) override;
87
88+ Q_INVOKABLE void setHeaderBlue(bool blue);
89+ QVariantMap customizations() const;
90+
91 // This is implementation detail
92 void setFavorite(Scope *scope, bool favorite);
93 void moveFavoriteTo(Scope *scope, int index);
94@@ -41,6 +44,7 @@
95 private:
96 ScopesOverviewCategories *m_scopesOverviewCategories;
97 unity::shell::scopes::CategoriesInterface *m_searchCategories;
98+ bool m_headerBlue;
99 };
100
101 class ScopesOverviewCategories : public unity::shell::scopes::CategoriesInterface
102
103=== modified file 'tests/qmltests/Dash/tst_Dash.qml'
104--- tests/qmltests/Dash/tst_Dash.qml 2014-12-12 13:05:01 +0000
105+++ tests/qmltests/Dash/tst_Dash.qml 2014-12-12 13:05:01 +0000
106@@ -411,5 +411,21 @@
107 tryCompare(dashContentList, "currentIndex", 2);
108 compare(dashContentList.currentItem.scopeId, "MockScope5");
109 }
110+
111+ function test_manage_dash_customizations() {
112+ var scopesList = findChild(dash, "scopesList");
113+ var scopesListPageHeader = findChild(scopesList, "innerPageHeader");
114+
115+ var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
116+ var scopesListCategoryHeader = findChild(favScopesListCategory, "scopesListCategoryHeader");
117+
118+ compare(scopesListPageHeader.config.foregroundColor, "#5d5d5d");
119+ compare(scopesListCategoryHeader.color, "#5d5d5d");
120+
121+ scopesList.scope.setHeaderBlue(true);
122+
123+ compare(scopesListPageHeader.config.foregroundColor, "#0000ff");
124+ compare(scopesListCategoryHeader.color, "#0000ff");
125+ }
126 }
127 }

Subscribers

People subscribed via source and target branches