on xenial help sign in
Per review
commit5201c2d7e144b8416ca8e545bbfea0c19c78591c authorJosh Arenson <joshua.arenson@canonical.com> dateFri 29 Apr 2016, 07:57 (10 years ago) parent0011237
4 files changed+17−13
qml/Dash/PageHeaderExtraPanel.qml+4−5 tests/mocks/Unity/fake_scope.cpp+1−1 tests/mocks/Unity/fake_scope.h+2−2 tests/mocks/Unity/fake_scopes.cpp+10−5
qml/Dash/PageHeaderExtraPanel.qml+4−5
@@ -95,6 +95,8 @@ Item {
9595 // FIXME Move to ListItem once 1556971 is fixed
9696 delegate: ListItems.Empty {
9797 anchors {
98+ left: parent.left
99+ right: parent.right
98100 leftMargin: units.gu(2)
99101 rightMargin: units.gu(2)
100102 }
@@ -122,7 +124,7 @@ Item {
122124 color: "#888888"
123125 }
124126
125− divider.visible: index != recentSearchesRepeater.count - 1 || (scope && scope.hasNavigation) || primaryFilterContainer.active
127+ divider.visible: index != recentSearchesRepeater.count - 1 || (scope && scope.hasNavigation) || primaryFilter.active
126128
127129 onClicked: root.historyItemClicked(query)
128130 }
@@ -147,13 +149,10 @@ Item {
147149 id: primaryFilterContainer
148150 objectName: "primaryFilterContainer"
149151
150− readonly property alias active: primaryFilter.active
151−
152152 height: {
153153 if (!active) {
154154 return 0;
155− }
156− else if (contentHeight > dashNavigation.availableHeight) {
155+ } else if (contentHeight > dashNavigation.availableHeight) {
157156 return dashNavigation.availableHeight;
158157 } else {
159158 return contentHeight;
tests/mocks/Unity/fake_scope.cpp+1−1
@@ -32,7 +32,7 @@ Scope::Scope(Scopes* parent) : Scope("MockScope5", "Mock Scope", false, parent)
3232{
3333}
3434
35−Scope::Scope(QString const& id, QString const& name, bool favorite, Scopes* parent, int categories, bool returnNullPreview, QStringList primaryNavigationFilterOptionLabels)
35+Scope::Scope(QString const& id, QString const& name, bool favorite, Scopes* parent, int categories, bool returnNullPreview, const QStringList primaryNavigationFilterOptionLabels)
3636 : unity::shell::scopes::ScopeInterface(parent)
3737 , m_id(id)
3838 , m_name(name)
tests/mocks/Unity/fake_scope.h+2−2
@@ -34,7 +34,7 @@ class Scope : public unity::shell::scopes::ScopeInterface
3434
3535public:
3636 Scope(Scopes* parent = 0);
37− Scope(QString const& id, QString const& name, bool favorite, Scopes* parent = 0, int categories = 20, bool returnNullPreview = false, QStringList primaryNavigationFilterOptionLabels = QStringList() << "meat" << "vegetables");
37+ Scope(QString const& id, QString const& name, bool favorite, Scopes* parent = 0, int categories = 20, bool returnNullPreview = false, const QStringList primaryNavigationFilterOptionLabels = QStringList() << "meat" << "vegetables");
3838
3939 /* getters */
4040 QString id() const override;
@@ -122,7 +122,7 @@ protected:
122122 FakeOptionSelectorFilter* m_primaryNavigationFilter;
123123
124124 bool m_returnNullPreview;
125− QStringList m_primaryNavigationFilterOptionLabels;
125+ const QStringList m_primaryNavigationFilterOptionLabels;
126126};
127127
128128#endif // FAKE_SCOPE_H
tests/mocks/Unity/fake_scopes.cpp+10−5
@@ -60,11 +60,16 @@ void Scopes::updateScopes()
6060 addScope(new Scope("MockScope7", "MS7", false, this));
6161 addScope(new Scope("MockScope8", "MS8", false, this));
6262 addScope(new Scope("MockScope9", "MS9", false, this));
63− addScope(new Scope("LongPrimaryNavigation", "LongPrimaryNavigation",
64− true, this, 1, false, QStringList() << "Meat" << "Vegetables" << "BBQ"
65− << "Burritos" << "Pasta" << "Pancakes" << "Seafood" << "Soup"
66− << "Bugs" << "Pudding" << "Chocolate" << "Gluten-Free" << "Hamburgers"
67− << "Pho" << "Panang Curry" << "Lumpia" << "Sushi"));
63+
64+ Scope *longNavigationScope = new Scope(
65+ "LongPrimaryNavigation", "LongPrimaryNavigation", true, this, 1, false,
66+ QStringList() << "Meat" << "Vegetables" << "BBQ" << "Burritos"
67+ << "Pasta" << "Pancakes" << "Seafood" << "Soup" << "Bugs"
68+ << "Pudding" << "Chocolate" << "Gluten-Free" << "Hamburgers"
69+ << "Pho" << "Panang Curry" << "Lumpia" << "Sushi");
70+
71+ longNavigationScope->setHasNavigation(false);
72+ addScope(longNavigationScope);
6873
6974 addScope(new Scope("NullPreviewScope", "NPS", false, this, 1, true));
7075 m_scopesOverview = new ScopesOverview(this);