on xenial help sign in
Always populate root model pages, but not menu items
7ba9ef3Nick Dedekind
plugins/Unity/Indicators/qml/IndicatorBase.qml+3−4
@@ -32,7 +32,6 @@ Item {
32 property var menuObjectPaths: undefined
32 property var menuObjectPaths: undefined
33 readonly property string device: "phone"
33 readonly property string device: "phone"
34 property string rootMenuType: "com.canonical.indicator.root"
34 property string rootMenuType: "com.canonical.indicator.root"
35− property bool active: false
36
35
37 property string deviceMenuObjectPath: menuObjectPaths.hasOwnProperty(device) ? menuObjectPaths[device] : ""
36 property string deviceMenuObjectPath: menuObjectPaths.hasOwnProperty(device) ? menuObjectPaths[device] : ""
38
37
@@ -40,9 +39,9 @@ Item {
40
39
41 CachedUnityMenuModel {
40 CachedUnityMenuModel {
42 id: cachedModel
41 id: cachedModel
43− busName: active ? indicatorItem.busName : ""
42+ busName: indicatorItem.busName
44− actionsObjectPath: active ? indicatorItem.actionsObjectPath : ""
43+ actionsObjectPath: indicatorItem.actionsObjectPath
45− menuObjectPath: active ? indicatorItem.deviceMenuObjectPath : ""
44+ menuObjectPath: indicatorItem.deviceMenuObjectPath
46 }
45 }
47
46
48 property var rootActionState: Indicators.RootActionState {
47 property var rootActionState: Indicators.RootActionState {
plugins/Unity/Indicators/qml/IndicatorPage.qml+6−5
@@ -26,13 +26,14 @@ IndicatorBase {
26 id: main
26 id: main
27
27
28 //const
28 //const
29+ property bool contentActive: false
29 property string title: rootActionState.title
30 property string title: rootActionState.title
30 property alias emptyText: emptyLabel.text
31 property alias emptyText: emptyLabel.text
31 property alias highlightFollowsCurrentItem : mainMenu.highlightFollowsCurrentItem
32 property alias highlightFollowsCurrentItem : mainMenu.highlightFollowsCurrentItem
32
33
33 Indicators.UnityMenuModelStack {
34 Indicators.UnityMenuModelStack {
34 id: menuStack
35 id: menuStack
35− head: main.menuModel
36+ head: contentActive ? main.menuModel : null
36 }
37 }
37
38
38 ListView {
39 ListView {
@@ -163,15 +164,15 @@ IndicatorBase {
163 function start()
164 function start()
164 {
165 {
165 reset()
166 reset()
166− if (!active) {
167+ if (!contentActive) {
167− active = true;
168+ contentActive = true;
168 }
169 }
169 }
170 }
170
171
171 function stop()
172 function stop()
172 {
173 {
173− if (active) {
174+ if (contentActive) {
174− active = false;
175+ contentActive = false;
175 }
176 }
176 }
177 }
177
178
plugins/Unity/Indicators/qml/IndicatorWidget.qml−1
@@ -23,7 +23,6 @@ import Unity.Indicators 0.1 as Indicators
23IndicatorBase {
23IndicatorBase {
24 id: indicatorWidget
24 id: indicatorWidget
25
25
26− active: true
27 enabled: false
26 enabled: false
28 property int iconSize: height - units.gu(0.5)
27 property int iconSize: height - units.gu(0.5)
29}
28}