mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 20:39:01 +08:00
Update available configuration button
This commit is contained in:
parent
29d1de03d1
commit
f90f5f5180
@ -103,9 +103,24 @@ Rectangle
|
|||||||
id: mouse
|
id: mouse
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: activateConfiguration()
|
onClicked: activateConfiguration()
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onEntered: parent.border.color = UM.Theme.getColor("configuration_item_border_hover")
|
onEntered:
|
||||||
onExited: updateBorderColor()
|
{
|
||||||
|
parent.border.color = UM.Theme.getColor("configuration_item_border_hover")
|
||||||
|
if (configurationItem.selected == false)
|
||||||
|
{
|
||||||
|
configurationItem.color = UM.Theme.getColor("sidebar_lining")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onExited:
|
||||||
|
{
|
||||||
|
updateBorderColor()
|
||||||
|
if (configurationItem.selected == false)
|
||||||
|
{
|
||||||
|
configurationItem.color = UM.Theme.getColor("configuration_item")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections
|
Connections
|
||||||
@ -122,4 +137,13 @@ Rectangle
|
|||||||
configurationItem.selected = Cura.MachineManager.matchesConfiguration(configuration)
|
configurationItem.selected = Cura.MachineManager.matchesConfiguration(configuration)
|
||||||
updateBorderColor()
|
updateBorderColor()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onVisibleChanged:
|
||||||
|
{
|
||||||
|
if(visible)
|
||||||
|
{
|
||||||
|
// I cannot trigger function updateBorderColor() after visibility change
|
||||||
|
color = selected ? UM.Theme.getColor("configuration_item_active") : UM.Theme.getColor("configuration_item")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user