mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Unify activeQualityDisplayNameMap string creation
Generation quality display names in `CustomPrintSetup.qml` and `PrintSetupSelectorHeader.qml` were so similar that I decided to combine the logic. Cura-9773
This commit is contained in:
parent
e8f6786e97
commit
52ee149edc
3 changed files with 46 additions and 71 deletions
|
|
@ -17,26 +17,8 @@ RowLayout
|
|||
{
|
||||
source: UM.Theme.getIcon("Sliders", "medium")
|
||||
iconSize: UM.Theme.getSize("button_icon").width
|
||||
text:
|
||||
{
|
||||
if (Cura.MachineManager.activeStack)
|
||||
{
|
||||
var resultMap = Cura.MachineManager.activeQualityDisplayNameMap
|
||||
var text = resultMap["main"]
|
||||
if (resultMap["suffix"])
|
||||
{
|
||||
text += " - " + resultMap["suffix"]
|
||||
}
|
||||
|
||||
if (!Cura.MachineManager.hasNotSupportedQuality)
|
||||
{
|
||||
text += " - " + layerHeight.properties.value + "mm"
|
||||
text += Cura.MachineManager.isActiveQualityExperimental ? " - " + catalog.i18nc("@label", "Experimental") : ""
|
||||
}
|
||||
return text
|
||||
}
|
||||
return ""
|
||||
}
|
||||
text: Cura.MachineManager.activeQualityDisplayNameStringParts.join(" - ")
|
||||
font: UM.Theme.getFont("medium")
|
||||
elide: Text.ElideMiddle
|
||||
wrapMode: Text.NoWrap
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue