~mzanetti/unity8/fix-1648251

« back to all changes in this revision

Viewing changes to qml/Dash/CardTool.qml

  • Committer: Michael Zanetti
  • Date: 2016-10-13 11:02:11 UTC
  • mfrom: (2525.1.132 unity8)
  • Revision ID: michael.zanetti@canonical.com-20161013110211-tj2gly2dxaqj5t2e
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
    // Not readonly because gets overwritten from GenericScopeView in some cases
72
72
    property string artShapeStyle: categoryLayout === "carousel" ? "shadow" : "inset"
73
73
 
74
 
    property var cardComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, false, cardTool.artShapeStyle);
 
74
    // FIXME ? This seems like it should not be needed, but on Qt 5.4 + phone
 
75
    // we are doing unneeded calls to getCardComponent with artShapeStyle and categoryLayout being empty
 
76
    // Check when we move to newer Qts on the phone if we still need this
 
77
    readonly property bool askForCardComponent: cardTool.template !== undefined &&
 
78
                                                cardTool.components !== undefined &&
 
79
                                                cardTool.artShapeStyle !== "" &&
 
80
                                                cardTool.categoryLayout !== ""
 
81
 
 
82
    property var cardComponent: askForCardComponent
 
83
                                    ? CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, false, cardTool.artShapeStyle, cardTool.categoryLayout)
 
84
                                    : undefined
75
85
 
76
86
    // FIXME: Saviq
77
87
    // Only way for the card below to actually be laid out completely.
213
223
            "attributes": attributesModel.model,
214
224
            "socialActions": socialActionsModel.model
215
225
        }
216
 
        sourceComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, true, cardTool.artShapeStyle);
 
226
        sourceComponent: askForCardComponent
 
227
                            ? CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, true, cardTool.artShapeStyle, cardTool.categoryLayout)
 
228
                            : undefined
217
229
        onLoaded: {
218
230
            item.objectName = "cardToolCard";
219
231
            item.width = Qt.binding(function() { return cardTool.cardWidth !== -1 ? cardTool.cardWidth : item.implicitWidth; });