on xenial help sign in
Always populate root model pages, but not menu items
commit7ba9ef36b9297839119eab8e8115ff0cb9772d12 authorNick Dedekind <nicholas.dedekind@gmail.com> dateMon 30 Sep 2013, 17:37 (13 years ago) parentcd18e8f
3 files changed+9−10
plugins/Unity/Indicators/qml/IndicatorBase.qml+3−4 plugins/Unity/Indicators/qml/IndicatorPage.qml+6−5 plugins/Unity/Indicators/qml/IndicatorWidget.qml−1
plugins/Unity/Indicators/qml/IndicatorBase.qml+3−4
@@ -32,7 +32,6 @@ Item {
3232 property var menuObjectPaths: undefined
3333 readonly property string device: "phone"
3434 property string rootMenuType: "com.canonical.indicator.root"
35− property bool active: false
3635
3736 property string deviceMenuObjectPath: menuObjectPaths.hasOwnProperty(device) ? menuObjectPaths[device] : ""
3837
@@ -40,9 +39,9 @@ Item {
4039
4140 CachedUnityMenuModel {
4241 id: cachedModel
43− busName: active ? indicatorItem.busName : ""
44− actionsObjectPath: active ? indicatorItem.actionsObjectPath : ""
45− menuObjectPath: active ? indicatorItem.deviceMenuObjectPath : ""
42+ busName: indicatorItem.busName
43+ actionsObjectPath: indicatorItem.actionsObjectPath
44+ menuObjectPath: indicatorItem.deviceMenuObjectPath
4645 }
4746
4847 property var rootActionState: Indicators.RootActionState {
plugins/Unity/Indicators/qml/IndicatorPage.qml+6−5
@@ -26,13 +26,14 @@ IndicatorBase {
2626 id: main
2727
2828 //const
29+ property bool contentActive: false
2930 property string title: rootActionState.title
3031 property alias emptyText: emptyLabel.text
3132 property alias highlightFollowsCurrentItem : mainMenu.highlightFollowsCurrentItem
3233
3334 Indicators.UnityMenuModelStack {
3435 id: menuStack
35− head: main.menuModel
36+ head: contentActive ? main.menuModel : null
3637 }
3738
3839 ListView {
@@ -163,15 +164,15 @@ IndicatorBase {
163164 function start()
164165 {
165166 reset()
166− if (!active) {
167− active = true;
167+ if (!contentActive) {
168+ contentActive = true;
168169 }
169170 }
170171
171172 function stop()
172173 {
173− if (active) {
174− active = false;
174+ if (contentActive) {
175+ contentActive = false;
175176 }
176177 }
177178
plugins/Unity/Indicators/qml/IndicatorWidget.qml−1
@@ -23,7 +23,6 @@ import Unity.Indicators 0.1 as Indicators
2323IndicatorBase {
2424 id: indicatorWidget
2525
26− active: true
2726 enabled: false
2827 property int iconSize: height - units.gu(0.5)
2928}