mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-10 09:19:01 +08:00
Fix quality management page QML
CURA-5063
This commit is contained in:
parent
6bee5bf1b0
commit
3550ef80e0
@ -69,7 +69,7 @@ class QualitySettingsModel(ListModel):
|
||||
return self._selected_quality_item
|
||||
|
||||
def _update(self):
|
||||
if self._selected_quality_item is None:
|
||||
if not self._selected_quality_item:
|
||||
self.setItems([])
|
||||
return
|
||||
|
||||
|
@ -14,6 +14,15 @@ Tab
|
||||
property string extruderPosition: ""
|
||||
property var qualityItem: null
|
||||
|
||||
property bool isQualityItemCurrentlyActivated:
|
||||
{
|
||||
if (qualityItem == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return qualityItem.name == Cura.MachineManager.activeQualityOrQualityChangesName;
|
||||
}
|
||||
|
||||
TableView
|
||||
{
|
||||
anchors.fill: parent
|
||||
@ -36,8 +45,8 @@ Tab
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.right: parent.right
|
||||
text: (styleData.value.substr(0,1) == "=") ? catalog.i18nc("@info:status", "Calculated") : styleData.value
|
||||
font.strikeout: styleData.column == 1 && setting.user_value != "" && qualityItem.name == Cura.MachineManager.activeQualityOrQualityChangesName
|
||||
font.italic: setting.profile_value_source == "quality_changes" || (setting.user_value != "" && qualityItem.name == Cura.MachineManager.activeQualityOrQualityChangesName)
|
||||
font.strikeout: styleData.column == 1 && setting.user_value != "" && base.isQualityItemCurrentlyActivated
|
||||
font.italic: setting.profile_value_source == "quality_changes" || (setting.user_value != "" && base.isQualityItemCurrentlyActivated)
|
||||
opacity: font.strikeout ? 0.5 : 1
|
||||
color: styleData.textColor
|
||||
elide: Text.ElideRight
|
||||
@ -63,7 +72,7 @@ Tab
|
||||
{
|
||||
role: "user_value"
|
||||
title: catalog.i18nc("@title:column", "Current");
|
||||
visible: qualityItem.name == Cura.MachineManager.activeQualityOrQualityChangesName
|
||||
visible: base.isQualityItemCurrentlyActivated
|
||||
width: (parent.width * 0.18) | 0
|
||||
delegate: itemDelegate
|
||||
}
|
||||
@ -86,7 +95,7 @@ Tab
|
||||
{
|
||||
id: qualitySettings
|
||||
selectedPosition: base.extruderPosition
|
||||
selectedQualityItem: base.qualityItem
|
||||
selectedQualityItem: base.qualityItem == null ? {} : base.qualityItem
|
||||
}
|
||||
|
||||
SystemPalette { id: palette }
|
||||
|
@ -36,13 +36,15 @@ Item
|
||||
text: catalog.i18nc("@title:tab", "Profiles")
|
||||
}
|
||||
|
||||
property var hasCurrentItem: qualityListView.currentItem != null
|
||||
property var hasCurrentItem: base.currentItem != null
|
||||
|
||||
property var currentItem: {
|
||||
var current_index = qualityListView.currentIndex;
|
||||
return qualitiesModel.getItem(current_index);
|
||||
return (current_index == -1) ? null : qualitiesModel.getItem(current_index);
|
||||
}
|
||||
|
||||
property var currentItemName: hasCurrentItem ? base.currentItem.name : ""
|
||||
|
||||
property var isCurrentItemActivated: {
|
||||
if (!base.currentItem) {
|
||||
return false;
|
||||
@ -235,7 +237,7 @@ Item
|
||||
|
||||
icon: StandardIcon.Question;
|
||||
title: catalog.i18nc("@title:window", "Confirm Remove")
|
||||
text: catalog.i18nc("@label (%1 is object name)", "Are you sure you wish to remove %1? This cannot be undone!").arg(base.currentItem.name)
|
||||
text: catalog.i18nc("@label (%1 is object name)", "Are you sure you wish to remove %1? This cannot be undone!").arg(base.currentItemName)
|
||||
standardButtons: StandardButton.Yes | StandardButton.No
|
||||
modality: Qt.ApplicationModal
|
||||
|
||||
@ -437,6 +439,7 @@ Item
|
||||
Item
|
||||
{
|
||||
anchors.fill: parent
|
||||
visible: base.currentItem != null
|
||||
|
||||
Item // Profile title Label
|
||||
{
|
||||
@ -446,7 +449,7 @@ Item
|
||||
height: childrenRect.height
|
||||
|
||||
Label {
|
||||
text: base.currentItem.name
|
||||
text: base.currentItemName
|
||||
font: UM.Theme.getFont("large")
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user