Fix code style

Most stuff here was recently changed. Some of it was where I found a pattern in something that was likely copy-pasted from somewhere else, so I did a global search and replace on that.

Contributes to issue CURA-5784.
This commit is contained in:
Ghostkeeper 2018-10-18 14:30:11 +02:00
parent a4c609d514
commit 1bcd134f85
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
24 changed files with 433 additions and 243 deletions

View file

@ -21,7 +21,7 @@ Rectangle
// Height has an extra 2x margin for the top & bottom margin.
height: childrenRect.height + 2 * UM.Theme.getSize("default_margin").width
Cura.ExtrudersModel { id: extrudersModel; }
Cura.ExtrudersModel { id: extrudersModel }
ListView
{
@ -41,7 +41,7 @@ Rectangle
margins: UM.Theme.getSize("sidebar_margin").width
}
ExclusiveGroup { id: extruderMenuGroup; }
ExclusiveGroup { id: extruderMenuGroup }
orientation: ListView.Horizontal
@ -69,8 +69,10 @@ Rectangle
{
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
onClicked: {
switch (mouse.button) {
onClicked:
{
switch (mouse.button)
{
case Qt.LeftButton:
extruder_enabled = Cura.MachineManager.getExtruder(model.index).isEnabled
if (extruder_enabled)
@ -114,7 +116,8 @@ Rectangle
{
anchors.fill: parent
border.width: control.checked ? UM.Theme.getSize("default_lining").width * 2 : UM.Theme.getSize("default_lining").width
border.color: {
border.color:
{
if (Cura.MachineManager.getExtruder(index).isEnabled)
{
if(control.checked || control.pressed)
@ -128,13 +131,15 @@ Rectangle
}
return UM.Theme.getColor("action_button_disabled_border")
}
color: {
color:
{
if (Cura.MachineManager.getExtruder(index).isEnabled)
{
if(control.checked || control.pressed)
{
return UM.Theme.getColor("action_button_active");
} else if (control.hovered)
}
else if (control.hovered)
{
return UM.Theme.getColor("action_button_hovered")
}
@ -157,13 +162,15 @@ Rectangle
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
color: {
color:
{
if (Cura.MachineManager.getExtruder(index).isEnabled)
{
if(control.checked || control.pressed)
{
return UM.Theme.getColor("action_button_active_text");
} else if (control.hovered)
}
else if (control.hovered)
{
return UM.Theme.getColor("action_button_hovered_text")
}