mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Move base hovered logic out of ComboBox.qml since base is undefined in most places the component is used.
CURA-9424
This commit is contained in:
parent
90ce031b27
commit
e4ad9cb48c
5 changed files with 7 additions and 1 deletions
|
@ -150,6 +150,7 @@ Item
|
||||||
width: parent.width / 2 - UM.Theme.getSize("default_margin").width
|
width: parent.width / 2 - UM.Theme.getSize("default_margin").width
|
||||||
height: UM.Theme.getSize("setting_control").height
|
height: UM.Theme.getSize("setting_control").height
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
|
forceHighlight: base.hovered
|
||||||
|
|
||||||
model: ListModel
|
model: ListModel
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,6 +18,7 @@ SettingItem
|
||||||
|
|
||||||
model: definition.options
|
model: definition.options
|
||||||
textRole: "value"
|
textRole: "value"
|
||||||
|
forceHighlight: base.hovered
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,8 @@ SettingItem
|
||||||
id: control
|
id: control
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
forceHighlight: base.hovered
|
||||||
|
|
||||||
property var extrudersModel: CuraApplication.getExtrudersModel()
|
property var extrudersModel: CuraApplication.getExtrudersModel()
|
||||||
|
|
||||||
model: extrudersModel
|
model: extrudersModel
|
||||||
|
|
|
@ -23,6 +23,7 @@ SettingItem
|
||||||
{
|
{
|
||||||
id: control
|
id: control
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
forceHighlight: base.hovered
|
||||||
|
|
||||||
model: base.extrudersWithOptionalModel
|
model: base.extrudersWithOptionalModel
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ ComboBox
|
||||||
property var defaultTextOnEmptyIndex: "" // Text displayed in the combobox when the model has items but no item is selected
|
property var defaultTextOnEmptyIndex: "" // Text displayed in the combobox when the model has items but no item is selected
|
||||||
property alias textFormat: contentLabel.textFormat
|
property alias textFormat: contentLabel.textFormat
|
||||||
property alias backgroundColor: background.color
|
property alias backgroundColor: background.color
|
||||||
|
property bool forceHighlight: false
|
||||||
|
|
||||||
enabled: delegateModel.count > 0
|
enabled: delegateModel.count > 0
|
||||||
|
|
||||||
|
@ -46,7 +47,7 @@ ComboBox
|
||||||
State
|
State
|
||||||
{
|
{
|
||||||
name: "highlighted"
|
name: "highlighted"
|
||||||
when: ((base != undefined && base.hovered) || control.hovered) && !control.activeFocus
|
when: (control.hovered && !control.activeFocus) || forceHighlight
|
||||||
PropertyChanges
|
PropertyChanges
|
||||||
{
|
{
|
||||||
target: background
|
target: background
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue