~saviq/unity/phablet.release-172

« back to all changes in this revision

Viewing changes to Dash/Apps/RunningApplicationTile.qml

  • Committer: Michał Sawicz
  • Date: 2013-04-23 22:27:12 UTC
  • mfrom: (612.1.8 phablet)
  • Revision ID: michal.sawicz@canonical.com-20130423222712-6q65wyw0bcif013r
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    property var application
27
27
    property bool __sideStageEnabled: shell.applicationManager.sideStageEnabled
28
28
 
29
 
    height: childrenRect.height
 
29
    signal requestedApplicationActivation(var application)
 
30
    signal requestedApplicationTermination(var application)
 
31
    signal requestedActivationMode()
 
32
    signal requestedTerminationMode()
 
33
 
 
34
    // Was: childrenRect.height
 
35
    // To avoid "binding loop" warning
 
36
    height: shapedApplicationImage.height + labelContainer.height
 
37
 
30
38
    width: shapedApplicationImage.width
31
39
 
 
40
    property bool terminationModeEnabled: false
 
41
 
32
42
    onClicked: {
33
 
        shell.activateApplication(application.desktopFile)
 
43
        if (terminationModeEnabled)
 
44
            requestedApplicationTermination(application)
 
45
        else
 
46
            requestedApplicationActivation(application)
 
47
    }
 
48
 
 
49
    onPressAndHold: {
 
50
        if (terminationModeEnabled) {
 
51
            requestedActivationMode()
 
52
        } else {
 
53
            requestedTerminationMode()
 
54
        }
34
55
    }
35
56
 
36
57
    function updateScreenshotFromCache() {
44
65
            top: parent.top
45
66
            horizontalCenter: parent.horizontalCenter
46
67
        }
47
 
        width: (application.stage === ApplicationsModel.MainStage && __sideStageEnabled) ? units.gu(22) : units.gu(11)
 
68
 
 
69
        // FIXME: width and height should be defined according to the
 
70
        // application window's aspect ratio.
 
71
        width: (application.stage === ApplicationsModel.MainStage && __sideStageEnabled) ?
 
72
            units.gu(22) : units.gu(11)
48
73
        height: (__sideStageEnabled) ? units.gu(22) : units.gu(19)
49
74
        radius: "medium"
50
75
        image: applicationImage
98
123
            horizontalAlignment: Text.AlignHCenter
99
124
        }
100
125
    }
 
126
 
 
127
    CloseIcon {
 
128
        anchors {
 
129
            right: shapedApplicationImage.right
 
130
            rightMargin: -units.gu(1)
 
131
            top: parent.top
 
132
            topMargin: -units.gu(1)
 
133
        }
 
134
        height: units.gu(6)
 
135
        width: units.gu(6)
 
136
        id: closeIcon
 
137
        enabled: root.terminationModeEnabled
 
138
    }
101
139
}