diff --git a/DapComboBox.qml b/DapComboBox.qml index daf524290ed6604bbd0ba351d49ad60ae2f096bc..bea4837612c8d4a750b7d1f0806998f5bfe6180b 100644 --- a/DapComboBox.qml +++ b/DapComboBox.qml @@ -96,18 +96,8 @@ ComboBox { else return 0 } - ///text of string - contentItem: Text { - id:textDelegateComboBox - anchors.fill: parent - anchors.leftMargin: popup.visible ? sidePaddingActive : sidePaddingNormal - verticalAlignment: Qt.AlignCenter - font.family: fontRobotoRegular.name - font.pixelSize: fontSizeComboBox - text: {if(index != currentIndex) return modelData;} - color: hovered ? hilightColorText : normalColorText - } //Indent from the bottom edge or the next line that will not stand out when you hover over the mouse + //And here is the list text background: Rectangle { anchors.fill: parent anchors.bottomMargin: { @@ -117,8 +107,22 @@ ComboBox { else return intervalListElement } if (index == customComboBox.count - 1) return bottomIntervalListElement + return intervalListElement } + color: hovered ? hilightColor : normalColor + //the list text + Text { + id:textDelegateComboBox + anchors.fill: parent + // anchors.topMargin: 8 * pt + anchors.leftMargin: popup.visible ? sidePaddingActive : sidePaddingNormal + verticalAlignment: Qt.AlignVCenter + font.family: fontRobotoRegular.name + font.pixelSize: fontSizeComboBox + text: {if(index != currentIndex) return modelData;} + color: hovered ? hilightColorText : normalColorText + } } highlighted: parent.highlightedIndex === index }