~agateau/unity-2d/desktop-dash

« back to all changes in this revision

Viewing changes to places/dash.qml

  • Committer: Aurelien Gateau
  • Date: 2011-02-10 14:02:07 UTC
  • Revision ID: aurelien.gateau@canonical.com-20110210140207-n24gosi921w2sxnb
Correctly set dash state depending on current page

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
    property variant currentPage
9
9
 
 
10
    states: [
 
11
        State {
 
12
            name: "collapsed"
 
13
            when: !currentPage.expanded
 
14
            StateChangeScript {
 
15
                script: updateDashState()
 
16
            }
 
17
        },
 
18
        State {
 
19
            name: "expanded"
 
20
            when: currentPage.expanded
 
21
            StateChangeScript {
 
22
                script: updateDashState()
 
23
            }
 
24
        }
 
25
    ]
 
26
 
 
27
    function updateDashState() {
 
28
        if (dashView.dashState == DashDeclarativeView.FullScreenDash) {
 
29
            return;
 
30
        }
 
31
        dashView.dashState = currentPage.expanded
 
32
            ? DashDeclarativeView.ExpandedDesktopDash
 
33
            : DashDeclarativeView.CollapsedDesktopDash
 
34
    }
 
35
 
10
36
    function activatePage(page) {
11
37
        if (page == currentPage) {
12
38
            return