on xenial help sign in
Change PageHeader's API to not use scope directly
commitae567d27030a46070752305af3d44194a9c0cb5e authorMichał Sawicz <michal.sawicz@canonical.com> dateTue 26 Aug 2014, 15:49 (12 years ago) parent603723b
2 files changed+4−4
qml/Dash/GenericScopeView.qml+1−1 qml/Dash/PageHeader.qml+3−3
qml/Dash/GenericScopeView.qml+1−1
@@ -426,7 +426,7 @@ FocusScope {
426426 searchEntryEnabled: true
427427 settingsEnabled: scopeView.scope && scopeView.scope.settings && scopeView.scope.settings.count > 0 || false
428428 favoriteEnabled: scopeView.scope && scopeView.scope.id !== "clickscope"
429− scope: scopeView.scope
429+ favorite: scopeView.scope && scopeView.scope.favorite
430430 scopeStyle: scopeView.scopeStyle
431431 paginationCount: scopeView.paginationCount
432432 paginationIndex: scopeView.paginationIndex
qml/Dash/PageHeader.qml+3−3
@@ -33,6 +33,7 @@ Item {
3333 property bool searchEntryEnabled: false
3434 property bool settingsEnabled: false
3535 property bool favoriteEnabled: false
36+ property bool favorite: false
3637 property ListModel searchHistory: SearchHistoryModel
3738 property alias searchQuery: searchTextField.text
3839 property alias searchHint: searchTextField.placeholderText
@@ -42,7 +43,6 @@ Item {
4243 property int paginationCount: 0
4344 property int paginationIndex: -1
4445
45− property var scope: null
4646 property var scopeStyle: null
4747
4848 signal backClicked()
@@ -276,8 +276,8 @@ Item {
276276 },
277277 Action {
278278 objectName: "favorite"
279− text: root.scope && root.scope.favorite ? i18n.tr("Remove from Favorites") : i18n.tr("Add to Favorites")
280− iconName: root.scope && root.scope.favorite ? "starred" : "non-starred"
279+ text: root.favorite ? i18n.tr("Remove from Favorites") : i18n.tr("Add to Favorites")
280+ iconName: root.favorite ? "starred" : "non-starred"
281281 visible: root.favoriteEnabled
282282 onTriggered: {
283283 root.favoriteClicked()