mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-20 05:07:50 -06:00
Highlight quality_changes values in manage profiles tabs...
and strike out values that are overridden by a user value CURA-2514
This commit is contained in:
parent
556431b984
commit
10dc8f98b8
2 changed files with 30 additions and 2 deletions
|
@ -16,8 +16,9 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel):
|
|||
LabelRole = Qt.UserRole + 2
|
||||
UnitRole = Qt.UserRole + 3
|
||||
ProfileValueRole = Qt.UserRole + 4
|
||||
UserValueRole = Qt.UserRole + 5
|
||||
CategoryRole = Qt.UserRole + 6
|
||||
ProfileValueSourceRole = Qt.UserRole + 5
|
||||
UserValueRole = Qt.UserRole + 6
|
||||
CategoryRole = Qt.UserRole + 7
|
||||
|
||||
def __init__(self, parent = None):
|
||||
super().__init__(parent = parent)
|
||||
|
@ -33,6 +34,7 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel):
|
|||
self.addRoleName(self.LabelRole, "label")
|
||||
self.addRoleName(self.UnitRole, "unit")
|
||||
self.addRoleName(self.ProfileValueRole, "profile_value")
|
||||
self.addRoleName(self.ProfileValueSourceRole, "profile_value_source")
|
||||
self.addRoleName(self.UserValueRole, "user_value")
|
||||
self.addRoleName(self.CategoryRole, "category")
|
||||
|
||||
|
@ -170,9 +172,11 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel):
|
|||
continue
|
||||
|
||||
profile_value = None
|
||||
profile_value_source = ""
|
||||
for container in containers:
|
||||
new_value = container.getProperty(definition.key, "value")
|
||||
if new_value is not None:
|
||||
profile_value_source = container.getMetaDataEntry("type")
|
||||
profile_value = new_value
|
||||
|
||||
user_value = None
|
||||
|
@ -201,6 +205,7 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel):
|
|||
"label": definition.label,
|
||||
"unit": definition.unit,
|
||||
"profile_value": "" if profile_value is None else str(profile_value), # it is for display only
|
||||
"profile_value_source": profile_value_source,
|
||||
"user_value": "" if user_value is None else str(user_value),
|
||||
"category": current_category
|
||||
})
|
||||
|
|
|
@ -32,6 +32,26 @@ Tab
|
|||
role: "profile_value"
|
||||
title: catalog.i18nc("@title:column", "Profile")
|
||||
width: parent.width * 0.18
|
||||
delegate: Rectangle
|
||||
{
|
||||
property var setting: qualitySettings.getItem(styleData.row)
|
||||
height: childrenRect.height
|
||||
color: "transparent"
|
||||
width: (parent != null) ? parent.width : 0
|
||||
Label
|
||||
{
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.right: parent.right
|
||||
text: styleData.value
|
||||
font.weight: (setting.profile_value_source == "quality_changes") ? Font.Bold : Font.Normal
|
||||
font.strikeout: quality == Cura.MachineManager.activeQualityId && setting.user_value != ""
|
||||
opacity: font.strikeout ? 0.5 : 1
|
||||
color: styleData.textColor
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
TableViewColumn
|
||||
{
|
||||
|
@ -56,10 +76,13 @@ Tab
|
|||
|
||||
model: Cura.QualitySettingsModel
|
||||
{
|
||||
id: qualitySettings
|
||||
extruderId: base.extruderId
|
||||
extruderDefinition: base.extruderDefinition
|
||||
quality: base.quality != null ? base.quality : ""
|
||||
material: base.material != null ? base.material : ""
|
||||
}
|
||||
|
||||
SystemPalette { id: palette }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue