Make it visually clear which ComboBox item is the current item
Do as the Default style does and make the current item bold. If we don't do this, it can be impossible to distinguish the current item from the highlighted item, especially when the popup obscures the button. Change-Id: If40b9c73c207d07fb5669564cdcfcea29ebed2f1 Fixes: QTBUG-68794 Reviewed-by: Nils Jeisecke <nils.jeisecke@saltation.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
This commit is contained in:
parent
021c6064ad
commit
b943bbf911
|
@ -57,6 +57,7 @@ T.ComboBox {
|
|||
delegate: MenuItem {
|
||||
width: parent.width
|
||||
text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData
|
||||
font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal
|
||||
highlighted: control.highlightedIndex === index
|
||||
hoverEnabled: control.hoverEnabled
|
||||
}
|
||||
|
|
|
@ -61,6 +61,7 @@ T.ComboBox {
|
|||
delegate: ItemDelegate {
|
||||
width: parent.width
|
||||
text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData
|
||||
font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal
|
||||
highlighted: control.highlightedIndex === index
|
||||
hoverEnabled: control.hoverEnabled
|
||||
}
|
||||
|
|
|
@ -58,6 +58,7 @@ T.ComboBox {
|
|||
delegate: ItemDelegate {
|
||||
width: parent.width
|
||||
text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData
|
||||
font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal
|
||||
highlighted: control.highlightedIndex === index
|
||||
hoverEnabled: control.hoverEnabled
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue