summaryrefslogtreecommitdiffstats
path: root/basicsuite/qt5-cinematicdemo/content/InfoViewItem.qml
blob: a339f98502f7c50b5c344897e8226f77d2329c4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import QtQuick 2.0

Item {
    id: root
    property alias text: textItem.text
    property alias image: imageItem.source
    // Switch image & text positions
    property bool switchedLayout: false

    width: parent.width
    height: Math.max(imageItem.height, textItem.paintedHeight)

    Image {
        id: imageItem
        x: root.switchedLayout ? 16 : parent.width - width - 10
        y: 8
    }

    Text {
        id: textItem
        width: parent.width - imageItem.width - 40
        x: root.switchedLayout ? parent.width - width - 16 : 16
        y: 8
        color: "#ffffff"
        style: Text.Raised
        styleColor: "#000000"
        font.pixelSize: settings.fontS
        wrapMode: Text.WordWrap
    }
}