WIP: Disable unknown printer type buttons

This commit is contained in:
Lipu Fei 2019-03-14 11:16:31 +01:00
parent 2b0e9ea439
commit b3621bae84
4 changed files with 30 additions and 4 deletions

View file

@ -84,7 +84,14 @@ Button
background: Rectangle
{
id: backgroundRect
color: machineSelectorButton.hovered ? UM.Theme.getColor("action_button_hovered") : "transparent"
color:
{
if (!machineSelectorButton.enabled)
{
return UM.Theme.getColor("action_button_disabled")
}
return machineSelectorButton.hovered ? UM.Theme.getColor("action_button_hovered") : "transparent"
}
radius: UM.Theme.getSize("action_button_radius").width
border.width: UM.Theme.getSize("default_lining").width
border.color: machineSelectorButton.selected ? UM.Theme.getColor("primary") : "transparent"