mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-18 20:28:01 -06:00
Removed crappy legend
This commit is contained in:
commit
3a2438937d
24 changed files with 536 additions and 189 deletions
|
@ -70,8 +70,9 @@ class WorkspaceDialog(QObject):
|
|||
return self._variant_type
|
||||
|
||||
def setVariantType(self, variant_type):
|
||||
self._variant_type = variant_type
|
||||
self.variantTypeChanged.emit()
|
||||
if self._variant_type != variant_type:
|
||||
self._variant_type = variant_type
|
||||
self.variantTypeChanged.emit()
|
||||
|
||||
@pyqtProperty(str, notify=machineTypeChanged)
|
||||
def machineType(self):
|
||||
|
@ -82,8 +83,9 @@ class WorkspaceDialog(QObject):
|
|||
self.machineTypeChanged.emit()
|
||||
|
||||
def setNumUserSettings(self, num_user_settings):
|
||||
self._num_user_settings = num_user_settings
|
||||
self.numVisibleSettingsChanged.emit()
|
||||
if self._num_user_settings != num_user_settings:
|
||||
self._num_user_settings = num_user_settings
|
||||
self.numVisibleSettingsChanged.emit()
|
||||
|
||||
@pyqtProperty(int, notify=numUserSettingsChanged)
|
||||
def numUserSettings(self):
|
||||
|
@ -94,40 +96,45 @@ class WorkspaceDialog(QObject):
|
|||
return self._objects_on_plate
|
||||
|
||||
def setHasObjectsOnPlate(self, objects_on_plate):
|
||||
self._objects_on_plate = objects_on_plate
|
||||
self.objectsOnPlateChanged.emit()
|
||||
if self._objects_on_plate != objects_on_plate:
|
||||
self._objects_on_plate = objects_on_plate
|
||||
self.objectsOnPlateChanged.emit()
|
||||
|
||||
@pyqtProperty("QVariantList", notify = materialLabelsChanged)
|
||||
def materialLabels(self):
|
||||
return self._material_labels
|
||||
|
||||
def setMaterialLabels(self, material_labels):
|
||||
self._material_labels = material_labels
|
||||
self.materialLabelsChanged.emit()
|
||||
if self._material_labels != material_labels:
|
||||
self._material_labels = material_labels
|
||||
self.materialLabelsChanged.emit()
|
||||
|
||||
@pyqtProperty("QVariantList", notify=extrudersChanged)
|
||||
def extruders(self):
|
||||
return self._extruders
|
||||
|
||||
def setExtruders(self, extruders):
|
||||
self._extruders = extruders
|
||||
self.extrudersChanged.emit()
|
||||
if self._extruders != extruders:
|
||||
self._extruders = extruders
|
||||
self.extrudersChanged.emit()
|
||||
|
||||
@pyqtProperty(str, notify = machineNameChanged)
|
||||
def machineName(self):
|
||||
return self._machine_name
|
||||
|
||||
def setMachineName(self, machine_name):
|
||||
self._machine_name = machine_name
|
||||
self.machineNameChanged.emit()
|
||||
if self._machine_name != machine_name:
|
||||
self._machine_name = machine_name
|
||||
self.machineNameChanged.emit()
|
||||
|
||||
@pyqtProperty(str, notify=qualityTypeChanged)
|
||||
def qualityType(self):
|
||||
return self._quality_type
|
||||
|
||||
def setQualityType(self, quality_type):
|
||||
self._quality_type = quality_type
|
||||
self.qualityTypeChanged.emit()
|
||||
if self._quality_type != quality_type:
|
||||
self._quality_type = quality_type
|
||||
self.qualityTypeChanged.emit()
|
||||
|
||||
@pyqtProperty(int, notify=numSettingsOverridenByQualityChangesChanged)
|
||||
def numSettingsOverridenByQualityChanges(self):
|
||||
|
@ -142,8 +149,9 @@ class WorkspaceDialog(QObject):
|
|||
return self._quality_name
|
||||
|
||||
def setQualityName(self, quality_name):
|
||||
self._quality_name = quality_name
|
||||
self.qualityNameChanged.emit()
|
||||
if self._quality_name != quality_name:
|
||||
self._quality_name = quality_name
|
||||
self.qualityNameChanged.emit()
|
||||
|
||||
@pyqtProperty(str, notify=activeModeChanged)
|
||||
def activeMode(self):
|
||||
|
@ -165,8 +173,9 @@ class WorkspaceDialog(QObject):
|
|||
return self._num_visible_settings
|
||||
|
||||
def setNumVisibleSettings(self, num_visible_settings):
|
||||
self._num_visible_settings = num_visible_settings
|
||||
self.numVisibleSettingsChanged.emit()
|
||||
if self._num_visible_settings != num_visible_settings:
|
||||
self._num_visible_settings = num_visible_settings
|
||||
self.numVisibleSettingsChanged.emit()
|
||||
|
||||
@pyqtProperty(bool, notify = machineConflictChanged)
|
||||
def machineConflict(self):
|
||||
|
@ -191,16 +200,19 @@ class WorkspaceDialog(QObject):
|
|||
Application.getInstance().getBackend().close()
|
||||
|
||||
def setMaterialConflict(self, material_conflict):
|
||||
self._has_material_conflict = material_conflict
|
||||
self.materialConflictChanged.emit()
|
||||
if self._has_material_conflict != material_conflict:
|
||||
self._has_material_conflict = material_conflict
|
||||
self.materialConflictChanged.emit()
|
||||
|
||||
def setMachineConflict(self, machine_conflict):
|
||||
self._has_machine_conflict = machine_conflict
|
||||
self.machineConflictChanged.emit()
|
||||
if self._has_machine_conflict != machine_conflict:
|
||||
self._has_machine_conflict = machine_conflict
|
||||
self.machineConflictChanged.emit()
|
||||
|
||||
def setQualityChangesConflict(self, quality_changes_conflict):
|
||||
self._has_quality_changes_conflict = quality_changes_conflict
|
||||
self.qualityChangesConflictChanged.emit()
|
||||
if self._has_quality_changes_conflict != quality_changes_conflict:
|
||||
self._has_quality_changes_conflict = quality_changes_conflict
|
||||
self.qualityChangesConflictChanged.emit()
|
||||
|
||||
def getResult(self):
|
||||
if "machine" in self._result and not self._has_machine_conflict:
|
||||
|
|
|
@ -98,6 +98,9 @@ Use a mesh to specify a volume within which to classify nothing as overhang for
|
|||
*Delta printer support
|
||||
This release adds support for printers with elliptic buildplates. This feature has not been extensively tested so please let us know if it works or get involved in improving it.
|
||||
|
||||
*AppImage for Linux
|
||||
The Linux distribution is now in AppImage format, which makes Cura easier to install.
|
||||
|
||||
*bugfixes
|
||||
The user is now notified when a new version of Cura is available.
|
||||
When searching in the setting visibility preferences, the category for each setting is always displayed.
|
||||
|
|
|
@ -12,11 +12,9 @@ UM.Dialog
|
|||
{
|
||||
width: 350 * Screen.devicePixelRatio;
|
||||
minimumWidth: 350 * Screen.devicePixelRatio;
|
||||
maximumWidth: 350 * Screen.devicePixelRatio;
|
||||
|
||||
height: 250 * Screen.devicePixelRatio;
|
||||
minimumHeight: 250 * Screen.devicePixelRatio;
|
||||
maximumHeight: 250 * Screen.devicePixelRatio;
|
||||
|
||||
title: catalog.i18nc("@title:window", "Convert Image...")
|
||||
|
||||
|
|
|
@ -67,6 +67,7 @@ class LayerView(View):
|
|||
self._show_adhesion = 1
|
||||
self._show_skin = 1
|
||||
self._show_infill = 1
|
||||
self._legend_items = None
|
||||
|
||||
Preferences.getInstance().addPreference("view/top_layer_count", 5)
|
||||
Preferences.getInstance().addPreference("view/only_show_top_layers", False)
|
||||
|
@ -125,7 +126,7 @@ class LayerView(View):
|
|||
|
||||
if not self._ghost_shader:
|
||||
self._ghost_shader = OpenGL.getInstance().createShaderProgram(Resources.getPath(Resources.Shaders, "color.shader"))
|
||||
self._ghost_shader.setUniformValue("u_color", Color(32, 32, 32, 96))
|
||||
self._ghost_shader.setUniformValue("u_color", Color(*Application.getInstance().getTheme().getColor("layerview_ghost").getRgb()))
|
||||
|
||||
for node in DepthFirstIterator(scene.getRoot()):
|
||||
# We do not want to render ConvexHullNode as it conflicts with the bottom layers.
|
||||
|
@ -278,6 +279,9 @@ class LayerView(View):
|
|||
|
||||
if not self._layerview_composite_shader:
|
||||
self._layerview_composite_shader = OpenGL.getInstance().createShaderProgram(os.path.join(PluginRegistry.getInstance().getPluginPath("LayerView"), "layerview_composite.shader"))
|
||||
theme = Application.getInstance().getTheme()
|
||||
self._layerview_composite_shader.setUniformValue("u_background_color", Color(*theme.getColor("viewport_background").getRgb()))
|
||||
self._layerview_composite_shader.setUniformValue("u_outline_color", Color(*theme.getColor("model_selection_outline").getRgb()))
|
||||
|
||||
if not self._composite_pass:
|
||||
self._composite_pass = self.getRenderer().getRenderPass("composite")
|
||||
|
@ -287,6 +291,8 @@ class LayerView(View):
|
|||
self._old_composite_shader = self._composite_pass.getCompositeShader()
|
||||
self._composite_pass.setCompositeShader(self._layerview_composite_shader)
|
||||
|
||||
Application.getInstance().setViewLegendItems(self._getLegendItems())
|
||||
|
||||
elif event.type == Event.ViewDeactivateEvent:
|
||||
self._wireprint_warning_message.hide()
|
||||
Application.getInstance().globalContainerStackChanged.disconnect(self._onGlobalStackChanged)
|
||||
|
@ -296,6 +302,8 @@ class LayerView(View):
|
|||
self._composite_pass.setLayerBindings(self._old_layer_bindings)
|
||||
self._composite_pass.setCompositeShader(self._old_composite_shader)
|
||||
|
||||
Application.getInstance().setViewLegendItems([])
|
||||
|
||||
def _onGlobalStackChanged(self):
|
||||
if self._global_container_stack:
|
||||
self._global_container_stack.propertyChanged.disconnect(self._onPropertyChanged)
|
||||
|
@ -348,6 +356,24 @@ class LayerView(View):
|
|||
|
||||
self._startUpdateTopLayers()
|
||||
|
||||
def _getLegendItems(self):
|
||||
if self._legend_items is None:
|
||||
theme = Application.getInstance().getTheme()
|
||||
self._legend_items = [
|
||||
{"color": theme.getColor("layerview_inset_0").name(), "title": catalog.i18nc("@label:layerview polygon type", "Outer Wall")}, # Inset0Type
|
||||
{"color": theme.getColor("layerview_inset_x").name(), "title": catalog.i18nc("@label:layerview polygon type", "Inner Wall")}, # InsetXType
|
||||
{"color": theme.getColor("layerview_skin").name(), "title": catalog.i18nc("@label:layerview polygon type", "Top / Bottom")}, # SkinType
|
||||
{"color": theme.getColor("layerview_infill").name(), "title": catalog.i18nc("@label:layerview polygon type", "Infill")}, # InfillType
|
||||
{"color": theme.getColor("layerview_support").name(), "title": catalog.i18nc("@label:layerview polygon type", "Support Skin")}, # SupportType
|
||||
{"color": theme.getColor("layerview_support_infill").name(), "title": catalog.i18nc("@label:layerview polygon type", "Support Infill")}, # SupportInfillType
|
||||
{"color": theme.getColor("layerview_support_interface").name(), "title": catalog.i18nc("@label:layerview polygon type", "Support Interface")}, # SupportInterfaceType
|
||||
{"color": theme.getColor("layerview_skirt").name(), "title": catalog.i18nc("@label:layerview polygon type", "Build Plate Adhesion")}, # SkirtType
|
||||
{"color": theme.getColor("layerview_move_combing").name(), "title": catalog.i18nc("@label:layerview polygon type", "Travel Move")}, # MoveCombingType
|
||||
{"color": theme.getColor("layerview_move_retraction").name(), "title": catalog.i18nc("@label:layerview polygon type", "Retraction Move")}, # MoveRetractionType
|
||||
#{"color": theme.getColor("layerview_none").name(), "title": catalog.i18nc("@label:layerview polygon type", "Unknown")} # NoneType
|
||||
]
|
||||
return self._legend_items
|
||||
|
||||
|
||||
class _CreateTopLayersJob(Job):
|
||||
def __init__(self, scene, layer_number, solid_layers):
|
||||
|
|
|
@ -254,61 +254,5 @@ Item
|
|||
text: "Only color active extruder"
|
||||
}
|
||||
}
|
||||
|
||||
// legend
|
||||
ListView {
|
||||
|
||||
visible: (UM.LayerView.getLayerViewType() == 1) // line type
|
||||
anchors.top: view_settings.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
//width: parent.width
|
||||
//height: childrenRect.height
|
||||
|
||||
delegate: Row
|
||||
{
|
||||
Rectangle
|
||||
{
|
||||
id: rect
|
||||
|
||||
x: UM.Theme.getSize("default_margin").width
|
||||
y: index * UM.Theme.getSize("section_icon").height
|
||||
|
||||
//width: UM.Theme.getSize("section_icon").width
|
||||
//height: 0.5 * UM.Theme.getSize("section_icon").height
|
||||
width: UM.Theme.getSize("setting_control").height / 2
|
||||
height: UM.Theme.getSize("setting_control").height / 2
|
||||
//Behavior on height { NumberAnimation { duration: 50; } }
|
||||
|
||||
border.width: UM.Theme.getSize("default_lining").width;
|
||||
border.color: UM.Theme.getColor("slider_groove_border");
|
||||
|
||||
color: model.color;
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
anchors.left: rect.right
|
||||
anchors.verticalCenter: rect.verticalCenter
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
text: model.label
|
||||
}
|
||||
}
|
||||
model: ListModel
|
||||
{
|
||||
id: legendModel
|
||||
}
|
||||
Component.onCompleted:
|
||||
{
|
||||
// see LayerPolygon
|
||||
legendModel.append({ label:catalog.i18nc("@label", "Inset0"), color: "#ff0000" });
|
||||
legendModel.append({ label:catalog.i18nc("@label", "InsetX"), color: "#00ff00" });
|
||||
legendModel.append({ label:catalog.i18nc("@label", "Skin"), color: "#ffff00" });
|
||||
legendModel.append({ label:catalog.i18nc("@label", "Support, Skirt, SupportInfill"), color: "#00ffff" });
|
||||
legendModel.append({ label:catalog.i18nc("@label", "Infill"), color: "#ffbf00" });
|
||||
legendModel.append({ label:catalog.i18nc("@label", "MoveCombing"), color: "#0000ff" });
|
||||
legendModel.append({ label:catalog.i18nc("@label", "MoveRetraction"), color: "#8080ff" });
|
||||
legendModel.append({ label:catalog.i18nc("@label", "SupportInterface"), color: "#3fbfff" });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,8 +38,9 @@ class SolidView(View):
|
|||
|
||||
if not self._disabled_shader:
|
||||
self._disabled_shader = OpenGL.getInstance().createShaderProgram(Resources.getPath(Resources.Shaders, "striped.shader"))
|
||||
self._disabled_shader.setUniformValue("u_diffuseColor1", [0.48, 0.48, 0.48, 1.0])
|
||||
self._disabled_shader.setUniformValue("u_diffuseColor2", [0.68, 0.68, 0.68, 1.0])
|
||||
theme = Application.getInstance().getTheme()
|
||||
self._disabled_shader.setUniformValue("u_diffuseColor1", theme.getColor("model_unslicable").getRgbF())
|
||||
self._disabled_shader.setUniformValue("u_diffuseColor2", theme.getColor("model_unslicable_alt").getRgbF())
|
||||
self._disabled_shader.setUniformValue("u_width", 50.0)
|
||||
|
||||
multi_extrusion = False
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
import os.path
|
||||
|
||||
from UM.Application import Application
|
||||
from UM.Math.Color import Color
|
||||
from UM.PluginRegistry import PluginRegistry
|
||||
from UM.Event import Event
|
||||
from UM.View.View import View
|
||||
|
@ -31,7 +33,7 @@ class XRayView(View):
|
|||
|
||||
if not self._xray_shader:
|
||||
self._xray_shader = OpenGL.getInstance().createShaderProgram(os.path.join(PluginRegistry.getInstance().getPluginPath("XRayView"), "xray.shader"))
|
||||
self._xray_shader.setUniformValue("u_color", [0.1, 0.1, 0.2, 1.0])
|
||||
self._xray_shader.setUniformValue("u_color", Color(*Application.getInstance().getTheme().getColor("xray").getRgb()))
|
||||
|
||||
for node in BreadthFirstIterator(scene.getRoot()):
|
||||
if not node.render(renderer):
|
||||
|
@ -58,6 +60,10 @@ class XRayView(View):
|
|||
|
||||
if not self._xray_composite_shader:
|
||||
self._xray_composite_shader = OpenGL.getInstance().createShaderProgram(os.path.join(PluginRegistry.getInstance().getPluginPath("XRayView"), "xray_composite.shader"))
|
||||
theme = Application.getInstance().getTheme()
|
||||
self._xray_composite_shader.setUniformValue("u_background_color", Color(*theme.getColor("viewport_background").getRgb()))
|
||||
self._xray_composite_shader.setUniformValue("u_error_color", Color(*theme.getColor("xray_error").getRgb()))
|
||||
self._xray_composite_shader.setUniformValue("u_outline_color", Color(*theme.getColor("model_selection_outline").getRgb()))
|
||||
|
||||
if not self._composite_pass:
|
||||
self._composite_pass = self.getRenderer().getRenderPass("composite")
|
||||
|
|
|
@ -22,6 +22,7 @@ fragment =
|
|||
uniform float u_outline_strength;
|
||||
uniform vec4 u_outline_color;
|
||||
uniform vec4 u_error_color;
|
||||
uniform vec4 u_background_color;
|
||||
|
||||
const vec3 x_axis = vec3(1.0, 0.0, 0.0);
|
||||
const vec3 y_axis = vec3(0.0, 1.0, 0.0);
|
||||
|
@ -37,7 +38,7 @@ fragment =
|
|||
kernel[3] = 1.0; kernel[4] = -4.0; kernel[5] = 1.0;
|
||||
kernel[6] = 0.0; kernel[7] = 1.0; kernel[8] = 0.0;
|
||||
|
||||
vec4 result = vec4(0.965, 0.965, 0.965, 1.0);
|
||||
vec4 result = u_background_color;
|
||||
vec4 layer0 = texture2D(u_layer0, v_uvs);
|
||||
|
||||
result = layer0 * layer0.a + result * (1.0 - layer0.a);
|
||||
|
@ -70,6 +71,7 @@ fragment =
|
|||
u_layer0 = 0
|
||||
u_layer1 = 1
|
||||
u_layer2 = 2
|
||||
u_background_color = [0.965, 0.965, 0.965, 1.0]
|
||||
u_outline_strength = 1.0
|
||||
u_outline_color = [0.05, 0.66, 0.89, 1.0]
|
||||
u_error_color = [1.0, 0.0, 0.0, 1.0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue