From 3ebe6b4d903aa8cdca96bbcc4a4ea471d398237a Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Mon, 14 Aug 2017 13:32:19 -0700 Subject: [PATCH] Add centeredLabel support --- src/QmlControls/QGCComboBox.qml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/QmlControls/QGCComboBox.qml b/src/QmlControls/QGCComboBox.qml index 62bc3d3f5..73ed7a27e 100644 --- a/src/QmlControls/QGCComboBox.qml +++ b/src/QmlControls/QGCComboBox.qml @@ -9,6 +9,7 @@ Button { id: combo property real pointSize: ScreenTools.defaultFontPointSize ///< Point size for button text + property bool centeredLabel: false property alias model: popupItems.model property alias textRole: popup.textRole property alias currentIndex: popup.__selectedIndex @@ -60,10 +61,12 @@ Button { baselineOffset: text.y + text.baselineOffset QGCLabel { - id: text - anchors.verticalCenter: parent.verticalCenter - text: control.currentText - color: control._qgcPal.buttonText + id: text + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: centeredLabel ? parent.horizontalCenter : undefined + text: control.currentText + color: control._qgcPal.buttonText + font.pointSize: pointSize } } } -- 2.22.0