Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion qt6/src/qml/ComboBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ T.ComboBox {
property int maxVisibleItems : DS.Style.comboBox.maxVisibleItems
property D.Palette separatorColor: DS.Style.comboBox.edit.separator
property var horizontalAlignment: control.flat ? Text.AlignRight : Text.AlignLeft
property bool mouseInPopupContent: false
opacity: enabled ? 1.0 : 0.4

implicitWidth: DS.Style.control.implicitWidth(control)
Expand All @@ -34,12 +35,16 @@ T.ComboBox {
useIndicatorPadding: true
text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : (model[control.textRole] === undefined ? modelData[control.textRole] : model[control.textRole])) : modelData
icon.name: (control.iconNameRole && model[control.iconNameRole] !== undefined) ? model[control.iconNameRole] : null
highlighted: control.highlightedIndex === index
highlighted: control.mouseInPopupContent && control.highlightedIndex === index
hoverEnabled: control.hoverEnabled
autoExclusive: true
checked: control.currentIndex === index
}

onHighlightedIndexChanged: {
mouseInPopupContent = true
}

indicator: Loader {
sourceComponent: control.editable ? editableIndicator : normalIndicator
x: control.mirrored ? control.padding : control.width - width - control.padding
Expand Down Expand Up @@ -172,6 +177,12 @@ T.ComboBox {
view.currentIndex: control.highlightedIndex
view.highlightRangeMode: ListView.ApplyRange
view.highlightMoveDuration: 0

HoverHandler {
onHoveredChanged: {
control.mouseInPopupContent = hovered
}
}
}

background: FloatingPanel {
Expand Down