mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Add colour scheme for line width
Implements CURA-7741.
This commit is contained in:
parent
0c9175d7f7
commit
dc68fbc94a
5 changed files with 68 additions and 3 deletions
|
@ -89,6 +89,7 @@ Cura.ExpandableComponent
|
|||
property bool show_gradient: UM.SimulationView.compatibilityMode ? false : UM.Preferences.getValue("layerview/layer_view_type") == 2 || UM.Preferences.getValue("layerview/layer_view_type") == 3
|
||||
property bool show_feedrate_gradient: show_gradient && UM.Preferences.getValue("layerview/layer_view_type") == 2
|
||||
property bool show_thickness_gradient: show_gradient && UM.Preferences.getValue("layerview/layer_view_type") == 3
|
||||
property bool show_line_width_gradient: show_gradient && UM.Preferences.getValue("layerview/layer_view_type") == 4
|
||||
property bool only_show_top_layers: UM.Preferences.getValue("view/only_show_top_layers")
|
||||
property int top_layer_count: UM.Preferences.getValue("view/top_layer_count")
|
||||
|
||||
|
@ -117,9 +118,13 @@ Cura.ExpandableComponent
|
|||
type_id: 2
|
||||
})
|
||||
layerViewTypes.append({
|
||||
text: catalog.i18nc("@label:listbox", "Layer thickness"),
|
||||
text: catalog.i18nc("@label:listbox", "Layer Thickness"),
|
||||
type_id: 3 // these ids match the switching in the shader
|
||||
})
|
||||
layerViewTypes.append({
|
||||
text: catalog.i18nc("@label:listbox", "Line Width"),
|
||||
type_id: 4
|
||||
})
|
||||
}
|
||||
|
||||
ComboBox
|
||||
|
@ -145,9 +150,10 @@ Cura.ExpandableComponent
|
|||
{
|
||||
// Update the visibility of the legends.
|
||||
viewSettings.show_legend = UM.SimulationView.compatibilityMode || (type_id == 1);
|
||||
viewSettings.show_gradient = !UM.SimulationView.compatibilityMode && (type_id == 2 || type_id == 3);
|
||||
viewSettings.show_gradient = !UM.SimulationView.compatibilityMode && (type_id == 2 || type_id == 3 || type_id == 4);
|
||||
viewSettings.show_feedrate_gradient = viewSettings.show_gradient && (type_id == 2);
|
||||
viewSettings.show_thickness_gradient = viewSettings.show_gradient && (type_id == 3);
|
||||
viewSettings.show_line_width_gradient = viewSettings.show_gradient && (type_id == 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -390,6 +396,11 @@ Cura.ExpandableComponent
|
|||
{
|
||||
return parseFloat(UM.SimulationView.getMinThickness()).toFixed(2)
|
||||
}
|
||||
//Line width selected
|
||||
if(UM.Preferences.getValue("layerview/layer_view_type") == 4)
|
||||
{
|
||||
return parseFloat(UM.SimulationView.getMinLineWidth()).toFixed(2);
|
||||
}
|
||||
}
|
||||
return catalog.i18nc("@label","min")
|
||||
}
|
||||
|
@ -415,6 +426,11 @@ Cura.ExpandableComponent
|
|||
{
|
||||
return "mm"
|
||||
}
|
||||
//Line width selected
|
||||
if(UM.Preferences.getValue("layerview/layer_view_type") == 4)
|
||||
{
|
||||
return "mm"
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
@ -439,6 +455,11 @@ Cura.ExpandableComponent
|
|||
{
|
||||
return parseFloat(UM.SimulationView.getMaxThickness()).toFixed(2)
|
||||
}
|
||||
//Line width selected
|
||||
if(UM.Preferences.getValue("layerview/layer_view_type") == 4)
|
||||
{
|
||||
return parseFloat(UM.SimulationView.getMaxLineWidth()).toFixed(2);
|
||||
}
|
||||
}
|
||||
return catalog.i18nc("@label","max")
|
||||
}
|
||||
|
@ -453,7 +474,7 @@ Cura.ExpandableComponent
|
|||
Rectangle
|
||||
{
|
||||
id: feedrateGradient
|
||||
visible: viewSettings.show_feedrate_gradient
|
||||
visible: viewSettings.show_feedrate_gradient || viewSettings.show_line_width_gradient
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
height: Math.round(UM.Theme.getSize("layerview_row").height * 1.5)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue