~nick-dedekind/unity8/indicator-color-fixes

« back to all changes in this revision

Viewing changes to tests/mocks/Unity/Indicators/ModelActionRootState.qml

  • Committer: Nick Dedekind
  • Date: 2016-02-29 14:24:55 UTC
  • mfrom: (2143.1.65 unity8)
  • Revision ID: nick.dedekind@canonical.com-20160229142455-ol76uyr8pin7l5r6
merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright 2013 Canonical Ltd.
 
2
 * Copyright 2013-2016 Canonical Ltd.
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
5
5
 * it under the terms of the GNU Lesser General Public License as published by
30
30
    property bool indicatorVisible: cachedState && cachedState.hasOwnProperty("visible") ? cachedState["visible"] : true
31
31
 
32
32
    property var cachedState: menu ? menu.get(0, "actionState") : undefined
 
33
    property string submenuAction: {
 
34
        if (!menu) return "";
 
35
        var ext = menu.get(0, "ext");
 
36
        var submenuVar = ext ? ext["submenu-action"] : undefined;
 
37
        return submenuVar ? submenuVar : ""
 
38
    }
33
39
    Connections {
34
40
        target: menu
35
41
        onModelDataChanged: {
36
42
            cachedState = menu.get(0, "actionState");
 
43
 
 
44
            var ext = menu.get(0, "ext");
 
45
            var submenuVar = ext ? ext["submenu-action"] : undefined;
 
46
            submenuAction = submenuVar ? submenuVar : ""
37
47
        }
38
48
    }
39
49