SmallValue.qml 1.45 KB
Newer Older
Valentin Platzgummer's avatar
Valentin Platzgummer committed
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 31 32 33 34 35 36 37 38 39 40 41
import QtQuick 2.0
import QGroundControl.Controls      1.0
import QGroundControl.ScreenTools   1.0
import QtQuick.Layouts              1.2

GridLayout {
    id:         main
    clip:       true
    columns:    1

    property string shortDescription: "Description"
    property string value: "-,-"
    property string unit: ""

    QGCLabel {
        Layout.fillWidth:       true
        Layout.columnSpan:      parent.columns
        wrapMode:               Text.WordWrap
        horizontalAlignment:    Text.AlignHCenter
        font.pointSize:         ScreenTools.isTinyScreen ?
                                    ScreenTools.smallFontPointSize * 0.75
                                  : ScreenTools.smallFontPointSize
        text:                   main.shortDescription
    }
    QGCLabel {
        Layout.fillWidth:       true
        horizontalAlignment:    Text.AlignHCenter
        fontSizeMode:           Text.HorizontalFit
        text:                   main.value + " " + main.unit
    }
//    QGCLabel {
//        Layout.fillWidth:       true
//        //width:                  parent.width
//        horizontalAlignment:    Text.AlignHCenter
//        font.pointSize:         ScreenTools.isTinyScreen ?
//                                    ScreenTools.smallFontPointSize * 0.75
//                                  : ScreenTools.smallFontPointSize
//        fontSizeMode:           Text.HorizontalFit
//        text:                   main.unit
//    }
} // Column