~mzanetti/unity8/buttons-in-panel

« back to all changes in this revision

Viewing changes to plugins/Dash/CardCreator.js

  • Committer: Michael Zanetti
  • Date: 2014-12-03 11:57:20 UTC
  • mfrom: (1457.1.1 wallpaper)
  • Revision ID: michael.zanetti@canonical.com-20141203115720-aoxrzmxyyq3stg2x
merge prereq

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
                                            height = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.height }); \n\
83
83
                                        } \n\
84
84
                                    } \n\
85
 
                                    image: CroppedImageMinimumSourceSize { \n\
 
85
                                    CroppedImageMinimumSourceSize { \n\
 
86
                                        id: artImage; \n\
86
87
                                        objectName: "artImage"; \n\
87
 
                                        property bool doLoadSource: !NetworkingStatus.limitedBandwith; \n\
88
 
                                        source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["art"] || ""; } \n\
89
 
                                        cache: true; \n\
 
88
                                        source: cardData && cardData["art"] || ""; \n\
90
89
                                        asynchronous: root.asynchronous; \n\
91
90
                                        visible: false; \n\
92
91
                                        width: %2; \n\
93
92
                                        height: %3; \n\
94
93
                                    } \n\
 
94
                                    image: artImage.image; \n\
95
95
                                } \n\
96
96
                            } \n\
97
97
                        }\n';
181
181
                                id: mascotShapeLoader; \n\
182
182
                                objectName: "mascotShapeLoader"; \n\
183
183
                                asynchronous: root.asynchronous; \n\
184
 
                                active: mascotImage.status === Image.Ready; \n\
 
184
                                active: mascotImage.image.status === Image.Ready; \n\
185
185
                                visible: showHeader && active && status == Loader.Ready; \n\
186
186
                                width: units.gu(6); \n\
187
187
                                height: units.gu(5.625); \n\
188
 
                                sourceComponent: UbuntuShape { image: mascotImage } \n\
 
188
                                sourceComponent: UbuntuShape { image: mascotImage.image } \n\
189
189
                                anchors { %1 } \n\
190
190
                            }\n';
191
191
 
195
195
                            id: mascotImage; \n\
196
196
                            objectName: "mascotImage"; \n\
197
197
                            anchors { %1 } \n\
198
 
                            property bool doLoadSource: !NetworkingStatus.limitedBandwith; \n\
199
 
                            source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["mascot"] || ""; } \n\
 
198
                            source: cardData && cardData["mascot"] || ""; \n\
200
199
                            width: units.gu(6); \n\
201
200
                            height: units.gu(5.625); \n\
202
201
                            horizontalAlignment: Image.AlignHCenter; \n\
225
224
 
226
225
// %1 is used as extra anchors of emblemIcon
227
226
// %2 is used as color of emblemIcon
228
 
var kEmblemIconCode = 'StatusIcon { \n\
 
227
var kEmblemIconCode = 'Icon { \n\
229
228
                            id: emblemIcon; \n\
230
229
                            objectName: "emblemIcon"; \n\
231
230
                            anchors { \n\
435
434
            mascotShapeCode = kMascotShapeLoaderCode.arg(mascotAnchors);
436
435
        }
437
436
 
438
 
        var mascotImageVisible = useMascotShape ? 'false' : 'showHeader && resized';
 
437
        var mascotImageVisible = useMascotShape ? 'false' : 'showHeader';
439
438
        mascotCode = kMascotImageCode.arg(mascotAnchors).arg(mascotImageVisible);
440
439
    }
441
440
 
655
654
    var imports = 'import QtQuick 2.2; \n\
656
655
                   import Ubuntu.Components 1.1; \n\
657
656
                   import Ubuntu.Settings.Components 0.1; \n\
658
 
                   import Ubuntu.Connectivity 1.0; \n\
659
657
                   import Dash 0.1;\n\
660
658
                   import Utils 0.1;\n';
661
659
    var card = cardString(template, components);