Index: sources/gui/qml/components/BaseComboBox.qml =================================================================== diff -u -rda2dbdbd92d099e44d11bbfb2b794d5ee19a0f0a -rbea36be2766046e63c4e82539a630b5cee7ce1c6 --- sources/gui/qml/components/BaseComboBox.qml (.../BaseComboBox.qml) (revision da2dbdbd92d099e44d11bbfb2b794d5ee19a0f0a) +++ sources/gui/qml/components/BaseComboBox.qml (.../BaseComboBox.qml) (revision bea36be2766046e63c4e82539a630b5cee7ce1c6) @@ -21,38 +21,40 @@ import "qrc:/globals" ComboBox { id: _root - property bool active : true // default leave as regular ComboBox behavior + property bool isActive : true // default leave as regular ComboBox behavior property alias iconSource : _icon.source property alias iconAnchors : _icon.anchors property alias backgroundColor : _background.color 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.active ? currentText : Variables.emptyEntry + displayText : _root.isActive ? currentText : Variables.emptyEntry currentIndex : 0 - font.pixelSize : Fonts.fontPixelTextRectTitle - leftPadding : 30 + font.pixelSize : Fonts.fontPixelDefaultButton + leftPadding : centerHorizontally || ! _root.isActive ? 30 : Variables.defaultMargin signal clear() - onActivated : _root.active = true - onClear : { - currentIndex = 0 - active = false - } + 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.active ? Fonts.fontPixelTextRectTitle : Fonts.fontPixelValueControl + font.pixelSize : _root.isActive ? Fonts.fontPixelDefaultButton : Fonts.fontPixelValueControl verticalAlignment : Text.AlignVCenter - horizontalAlignment : _root.active ? undefined : Text.AlignHCenter + horizontalAlignment : centerHorizontally || ! _root.isActive ? Text.AlignHCenter : undefined + rightPadding : _root.isActive ? 15 : 0 + clip : true + elide : Text.ElideRight } background: Rectangle { id: _background - color : Colors.highlightMedProgressBar + color : Colors.comboBoxDisplay radius : Variables.dialogRadius } @@ -62,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 : Variables.defaultMargin + elide : Text.ElideRight } background: Rectangle {