on xenial help sign in
Initial wiring of primaryNavigationTag
commit726809cd728e6ea4f7bbdae229b66bd46606dd2f authorAlbert Astals Cid <albert.astals@canonical.com> dateTue 22 Sep 2015, 15:23 (11 years ago) parent261ed6e
3 files changed+11−2
qml/Dash/GenericScopeView.qml+1 qml/Dash/PageHeader.qml+5 tests/mocks/Unity/fake_scope.cpp+5−2
qml/Dash/GenericScopeView.qml+1
@@ -626,6 +626,7 @@ FocusScope {
626626 settingsEnabled: scopeView.scope && scopeView.scope.settings && scopeView.scope.settings.count > 0 || false
627627 favoriteEnabled: scopeView.scope && scopeView.scope.id !== "clickscope"
628628 favorite: scopeView.scope && scopeView.scope.favorite
629+ navigationTag: scopeView.scope && scopeView.scope.primaryNavigationTag
629630 scopeStyle: scopeView.scopeStyle
630631 paginationCount: scopeView.paginationCount
631632 paginationIndex: scopeView.paginationIndex
qml/Dash/PageHeader.qml+5
@@ -31,6 +31,7 @@ Item {
3131 property bool backIsClose: false
3232 property string title
3333 property var extraPanel
34+ property string navigationTag
3435
3536 property bool storeEntryEnabled: false
3637 property bool searchEntryEnabled: false
@@ -197,6 +198,10 @@ Item {
197198 rightMargin: units.gu(1)
198199 }
199200
201+ primaryItem: Label {
202+ text: root.navigationTag
203+ }
204+
200205 secondaryItem: AbstractButton {
201206 height: searchTextField.height
202207 width: height
tests/mocks/Unity/fake_scope.cpp+5−2
@@ -285,6 +285,7 @@ void Scope::setNavigationState(const QString &navigationId)
285285{
286286 m_currentNavigationId = navigationId;
287287 Q_EMIT currentNavigationIdChanged();
288+ Q_EMIT primaryNavigationTagChanged();
288289}
289290
290291unity::shell::scopes::FilterBaseInterface* Scope::primaryNavigationFilter() const
@@ -299,8 +300,10 @@ unity::shell::scopes::FiltersInterface* Scope::filters() const
299300
300301QString Scope::primaryNavigationTag() const
301302{
302− // TODO
303− return QString();
303+ if (m_currentNavigationId == "root")
304+ return QString();
305+ else
306+ return const_cast<Scope*>(this)->getNavigation(m_currentNavigationId)->label();
304307}
305308
306309int Scope::activeFiltersCount() const