mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 22:49:01 +08:00
Move profiles dropdown text generator to separate method
This commit is contained in:
parent
3794ae16ae
commit
35684e0aa4
@ -51,27 +51,34 @@ Item
|
|||||||
{
|
{
|
||||||
id: globalProfileSelection
|
id: globalProfileSelection
|
||||||
|
|
||||||
text: {
|
text: generateActiveQualityText()
|
||||||
var result = Cura.MachineManager.activeQualityName;
|
|
||||||
if (Cura.MachineManager.activeQualityLayerHeight > 0) {
|
|
||||||
result += " <font color=\"" + UM.Theme.getColor("text_detail") + "\">";
|
|
||||||
result += " - ";
|
|
||||||
result += Cura.MachineManager.activeQualityLayerHeight + "mm";
|
|
||||||
result += "</font>";
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
enabled: !header.currentExtruderVisible || header.currentExtruderIndex > -1
|
enabled: !header.currentExtruderVisible || header.currentExtruderIndex > -1
|
||||||
|
|
||||||
width: Math.floor(parent.width * 0.55)
|
width: Math.floor(parent.width * 0.55)
|
||||||
height: UM.Theme.getSize("setting_control").height
|
height: UM.Theme.getSize("setting_control").height
|
||||||
anchors.left: globalProfileLabel.right
|
anchors.left: globalProfileLabel.right
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
tooltip: Cura.MachineManager.activeQualityName
|
tooltip: Cura.MachineManager.activeQualityName
|
||||||
style: UM.Theme.styles.sidebar_header_button
|
style: UM.Theme.styles.sidebar_header_button
|
||||||
activeFocusOnPress: true;
|
activeFocusOnPress: true
|
||||||
menu: ProfileMenu { }
|
menu: ProfileMenu { }
|
||||||
|
|
||||||
|
function generateActiveQualityText () {
|
||||||
|
var result = ""
|
||||||
|
|
||||||
|
if (Cura.MachineManager.activeQualityName) {
|
||||||
|
result += Cura.MachineManager.activeQualityName
|
||||||
|
|
||||||
|
if (Cura.MachineManager.activeQualityLayerHeight > 0) {
|
||||||
|
result += " <font color=\"" + UM.Theme.getColor("text_detail") + "\">"
|
||||||
|
result += " - "
|
||||||
|
result += Cura.MachineManager.activeQualityLayerHeight + "mm"
|
||||||
|
result += "</font>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
UM.SimpleButton
|
UM.SimpleButton
|
||||||
{
|
{
|
||||||
id: customisedSettings
|
id: customisedSettings
|
||||||
|
Loading…
x
Reference in New Issue
Block a user