Index: sources/gui/qml/components/BaseComboBox.qml =================================================================== diff -u -r10d95daf091fedda008906727088648f66ae5bac -rb12853c86ef9e517667516dc3e47bca07349cedf --- sources/gui/qml/components/BaseComboBox.qml (.../BaseComboBox.qml) (revision 10d95daf091fedda008906727088648f66ae5bac) +++ sources/gui/qml/components/BaseComboBox.qml (.../BaseComboBox.qml) (revision b12853c86ef9e517667516dc3e47bca07349cedf) @@ -28,25 +28,29 @@ property alias dropDownWidth : _popup.width property int delegateWidth : dropDownWidth property int delegateHeight : height + property bool canOff : false + property bool centerHorizontally: false + width : 300 displayText : _root.isActive ? currentText : Variables.emptyEntry currentIndex : 0 font.pixelSize : Fonts.fontPixelTextRectTitle - leftPadding : 30 + leftPadding : centerHorizontally || ! _root.isActive ? 30 : 10 signal clear() - onClear : { - currentIndex = 0 - } + onClear : { currentIndex = 0 } contentItem: Text { id: _displayText - text : parent.displayText + text : canOff && parent.displayText === "0" ? qsTr("OFF") : parent.displayText color : Colors.offWhite font.pixelSize : _root.isActive ? Fonts.fontPixelTextRectTitle : Fonts.fontPixelValueControl verticalAlignment : Text.AlignVCenter - horizontalAlignment : _root.isActive ? undefined : Text.AlignHCenter + horizontalAlignment : centerHorizontally || ! _root.isActive ? Text.AlignHCenter : undefined + rightPadding : _root.isActive ? 15 : 0 + clip : true + elide : Text.ElideRight } background: Rectangle { id: _background @@ -60,11 +64,13 @@ highlighted : _root.highlightedIndex === index contentItem: Text { - text : modelData + text : canOff && modelData === "0" ? qsTr("OFF") : modelData color : Colors.offWhite font : _root.font verticalAlignment : Text.AlignVCenter - leftPadding : 30 + horizontalAlignment : centerHorizontally ? Text.AlignHCenter : undefined + leftPadding : 10 + elide : Text.ElideRight } background: Rectangle {