~phablet-team/+junk/filters-unit-tests

« back to all changes in this revision

Viewing changes to app/Overlay.qml

  • Committer: Ugo Riboni
  • Date: 2015-03-22 09:35:11 UTC
  • mfrom: (176.1.77 trunk)
  • Revision ID: ugo.riboni@canonical.com-20150322093511-tjdc5mkjvh8cpv3c
MergeĀ upstreamĀ changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import QtQuick 2.2
 
1
import QtQuick 2.4
2
2
import Ubuntu.Components 1.2
3
3
import Ubuntu.Components.Popups 1.0
4
4
import Filters 1.0
9
9
 
10
10
    property ListModel availableEffects
11
11
    property HalideTransform liveTransform
 
12
    property HalideTransform saveTransform
 
13
    property url source
12
14
 
13
 
    anchors {
14
 
        top: parent.top
15
 
        bottom: parent.bottom
16
 
        left: parent.left
17
 
    }
18
15
    width: units.gu(30)
19
16
    color: Qt.rgba(0.0, 0.0, 0.0, 0.9)
20
17
 
43
40
            property string outputFile: "output.png"
44
41
            text: "Save to %1".arg(outputFile)
45
42
            onClicked: editor.saveToFile(outputFile)
 
43
 
 
44
            ActivityIndicator {
 
45
                anchors {
 
46
                    verticalCenter: parent.verticalCenter
 
47
                    right: parent.right
 
48
                    rightMargin: units.gu(1)
 
49
                }
 
50
                width: units.gu(2)
 
51
                height: width
 
52
                running: saveTransform.updating
 
53
                opacity: running ? 1.0 : 0.0
 
54
                Behavior on opacity { UbuntuNumberAnimation {duration: UbuntuAnimation.BriskDuration} }
 
55
            }
46
56
        }
47
57
 
48
58
        Item {
114
124
            }
115
125
 
116
126
            text: "Remove All"
117
 
            onClicked: {
118
 
                // FIXME: do we need to manually delete the functions?
119
 
                liveTransform.functions = [];
120
 
            }
 
127
            onClicked: liveTransform.clearFunctions()
121
128
            opacity: liveTransform.functions.length > 0 ? 1.0 : 0.0
122
129
            Behavior on opacity { UbuntuNumberAnimation {duration: UbuntuAnimation.BriskDuration} }
123
130
            visible: opacity != 0.0
152
159
                backgroundColor: Qt.rgba(1, 1, 1, 0.05)
153
160
            }
154
161
 
 
162
            ActivityIndicator {
 
163
                anchors {
 
164
                    top: parent.top
 
165
                    topMargin: units.gu(2)
 
166
                    right: parent.right
 
167
                    rightMargin: units.gu(1)
 
168
                }
 
169
                width: units.gu(2)
 
170
                height: width
 
171
                running: liveTransform.updating
 
172
                opacity: running ? 1.0 : 0.0
 
173
                Behavior on opacity { UbuntuNumberAnimation {duration: UbuntuAnimation.BriskDuration} }
 
174
            }
 
175
 
155
176
            clip: true
156
177
            height: Math.min(units.gu(50), contentItem.height)
157
178
            Behavior on height { UbuntuNumberAnimation {duration: UbuntuAnimation.BriskDuration} }
186
207
                        Action {
187
208
                            iconName: "delete"
188
209
                            onTriggered: {
189
 
                                // FIXME: do we need to manually delete the function?
190
 
                                QmlListHelpers.removeItemFromQmlList(liveTransform, "functions", modelData)
 
210
                                var func = modelData;
 
211
                                QmlListHelpers.removeItemFromQmlList(liveTransform, "functions", func);
 
212
                                func.destroy();
191
213
                            }
192
214
                        }
193
215
                    ]