mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Switch to column layout in RecommendedPrintSetup.qml so that left margins can be put on infill selector and items below it.
Add warning and reset button when custom profile is select and/or settings have been changed CURA-8849
This commit is contained in:
parent
5fa10b0b8a
commit
8362d4c967
3 changed files with 129 additions and 5 deletions
|
|
@ -0,0 +1,108 @@
|
|||
import QtQuick 2.10
|
||||
|
||||
import UM 1.6 as UM
|
||||
import Cura 1.6 as Cura
|
||||
|
||||
Rectangle
|
||||
{
|
||||
height: visible ? UM.Theme.getSize("action_button_icon").height : 0
|
||||
visible: Cura.SimpleModeSettingsManager.isProfileCustomized || Cura.MachineManager.hasCustomQuality
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin")
|
||||
anchors.bottomMargin: UM.Theme.getSize("default_margin")
|
||||
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: warningIcon
|
||||
color: UM.Theme.getColor("um_yellow_5")
|
||||
height: UM.Theme.getSize("action_button_icon").height
|
||||
width: height
|
||||
radius: width
|
||||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
UM.ColorImage
|
||||
{
|
||||
height: UM.Theme.getSize("action_button_icon").height
|
||||
width: height
|
||||
source: UM.Theme.getIcon("Warning", "low")
|
||||
}
|
||||
}
|
||||
|
||||
UM.Label
|
||||
{
|
||||
id: warning
|
||||
anchors
|
||||
{
|
||||
left: warningIcon.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
leftMargin: UM.Theme.getSize("thin_margin").width
|
||||
}
|
||||
|
||||
text: ""
|
||||
|
||||
states: [
|
||||
State
|
||||
{
|
||||
name: "settings changed and custom quality"
|
||||
when: Cura.SimpleModeSettingsManager.isProfileCustomized && Cura.MachineManager.hasCustomQuality
|
||||
PropertyChanges
|
||||
{
|
||||
target: warning
|
||||
text: {
|
||||
var profile_name = Cura.MachineManager.activeQualityChangesGroup.name
|
||||
return "<b>%1</b> %2".arg(profile_name).arg(catalog.i18nc("@info", "custom profile is active and you overwrote some settings."))
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
State
|
||||
{
|
||||
name: "custom quality"
|
||||
when: Cura.MachineManager.hasCustomQuality
|
||||
PropertyChanges
|
||||
{
|
||||
target: warning
|
||||
text: {
|
||||
var profile_name = Cura.MachineManager.activeQualityChangesGroup.name
|
||||
return "<b>%1</b> %2".arg(profile_name).arg(catalog.i18nc("@info", "custom profile is overriding some settings."))
|
||||
}
|
||||
}
|
||||
},
|
||||
State
|
||||
{
|
||||
name: "settings changed"
|
||||
when: Cura.SimpleModeSettingsManager.isProfileCustomized
|
||||
PropertyChanges
|
||||
{
|
||||
target: warning
|
||||
text: catalog.i18nc("@info", "Some settings were changed.")
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
UM.SimpleButton
|
||||
{
|
||||
id: resetToDefaultQualityButton
|
||||
height: UM.Theme.getSize("action_button_icon").height
|
||||
width: height
|
||||
iconSource: UM.Theme.getIcon("ArrowReset")
|
||||
anchors
|
||||
{
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
color: UM.Theme.getColor("accent_1")
|
||||
|
||||
onClicked:
|
||||
{
|
||||
Cura.MachineManager.resetToUseDefaultQuality()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue