mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-08 14:34:01 -06:00
Add the 'safe to profile' button itself.
Currently only works for creating a new profile from current changes (when on top of a built-in profile). Only does the compare (not the safe yet) in the other circumstance. Also already anticipate the next commits by being able to hide the text and icon (because this will be added to the custom mode view as well). part of CURA-9347
This commit is contained in:
parent
fb917a88fb
commit
0ea2830108
3 changed files with 47 additions and 9 deletions
|
@ -1,3 +1,6 @@
|
|||
//Copyright (C) 2022 UltiMaker B.V.
|
||||
//Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.10
|
||||
|
||||
import UM 1.6 as UM
|
||||
|
@ -5,15 +8,18 @@ import Cura 1.6 as Cura
|
|||
|
||||
Item
|
||||
{
|
||||
property bool fullWarning: true // <- Can you see the warning icon and the text, or is it just the buttons?
|
||||
|
||||
height: visible ? UM.Theme.getSize("action_button_icon").height : 0
|
||||
visible: Cura.SimpleModeSettingsManager.isProfileCustomized || Cura.MachineManager.hasCustomQuality
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: warningIcon
|
||||
visible: fullWarning
|
||||
color: UM.Theme.getColor("um_yellow_5")
|
||||
height: UM.Theme.getSize("action_button_icon").height
|
||||
width: height
|
||||
width: visible ? height : 0
|
||||
radius: width
|
||||
anchors
|
||||
{
|
||||
|
@ -31,7 +37,8 @@ Item
|
|||
UM.Label
|
||||
{
|
||||
id: warning
|
||||
width: parent.width - warningIcon.width - resetToDefaultQualityButton.width
|
||||
visible: fullWarning
|
||||
width: visible ? parent.width - warningIcon.width - (compareAndSaveButton.width + resetToDefaultQualityButton.width) : 0
|
||||
anchors
|
||||
{
|
||||
left: warningIcon.right
|
||||
|
@ -80,7 +87,33 @@ Item
|
|||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
UM.SimpleButton
|
||||
{
|
||||
id: compareAndSaveButton
|
||||
height: UM.Theme.getSize("action_button_icon").height
|
||||
width: height
|
||||
iconSource: UM.Theme.getIcon("Save")
|
||||
anchors
|
||||
{
|
||||
right: buttonsSpacer.left
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
color: enabled ? UM.Theme.getColor("accent_1") : UM.Theme.getColor("disabled")
|
||||
hoverColor: UM.Theme.getColor("primary_hover")
|
||||
|
||||
enabled: Cura.SimpleModeSettingsManager.isProfileCustomized
|
||||
onClicked: Cura.MachineManager.hasCustomQuality ? CuraApplication.discardOrKeepProfileChanges() : Cura.Actions.addProfile.trigger()
|
||||
}
|
||||
|
||||
// Spacer
|
||||
Item
|
||||
{
|
||||
id: buttonsSpacer
|
||||
width: UM.Theme.getSize("action_button_icon").height
|
||||
anchors.right: resetToDefaultQualityButton.left
|
||||
}
|
||||
|
||||
UM.SimpleButton
|
||||
|
@ -95,12 +128,10 @@ Item
|
|||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
color: UM.Theme.getColor("accent_1")
|
||||
color: enabled ? UM.Theme.getColor("accent_1") : UM.Theme.getColor("disabled")
|
||||
hoverColor: UM.Theme.getColor("primary_hover")
|
||||
|
||||
onClicked:
|
||||
{
|
||||
Cura.MachineManager.resetToUseDefaultQuality()
|
||||
}
|
||||
enabled: Cura.MachineManager.hasCustomQuality || Cura.SimpleModeSettingsManager.isProfileCustomized
|
||||
onClicked: Cura.MachineManager.resetToUseDefaultQuality()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue