Browse Source

Add centeredLabel support

QGC4.4
DonLakeFlyer 8 years ago
parent
commit
3ebe6b4d90
  1. 11
      src/QmlControls/QGCComboBox.qml

11
src/QmlControls/QGCComboBox.qml

@ -9,6 +9,7 @@ Button {
id: combo id: combo
property real pointSize: ScreenTools.defaultFontPointSize ///< Point size for button text property real pointSize: ScreenTools.defaultFontPointSize ///< Point size for button text
property bool centeredLabel: false
property alias model: popupItems.model property alias model: popupItems.model
property alias textRole: popup.textRole property alias textRole: popup.textRole
property alias currentIndex: popup.__selectedIndex property alias currentIndex: popup.__selectedIndex
@ -60,10 +61,12 @@ Button {
baselineOffset: text.y + text.baselineOffset baselineOffset: text.y + text.baselineOffset
QGCLabel { QGCLabel {
id: text id: text
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: control.currentText anchors.horizontalCenter: centeredLabel ? parent.horizontalCenter : undefined
color: control._qgcPal.buttonText text: control.currentText
color: control._qgcPal.buttonText
font.pointSize: pointSize
} }
} }
} }

Loading…
Cancel
Save