~mterry/+junk/u8

« back to all changes in this revision

Viewing changes to qml/Dash/Previews/PreviewWidgetFactory.qml

Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
    //! Should the widget show in expanded mode (For those that support it)
38
38
    property bool expanded: widgetType !== "expandable" || widgetData["expanded"] === true
39
39
 
40
 
    //! Set margins width.
41
 
    property real widgetMargins: status === Loader.Ready ? item.widgetMargins : units.gu(1)
 
40
    //! Should the orientation be locked
 
41
    readonly property bool orientationLock: status === Loader.Ready ? item.orientationLock : false
 
42
 
 
43
    //! Should it have margins when on a single columns?
 
44
    readonly property bool singleColumnMarginless: status === Loader.Ready ? item.singleColumnMarginless : false
42
45
 
43
46
    /// The parent (vertical) flickable this widget is in (if any)
44
47
    property var parentFlickable: null
70
73
            case "reviews": return "PreviewRatingDisplay.qml";
71
74
            case "table": return "PreviewTable.qml";
72
75
            case "text": return "PreviewTextSummary.qml";
73
 
            case "video": return "PreviewVideoPlayback.qml";
 
76
            case "video": {
 
77
                if (!widgetData) return "";
 
78
                var source = widgetData.hasOwnProperty("source") ? widgetData["source"].toString() : "";
 
79
                if (source.match("^https{0,1}\:") !== null) {
 
80
                    return "PreviewVideoPlayback.qml";
 
81
                }
 
82
                return "PreviewInlineVideo.qml";
 
83
            }
74
84
            default: return "";
75
85
        }
76
86
    }