Index: sources/gui/qml/compounds/LabelUnitText.qml =================================================================== diff -u -r9976417452cd2e151697108f47483e132ebc0cfc -rad57884fca3e8a0916b6d6bf51a69264b9b5263f --- sources/gui/qml/compounds/LabelUnitText.qml (.../LabelUnitText.qml) (revision 9976417452cd2e151697108f47483e132ebc0cfc) +++ sources/gui/qml/compounds/LabelUnitText.qml (.../LabelUnitText.qml) (revision ad57884fca3e8a0916b6d6bf51a69264b9b5263f) @@ -22,12 +22,18 @@ Rectangle { id: _root objectName : "_labelUnitText" + enum Layout { + Center, + Justify + } + property alias label : _label.text property alias labelColor : _label.color property string unit : "" property alias value : _value.text property alias valueColor : _value.color property alias valueWidth : _value.width + property int layout : LabelUnitText.Layout.Center width : Variables.adjustmentLabelUnitContainerWidth height : Variables.adjustmentLabelUnitContainerHeight @@ -41,7 +47,7 @@ Item { id: _contentItem objectName : "_contentItem" anchors.centerIn: parent - width : childrenRect.width + width : _root.layout === LabelUnitText.Layout.Justify ? (parent.width - (2 * Variables.defaultMargin)) : childrenRect.width height : parent.height Text { id: _label @@ -50,9 +56,10 @@ left : parent.left verticalCenter : parent.verticalCenter } - width : contentWidth + width : contentWidth color : Colors.offWhite font.pixelSize : Fonts.fontPixelContainerTitleSmall + horizontalAlignment: _root.layout === LabelUnitText.Layout.Justify ? Text.AlignRight : Text.AlignLeft } Text { id: _unit @@ -76,6 +83,7 @@ anchors{ left : _unit.right leftMargin : Variables.defaultMargin + right : _root.layout === LabelUnitText.Layout.Justify ? parent.right : undefined baseline : _label.baseline } width : 60