mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Move sidebar action button style into styles.qml
This commit is contained in:
parent
0693c0284b
commit
4bfa0f3bb1
2 changed files with 57 additions and 104 deletions
|
@ -226,58 +226,7 @@ Rectangle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
style: ButtonStyle
|
style: UM.Theme.styles.sidebar_action_button
|
||||||
{
|
|
||||||
background: Rectangle
|
|
||||||
{
|
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
|
||||||
border.color:
|
|
||||||
{
|
|
||||||
if(!control.enabled)
|
|
||||||
return UM.Theme.getColor("action_button_disabled_border");
|
|
||||||
else if(control.pressed)
|
|
||||||
return UM.Theme.getColor("action_button_active_border");
|
|
||||||
else if(control.hovered)
|
|
||||||
return UM.Theme.getColor("action_button_hovered_border");
|
|
||||||
else
|
|
||||||
return UM.Theme.getColor("action_button_border");
|
|
||||||
}
|
|
||||||
color:
|
|
||||||
{
|
|
||||||
if(!control.enabled)
|
|
||||||
return UM.Theme.getColor("action_button_disabled");
|
|
||||||
else if(control.pressed)
|
|
||||||
return UM.Theme.getColor("action_button_active");
|
|
||||||
else if(control.hovered)
|
|
||||||
return UM.Theme.getColor("action_button_hovered");
|
|
||||||
else
|
|
||||||
return UM.Theme.getColor("action_button");
|
|
||||||
}
|
|
||||||
Behavior on color { ColorAnimation { duration: 50; } }
|
|
||||||
|
|
||||||
implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("default_margin").width * 2)
|
|
||||||
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
id: actualLabel
|
|
||||||
anchors.centerIn: parent
|
|
||||||
color:
|
|
||||||
{
|
|
||||||
if(!control.enabled)
|
|
||||||
return UM.Theme.getColor("action_button_disabled_text");
|
|
||||||
else if(control.pressed)
|
|
||||||
return UM.Theme.getColor("action_button_active_text");
|
|
||||||
else if(control.hovered)
|
|
||||||
return UM.Theme.getColor("action_button_hovered_text");
|
|
||||||
else
|
|
||||||
return UM.Theme.getColor("action_button_text");
|
|
||||||
}
|
|
||||||
font: UM.Theme.getFont("action_button")
|
|
||||||
text: control.text
|
|
||||||
}
|
|
||||||
}
|
|
||||||
label: Item { }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Button
|
Button
|
||||||
|
@ -293,58 +242,7 @@ Rectangle
|
||||||
text: catalog.i18nc("@label:", "Abort Print")
|
text: catalog.i18nc("@label:", "Abort Print")
|
||||||
onClicked: confirmationDialog.visible = true
|
onClicked: confirmationDialog.visible = true
|
||||||
|
|
||||||
style: ButtonStyle
|
style: UM.Theme.styles.sidebar_action_button
|
||||||
{
|
|
||||||
background: Rectangle
|
|
||||||
{
|
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
|
||||||
border.color:
|
|
||||||
{
|
|
||||||
if(!control.enabled)
|
|
||||||
return UM.Theme.getColor("action_button_disabled_border");
|
|
||||||
else if(control.pressed)
|
|
||||||
return UM.Theme.getColor("action_button_active_border");
|
|
||||||
else if(control.hovered)
|
|
||||||
return UM.Theme.getColor("action_button_hovered_border");
|
|
||||||
else
|
|
||||||
return UM.Theme.getColor("action_button_border");
|
|
||||||
}
|
|
||||||
color:
|
|
||||||
{
|
|
||||||
if(!control.enabled)
|
|
||||||
return UM.Theme.getColor("action_button_disabled");
|
|
||||||
else if(control.pressed)
|
|
||||||
return UM.Theme.getColor("action_button_active");
|
|
||||||
else if(control.hovered)
|
|
||||||
return UM.Theme.getColor("action_button_hovered");
|
|
||||||
else
|
|
||||||
return UM.Theme.getColor("action_button");
|
|
||||||
}
|
|
||||||
Behavior on color { ColorAnimation { duration: 50; } }
|
|
||||||
|
|
||||||
implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("default_margin").width * 2)
|
|
||||||
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
id: actualLabel
|
|
||||||
anchors.centerIn: parent
|
|
||||||
color:
|
|
||||||
{
|
|
||||||
if(!control.enabled)
|
|
||||||
return UM.Theme.getColor("action_button_disabled_text");
|
|
||||||
else if(control.pressed)
|
|
||||||
return UM.Theme.getColor("action_button_active_text");
|
|
||||||
else if(control.hovered)
|
|
||||||
return UM.Theme.getColor("action_button_hovered_text");
|
|
||||||
else
|
|
||||||
return UM.Theme.getColor("action_button_text");
|
|
||||||
}
|
|
||||||
font: UM.Theme.getFont("action_button")
|
|
||||||
text: control.text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
label: Item { }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageDialog
|
MessageDialog
|
||||||
|
|
|
@ -506,4 +506,59 @@ QtObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property Component sidebar_action_button: Component {
|
||||||
|
ButtonStyle
|
||||||
|
{
|
||||||
|
background: Rectangle
|
||||||
|
{
|
||||||
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
|
border.color:
|
||||||
|
{
|
||||||
|
if(!control.enabled)
|
||||||
|
return UM.Theme.getColor("action_button_disabled_border");
|
||||||
|
else if(control.pressed)
|
||||||
|
return UM.Theme.getColor("action_button_active_border");
|
||||||
|
else if(control.hovered)
|
||||||
|
return UM.Theme.getColor("action_button_hovered_border");
|
||||||
|
else
|
||||||
|
return UM.Theme.getColor("action_button_border");
|
||||||
|
}
|
||||||
|
color:
|
||||||
|
{
|
||||||
|
if(!control.enabled)
|
||||||
|
return UM.Theme.getColor("action_button_disabled");
|
||||||
|
else if(control.pressed)
|
||||||
|
return UM.Theme.getColor("action_button_active");
|
||||||
|
else if(control.hovered)
|
||||||
|
return UM.Theme.getColor("action_button_hovered");
|
||||||
|
else
|
||||||
|
return UM.Theme.getColor("action_button");
|
||||||
|
}
|
||||||
|
Behavior on color { ColorAnimation { duration: 50; } }
|
||||||
|
|
||||||
|
implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("default_margin").width * 2)
|
||||||
|
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
id: actualLabel
|
||||||
|
anchors.centerIn: parent
|
||||||
|
color:
|
||||||
|
{
|
||||||
|
if(!control.enabled)
|
||||||
|
return UM.Theme.getColor("action_button_disabled_text");
|
||||||
|
else if(control.pressed)
|
||||||
|
return UM.Theme.getColor("action_button_active_text");
|
||||||
|
else if(control.hovered)
|
||||||
|
return UM.Theme.getColor("action_button_hovered_text");
|
||||||
|
else
|
||||||
|
return UM.Theme.getColor("action_button_text");
|
||||||
|
}
|
||||||
|
font: UM.Theme.getFont("action_button")
|
||||||
|
text: control.text
|
||||||
|
}
|
||||||
|
}
|
||||||
|
label: Item { }
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue