Newer
Older
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
Component.onCompleted: {
if (typeof qgcTextFieldforwardKeysTo !== 'undefined') {
root.Keys.forwardTo = [qgcTextFieldforwardKeysTo]
}
}
property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
height: Math.round(Math.max(25, ScreenTools.defaultFontPixelHeight * (ScreenTools.isMobile ? 2.5 : 1.2)))
id: unitsLabelWidthGenerator
text: unitsLabel
width: contentWidth + parent.__contentHeight * 0.666
font.pointSize: ScreenTools.defaultFontPointSize
anchors.fill: parent
anchors.bottomMargin: -1
color: "#44ffffff"
anchors.fill: parent
border.color: control.activeFocus ? "#47b" : "#999"
color: __qgcPal.textField
verticalAlignment: Text.AlignVCenter
horizontalAlignment:Text.AlignHCenter
x: parent.width - width
width: unitsLabelWidthGenerator.width
font.pointSize: ScreenTools.defaultFontPointSize
color: control.textColor
visible: control.showUnits
padding.right: control.showUnits ? unitsLabelWidthGenerator.width : control.__contentHeight * 0.333