mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Merge pull request #12542 from Ultimaker/CURA-8849_intent_selection_fixes
[CURA-8849] Intent selection fixes
This commit is contained in:
commit
50a3511496
5 changed files with 20 additions and 13 deletions
|
@ -36,6 +36,8 @@ class ActiveIntentQualitiesModel(ListModel):
|
||||||
IntentManager.intentCategoryChangedSignal.connect(self._update)
|
IntentManager.intentCategoryChangedSignal.connect(self._update)
|
||||||
machine_manager = cura.CuraApplication.CuraApplication.getInstance().getMachineManager()
|
machine_manager = cura.CuraApplication.CuraApplication.getInstance().getMachineManager()
|
||||||
machine_manager.activeQualityGroupChanged.connect(self._update)
|
machine_manager.activeQualityGroupChanged.connect(self._update)
|
||||||
|
machine_manager.globalContainerChanged.connect(self._updateDelayed)
|
||||||
|
machine_manager.extruderChanged.connect(self._updateDelayed) # We also need to update if an extruder gets disabled
|
||||||
|
|
||||||
self._update_timer = QTimer()
|
self._update_timer = QTimer()
|
||||||
self._update_timer.setInterval(100)
|
self._update_timer.setInterval(100)
|
||||||
|
|
|
@ -3,13 +3,10 @@ import QtQuick 2.10
|
||||||
import UM 1.6 as UM
|
import UM 1.6 as UM
|
||||||
import Cura 1.6 as Cura
|
import Cura 1.6 as Cura
|
||||||
|
|
||||||
Rectangle
|
Item
|
||||||
{
|
{
|
||||||
height: visible ? UM.Theme.getSize("action_button_icon").height : 0
|
height: visible ? UM.Theme.getSize("action_button_icon").height : 0
|
||||||
visible: Cura.SimpleModeSettingsManager.isProfileCustomized || Cura.MachineManager.hasCustomQuality
|
visible: Cura.SimpleModeSettingsManager.isProfileCustomized || Cura.MachineManager.hasCustomQuality
|
||||||
anchors.topMargin: UM.Theme.getSize("default_margin")
|
|
||||||
anchors.bottomMargin: UM.Theme.getSize("default_margin")
|
|
||||||
|
|
||||||
|
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
|
@ -34,6 +31,7 @@ Rectangle
|
||||||
UM.Label
|
UM.Label
|
||||||
{
|
{
|
||||||
id: warning
|
id: warning
|
||||||
|
width: parent.width - warningIcon.width - resetToDefaultQualityButton.width
|
||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
left: warningIcon.right
|
left: warningIcon.right
|
||||||
|
@ -41,7 +39,7 @@ Rectangle
|
||||||
leftMargin: UM.Theme.getSize("thin_margin").width
|
leftMargin: UM.Theme.getSize("thin_margin").width
|
||||||
}
|
}
|
||||||
|
|
||||||
text: ""
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
states: [
|
states: [
|
||||||
State
|
State
|
||||||
|
|
|
@ -40,7 +40,7 @@ Item
|
||||||
RecommendedQualityProfileSelector
|
RecommendedQualityProfileSelector
|
||||||
{
|
{
|
||||||
width: parent.width
|
width: parent.width
|
||||||
visible: recommendedResolutionSelector.visible
|
hasQualityOptions: recommendedResolutionSelector.visible
|
||||||
}
|
}
|
||||||
|
|
||||||
RecommendedResolutionSelector
|
RecommendedResolutionSelector
|
||||||
|
@ -54,6 +54,7 @@ Item
|
||||||
{
|
{
|
||||||
width: parent.width
|
width: parent.width
|
||||||
visible: !recommendedResolutionSelector.visible
|
visible: !recommendedResolutionSelector.visible
|
||||||
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,6 +62,8 @@ Item
|
||||||
{
|
{
|
||||||
width: parent.width
|
width: parent.width
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: UM.Theme.getSize("thin_margin").height
|
||||||
|
Layout.bottomMargin: UM.Theme.getSize("thin_margin").height
|
||||||
}
|
}
|
||||||
|
|
||||||
//Line between the sections.
|
//Line between the sections.
|
||||||
|
@ -83,27 +86,23 @@ Item
|
||||||
RecommendedInfillDensitySelector
|
RecommendedInfillDensitySelector
|
||||||
{
|
{
|
||||||
width: parent.width
|
width: parent.width
|
||||||
// TODO Create a reusable component with these properties to not define them separately for each component
|
|
||||||
labelColumnWidth: parent.firstColumnWidth
|
labelColumnWidth: parent.firstColumnWidth
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: UM.Theme.getSize("default_margin").width
|
|
||||||
Layout.rightMargin: UM.Theme.getSize("default_margin").width
|
Layout.rightMargin: UM.Theme.getSize("default_margin").width
|
||||||
}
|
}
|
||||||
|
|
||||||
RecommendedSupportSelector
|
RecommendedSupportSelector
|
||||||
{
|
{
|
||||||
width: parent.width
|
width: parent.width
|
||||||
// TODO Create a reusable component with these properties to not define them separately for each component
|
|
||||||
labelColumnWidth: parent.firstColumnWidth
|
labelColumnWidth: parent.firstColumnWidth
|
||||||
Layout.leftMargin: UM.Theme.getSize("default_margin").width
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
|
||||||
RecommendedAdhesionSelector
|
RecommendedAdhesionSelector
|
||||||
{
|
{
|
||||||
width: parent.width
|
width: parent.width
|
||||||
// TODO Create a reusable component with these properties to not define them separately for each component
|
|
||||||
labelColumnWidth: parent.firstColumnWidth
|
labelColumnWidth: parent.firstColumnWidth
|
||||||
Layout.leftMargin: UM.Theme.getSize("default_margin").width
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,11 @@ import ".."
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
id: qualityRow
|
id: qualityRow
|
||||||
|
|
||||||
|
property bool hasQualityOptions: true
|
||||||
|
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
visible: intentSelectionRepeater.count > 1 //Only show selector if there's more options than just "default".
|
visible: intentSelectionRepeater.count > 1 && hasQualityOptions //Only show selector if there's more options than just "default".
|
||||||
|
|
||||||
RowLayout
|
RowLayout
|
||||||
{
|
{
|
||||||
|
|
|
@ -66,6 +66,11 @@ Item
|
||||||
{
|
{
|
||||||
var selected_item = model.getItem(currentIndex)
|
var selected_item = model.getItem(currentIndex)
|
||||||
Cura.IntentManager.selectIntent(selected_item.intent_category, selected_item.quality_type)
|
Cura.IntentManager.selectIntent(selected_item.intent_category, selected_item.quality_type)
|
||||||
|
|
||||||
|
if (Cura.IntentManager.currentIntentCategory == selected_item.intent_category)
|
||||||
|
{
|
||||||
|
recommendedResolutionSelector._previousResolution = selected_item.quality_type;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections
|
Connections
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue