mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 15:08:58 +08:00
Move labels into components with the controls...
...so they are both children of the same TooltipArea
This commit is contained in:
parent
2ba0dd094e
commit
219d1938c2
@ -83,7 +83,7 @@ Cura.MachineAction
|
|||||||
Column
|
Column
|
||||||
{
|
{
|
||||||
width: settingsTabs.columnWidth
|
width: settingsTabs.columnWidth
|
||||||
spacing: UM.Theme.getSize("default_margin").height
|
spacing: UM.Theme.getSize("default_lining").height
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
@ -91,109 +91,83 @@ Cura.MachineAction
|
|||||||
font.bold: true
|
font.bold: true
|
||||||
}
|
}
|
||||||
|
|
||||||
Grid
|
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
||||||
|
|
||||||
|
Loader
|
||||||
{
|
{
|
||||||
columns: 2
|
id: buildAreaWidthField
|
||||||
columnSpacing: UM.Theme.getSize("default_margin").width
|
sourceComponent: numericTextFieldWithUnit
|
||||||
rowSpacing: UM.Theme.getSize("default_lining").width
|
property string settingKey: "machine_width"
|
||||||
|
property string label: catalog.i18nc("@label", "X (Width)")
|
||||||
|
property string unit: catalog.i18nc("@label", "mm")
|
||||||
|
property bool forceUpdateOnChange: true
|
||||||
|
}
|
||||||
|
|
||||||
Label
|
Loader
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@label", "X (Width)")
|
id: buildAreaDepthField
|
||||||
}
|
sourceComponent: numericTextFieldWithUnit
|
||||||
Loader
|
property string settingKey: "machine_depth"
|
||||||
{
|
property string label: catalog.i18nc("@label", "Y (Depth)")
|
||||||
id: buildAreaWidthField
|
property string unit: catalog.i18nc("@label", "mm")
|
||||||
sourceComponent: numericTextFieldWithUnit
|
property bool forceUpdateOnChange: true
|
||||||
property string settingKey: "machine_width"
|
}
|
||||||
property string unit: catalog.i18nc("@label", "mm")
|
|
||||||
property bool forceUpdateOnChange: true
|
|
||||||
}
|
|
||||||
|
|
||||||
Label
|
Loader
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@label", "Y (Depth)")
|
id: buildAreaHeightField
|
||||||
}
|
sourceComponent: numericTextFieldWithUnit
|
||||||
Loader
|
property string settingKey: "machine_height"
|
||||||
{
|
property string label: catalog.i18nc("@label", "Z (Height)")
|
||||||
id: buildAreaDepthField
|
property string unit: catalog.i18nc("@label", "mm")
|
||||||
sourceComponent: numericTextFieldWithUnit
|
property bool forceUpdateOnChange: true
|
||||||
property string settingKey: "machine_depth"
|
}
|
||||||
property string unit: catalog.i18nc("@label", "mm")
|
|
||||||
property bool forceUpdateOnChange: true
|
|
||||||
}
|
|
||||||
|
|
||||||
Label
|
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
||||||
{
|
|
||||||
text: catalog.i18nc("@label", "Z (Height)")
|
|
||||||
}
|
|
||||||
Loader
|
|
||||||
{
|
|
||||||
id: buildAreaHeightField
|
|
||||||
sourceComponent: numericTextFieldWithUnit
|
|
||||||
property string settingKey: "machine_height"
|
|
||||||
property string unit: catalog.i18nc("@label", "mm")
|
|
||||||
property bool forceUpdateOnChange: true
|
|
||||||
}
|
|
||||||
|
|
||||||
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
Loader
|
||||||
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
{
|
||||||
|
id: shapeComboBox
|
||||||
|
sourceComponent: comboBoxWithOptions
|
||||||
|
property string settingKey: "machine_shape"
|
||||||
|
property string label: catalog.i18nc("@label", "Build plate shape")
|
||||||
|
property bool forceUpdateOnChange: true
|
||||||
|
}
|
||||||
|
|
||||||
Label
|
Loader
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@label", "Build Plate Shape")
|
id: centerIsZeroCheckBox
|
||||||
}
|
sourceComponent: simpleCheckBox
|
||||||
|
property string settingKey: "machine_center_is_zero"
|
||||||
|
property string label: catalog.i18nc("@option:check", "Origin at center")
|
||||||
|
property bool forceUpdateOnChange: true
|
||||||
|
}
|
||||||
|
Loader
|
||||||
|
{
|
||||||
|
id: heatedBedCheckBox
|
||||||
|
sourceComponent: simpleCheckBox
|
||||||
|
property var settingKey: "machine_heated_bed"
|
||||||
|
property string label: catalog.i18nc("@option:check", "Heated bed")
|
||||||
|
property bool forceUpdateOnChange: true
|
||||||
|
}
|
||||||
|
|
||||||
Loader
|
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
||||||
{
|
|
||||||
id: shapeComboBox
|
|
||||||
sourceComponent: comboBoxWithOptions
|
|
||||||
property string settingKey: "machine_shape"
|
|
||||||
property bool forceUpdateOnChange: true
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader
|
Loader
|
||||||
{
|
{
|
||||||
id: centerIsZeroCheckBox
|
id: gcodeFlavorComboBox
|
||||||
sourceComponent: simpleCheckBox
|
sourceComponent: comboBoxWithOptions
|
||||||
property string label: catalog.i18nc("@option:check", "Machine Center is Zero")
|
property string settingKey: "machine_gcode_flavor"
|
||||||
property string settingKey: "machine_center_is_zero"
|
property string label: catalog.i18nc("@label", "GCode flavor")
|
||||||
property bool forceUpdateOnChange: true
|
property bool forceUpdateOnChange: true
|
||||||
}
|
property var afterOnActivate: manager.updateHasMaterialsMetadata
|
||||||
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
|
||||||
Loader
|
|
||||||
{
|
|
||||||
id: heatedBedCheckBox
|
|
||||||
sourceComponent: simpleCheckBox
|
|
||||||
property string label: catalog.i18nc("@option:check", "Heated Bed")
|
|
||||||
property var settingKey: "machine_heated_bed"
|
|
||||||
property bool forceUpdateOnChange: true
|
|
||||||
}
|
|
||||||
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
|
||||||
|
|
||||||
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
|
||||||
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
|
||||||
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
text: catalog.i18nc("@label", "GCode Flavor")
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader
|
|
||||||
{
|
|
||||||
id: gcodeFlavorComboBox
|
|
||||||
sourceComponent: comboBoxWithOptions
|
|
||||||
property string settingKey: "machine_gcode_flavor"
|
|
||||||
property bool forceUpdateOnChange: true
|
|
||||||
property var afterOnActivate: manager.updateHasMaterialsMetadata
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Column
|
Column
|
||||||
{
|
{
|
||||||
width: settingsTabs.columnWidth
|
width: settingsTabs.columnWidth
|
||||||
spacing: UM.Theme.getSize("default_margin").height
|
spacing: UM.Theme.getSize("default_lining").height
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
@ -201,97 +175,79 @@ Cura.MachineAction
|
|||||||
font.bold: true
|
font.bold: true
|
||||||
}
|
}
|
||||||
|
|
||||||
Grid
|
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
||||||
|
|
||||||
|
Loader
|
||||||
{
|
{
|
||||||
columns: 2
|
id: printheadXMinField
|
||||||
columnSpacing: UM.Theme.getSize("default_margin").width
|
sourceComponent: headPolygonTextField
|
||||||
rowSpacing: UM.Theme.getSize("default_lining").width
|
property string label: catalog.i18nc("@label", "X min")
|
||||||
|
property string tooltip: catalog.i18nc("@tooltip", "Distance from the left of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".")
|
||||||
|
property string axis: "x"
|
||||||
|
property string side: "min"
|
||||||
|
}
|
||||||
|
|
||||||
Label
|
Loader
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@label", "X min")
|
id: printheadYMinField
|
||||||
}
|
sourceComponent: headPolygonTextField
|
||||||
Loader
|
property string label: catalog.i18nc("@label", "Y min")
|
||||||
{
|
property string tooltip: catalog.i18nc("@tooltip", "Distance from the front of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".")
|
||||||
id: printheadXMinField
|
property string axis: "y"
|
||||||
sourceComponent: headPolygonTextField
|
property string side: "min"
|
||||||
property string axis: "x"
|
}
|
||||||
property string side: "min"
|
|
||||||
property string tooltip: catalog.i18nc("@tooltip", "Distance from the left of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".")
|
|
||||||
}
|
|
||||||
|
|
||||||
Label
|
Loader
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@label", "Y min")
|
id: printheadXMaxField
|
||||||
}
|
sourceComponent: headPolygonTextField
|
||||||
Loader
|
property string label: catalog.i18nc("@label", "X max")
|
||||||
{
|
property string tooltip: catalog.i18nc("@tooltip", "Distance from the right of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".")
|
||||||
id: printheadYMinField
|
property string axis: "x"
|
||||||
sourceComponent: headPolygonTextField
|
property string side: "max"
|
||||||
property string axis: "y"
|
}
|
||||||
property string side: "min"
|
|
||||||
property string tooltip: catalog.i18nc("@tooltip", "Distance from the front of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".")
|
|
||||||
}
|
|
||||||
|
|
||||||
Label
|
Loader
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@label", "X max")
|
id: printheadYMaxField
|
||||||
}
|
sourceComponent: headPolygonTextField
|
||||||
Loader
|
property string label: catalog.i18nc("@label", "Y max")
|
||||||
{
|
property string tooltip: catalog.i18nc("@tooltip", "Distance from the rear of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".")
|
||||||
id: printheadXMaxField
|
property string axis: "y"
|
||||||
sourceComponent: headPolygonTextField
|
property string side: "max"
|
||||||
property string axis: "x"
|
}
|
||||||
property string side: "max"
|
|
||||||
property string tooltip: catalog.i18nc("@tooltip", "Distance from the right of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".")
|
|
||||||
}
|
|
||||||
|
|
||||||
Label
|
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
||||||
{
|
|
||||||
text: catalog.i18nc("@label", "Y max")
|
|
||||||
}
|
|
||||||
Loader
|
|
||||||
{
|
|
||||||
id: printheadYMaxField
|
|
||||||
sourceComponent: headPolygonTextField
|
|
||||||
property string axis: "y"
|
|
||||||
property string side: "max"
|
|
||||||
property string tooltip: catalog.i18nc("@tooltip", "Distance from the rear of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".")
|
|
||||||
}
|
|
||||||
|
|
||||||
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
Loader
|
||||||
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
{
|
||||||
|
id: gantryHeightField
|
||||||
|
sourceComponent: numericTextFieldWithUnit
|
||||||
|
property string settingKey: "gantry_height"
|
||||||
|
property string label: catalog.i18nc("@label", "Gantry height")
|
||||||
|
property string unit: catalog.i18nc("@label", "mm")
|
||||||
|
property string tooltip: catalog.i18nc("@tooltip", "The height difference between the tip of the nozzle and the gantry system (X and Y axes). Used to prevent collisions between previous prints and the gantry when printing \"One at a Time\".")
|
||||||
|
}
|
||||||
|
|
||||||
Label
|
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
||||||
|
|
||||||
|
UM.TooltipArea
|
||||||
|
{
|
||||||
|
id: extruderCountControl
|
||||||
|
visible: manager.definedExtruderCount > 1
|
||||||
|
height: childrenRect.height
|
||||||
|
width: childrenRect.width
|
||||||
|
text: machineExtruderCountProvider.properties.description
|
||||||
|
|
||||||
|
Row
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@label", "Gantry height")
|
spacing: UM.Theme.getSize("default_margin").width
|
||||||
}
|
|
||||||
Loader
|
|
||||||
{
|
|
||||||
id: gantryHeightField
|
|
||||||
sourceComponent: numericTextFieldWithUnit
|
|
||||||
property string settingKey: "gantry_height"
|
|
||||||
property string unit: catalog.i18nc("@label", "mm")
|
|
||||||
property string tooltip: catalog.i18nc("@tooltip", "The height difference between the tip of the nozzle and the gantry system (X and Y axes). Used to prevent collisions between previous prints and the gantry when printing \"One at a Time\".")
|
|
||||||
}
|
|
||||||
|
|
||||||
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
|
||||||
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
|
||||||
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
text: catalog.i18nc("@label", "Number of Extruders")
|
|
||||||
visible: extruderCountControl.visible
|
|
||||||
}
|
|
||||||
|
|
||||||
UM.TooltipArea
|
|
||||||
{
|
|
||||||
id: extruderCountControl
|
|
||||||
visible: manager.definedExtruderCount > 1
|
|
||||||
height: extruderCountComboBox.height
|
|
||||||
width: extruderCountComboBox.width
|
|
||||||
text: machineExtruderCountProvider.properties.description
|
|
||||||
|
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
text: catalog.i18nc("@label", "Number of Extruders")
|
||||||
|
anchors.verticalCenter: extruderCountComboBox.verticalCenter
|
||||||
|
}
|
||||||
ComboBox
|
ComboBox
|
||||||
{
|
{
|
||||||
id: extruderCountComboBox
|
id: extruderCountComboBox
|
||||||
@ -313,33 +269,26 @@ Cura.MachineAction
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Label
|
Loader
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@label", "Material Diameter")
|
id: materialDiameterField
|
||||||
}
|
sourceComponent: numericTextFieldWithUnit
|
||||||
Loader
|
property string settingKey: "material_diameter"
|
||||||
{
|
property string unit: catalog.i18nc("@label", "mm")
|
||||||
id: materialDiameterField
|
property string tooltip: catalog.i18nc("@tooltip", "The nominal diameter of filament supported by the printer. The exact diameter will be overridden by the material and/or the profile.")
|
||||||
sourceComponent: numericTextFieldWithUnit
|
property var afterOnEditingFinished: manager.updateMaterialForDiameter
|
||||||
property string settingKey: "material_diameter"
|
property string label: catalog.i18nc("@label", "Material diameter")
|
||||||
property string unit: catalog.i18nc("@label", "mm")
|
}
|
||||||
property string tooltip: catalog.i18nc("@tooltip", "The nominal diameter of filament supported by the printer. The exact diameter will be overridden by the material and/or the profile.")
|
Loader
|
||||||
property var afterOnEditingFinished: manager.updateMaterialForDiameter
|
{
|
||||||
}
|
id: nozzleSizeField
|
||||||
Label
|
visible: !Cura.MachineManager.hasVariants && machineExtruderCountProvider.properties.value == 1
|
||||||
{
|
sourceComponent: numericTextFieldWithUnit
|
||||||
text: catalog.i18nc("@label", "Nozzle size")
|
property string settingKey: "machine_nozzle_size"
|
||||||
visible: nozzleSizeField.visible
|
property string label: catalog.i18nc("@label", "Nozzle size")
|
||||||
}
|
property string unit: catalog.i18nc("@label", "mm")
|
||||||
Loader
|
|
||||||
{
|
|
||||||
id: nozzleSizeField
|
|
||||||
visible: !Cura.MachineManager.hasVariants && machineExtruderCountProvider.properties.value == 1
|
|
||||||
sourceComponent: numericTextFieldWithUnit
|
|
||||||
property string settingKey: "machine_nozzle_size"
|
|
||||||
property string unit: catalog.i18nc("@label", "mm")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -413,7 +362,7 @@ Cura.MachineAction
|
|||||||
|
|
||||||
Column
|
Column
|
||||||
{
|
{
|
||||||
spacing: UM.Theme.getSize("default_margin").width
|
spacing: UM.Theme.getSize("default_lining").width
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
@ -421,57 +370,45 @@ Cura.MachineAction
|
|||||||
font.bold: true
|
font.bold: true
|
||||||
}
|
}
|
||||||
|
|
||||||
Grid
|
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
||||||
|
|
||||||
|
Loader
|
||||||
{
|
{
|
||||||
columns: 2
|
id: extruderNozzleSizeField
|
||||||
columnSpacing: UM.Theme.getSize("default_margin").width
|
visible: !Cura.MachineManager.hasVariants
|
||||||
rowSpacing: UM.Theme.getSize("default_lining").width
|
sourceComponent: numericTextFieldWithUnit
|
||||||
|
property string settingKey: "machine_nozzle_size"
|
||||||
Label
|
property string label: catalog.i18nc("@label", "Nozzle size")
|
||||||
{
|
property string unit: catalog.i18nc("@label", "mm")
|
||||||
text: catalog.i18nc("@label", "Nozzle size")
|
property bool isExtruderSetting: true
|
||||||
visible: extruderNozzleSizeField.visible
|
|
||||||
}
|
|
||||||
Loader
|
|
||||||
{
|
|
||||||
id: extruderNozzleSizeField
|
|
||||||
visible: !Cura.MachineManager.hasVariants
|
|
||||||
sourceComponent: numericTextFieldWithUnit
|
|
||||||
property string settingKey: "machine_nozzle_size"
|
|
||||||
property bool isExtruderSetting: true
|
|
||||||
property string unit: catalog.i18nc("@label", "mm")
|
|
||||||
}
|
|
||||||
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
text: catalog.i18nc("@label", "Nozzle offset X")
|
|
||||||
}
|
|
||||||
Loader
|
|
||||||
{
|
|
||||||
id: extruderOffsetXField
|
|
||||||
sourceComponent: numericTextFieldWithUnit
|
|
||||||
property string settingKey: "machine_nozzle_offset_x"
|
|
||||||
property string unit: catalog.i18nc("@label", "mm")
|
|
||||||
property bool isExtruderSetting: true
|
|
||||||
property bool forceUpdateOnChange: true
|
|
||||||
property bool allowNegative: true
|
|
||||||
}
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
text: catalog.i18nc("@label", "Nozzle offset Y")
|
|
||||||
}
|
|
||||||
Loader
|
|
||||||
{
|
|
||||||
id: extruderOffsetYField
|
|
||||||
sourceComponent: numericTextFieldWithUnit
|
|
||||||
property string settingKey: "machine_nozzle_offset_y"
|
|
||||||
property string unit: catalog.i18nc("@label", "mm")
|
|
||||||
property bool isExtruderSetting: true
|
|
||||||
property bool forceUpdateOnChange: true
|
|
||||||
property bool allowNegative: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loader
|
||||||
|
{
|
||||||
|
id: extruderOffsetXField
|
||||||
|
sourceComponent: numericTextFieldWithUnit
|
||||||
|
property string settingKey: "machine_nozzle_offset_x"
|
||||||
|
property string label: catalog.i18nc("@label", "Nozzle offset X")
|
||||||
|
property string unit: catalog.i18nc("@label", "mm")
|
||||||
|
property bool isExtruderSetting: true
|
||||||
|
property bool forceUpdateOnChange: true
|
||||||
|
property bool allowNegative: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Loader
|
||||||
|
{
|
||||||
|
id: extruderOffsetYField
|
||||||
|
sourceComponent: numericTextFieldWithUnit
|
||||||
|
property string settingKey: "machine_nozzle_offset_y"
|
||||||
|
property string label: catalog.i18nc("@label", "Nozzle offset Y")
|
||||||
|
property string unit: catalog.i18nc("@label", "mm")
|
||||||
|
property bool isExtruderSetting: true
|
||||||
|
property bool forceUpdateOnChange: true
|
||||||
|
property bool allowNegative: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
||||||
|
|
||||||
Row
|
Row
|
||||||
{
|
{
|
||||||
spacing: UM.Theme.getSize("default_margin").width
|
spacing: UM.Theme.getSize("default_margin").width
|
||||||
@ -577,14 +514,15 @@ Cura.MachineAction
|
|||||||
id: numericTextFieldWithUnit
|
id: numericTextFieldWithUnit
|
||||||
UM.TooltipArea
|
UM.TooltipArea
|
||||||
{
|
{
|
||||||
height: textField.height
|
height: childrenRect.height
|
||||||
width: textField.width
|
width: childrenRect.width
|
||||||
text: _tooltip
|
text: _tooltip
|
||||||
|
|
||||||
property bool _isExtruderSetting: (typeof(isExtruderSetting) === 'undefined') ? false: isExtruderSetting
|
property bool _isExtruderSetting: (typeof(isExtruderSetting) === 'undefined') ? false: isExtruderSetting
|
||||||
property bool _allowNegative: (typeof(allowNegative) === 'undefined') ? false : allowNegative
|
property bool _allowNegative: (typeof(allowNegative) === 'undefined') ? false : allowNegative
|
||||||
property var _afterOnEditingFinished: (typeof(afterOnEditingFinished) === 'undefined') ? undefined : afterOnEditingFinished
|
property var _afterOnEditingFinished: (typeof(afterOnEditingFinished) === 'undefined') ? undefined : afterOnEditingFinished
|
||||||
property bool _forceUpdateOnChange: (typeof(forceUpdateOnChange) === 'undefined') ? false : forceUpdateOnChange
|
property bool _forceUpdateOnChange: (typeof(forceUpdateOnChange) === 'undefined') ? false : forceUpdateOnChange
|
||||||
|
property string _label: (typeof(label) === 'undefined') ? "" : label
|
||||||
property string _tooltip: (typeof(tooltip) === 'undefined') ? propertyProvider.properties.description : tooltip
|
property string _tooltip: (typeof(tooltip) === 'undefined') ? propertyProvider.properties.description : tooltip
|
||||||
|
|
||||||
UM.SettingPropertyProvider
|
UM.SettingPropertyProvider
|
||||||
@ -607,40 +545,59 @@ Cura.MachineAction
|
|||||||
storeIndex: manager.containerIndex
|
storeIndex: manager.containerIndex
|
||||||
}
|
}
|
||||||
|
|
||||||
TextField
|
Row
|
||||||
{
|
{
|
||||||
id: textField
|
spacing: UM.Theme.getSize("default_margin").width
|
||||||
text: (propertyProvider.properties.value) ? propertyProvider.properties.value : ""
|
|
||||||
validator: RegExpValidator { regExp: _allowNegative ? /-?[0-9\.]{0,6}/ : /[0-9\.]{0,6}/ }
|
Label
|
||||||
onEditingFinished:
|
|
||||||
{
|
{
|
||||||
if (propertyProvider && text != propertyProvider.properties.value)
|
text: _label
|
||||||
|
visible: _label != ""
|
||||||
|
anchors.verticalCenter: textFieldWithUnit.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
Item
|
||||||
|
{
|
||||||
|
width: textField.width
|
||||||
|
height: textField.height
|
||||||
|
|
||||||
|
id: textFieldWithUnit
|
||||||
|
TextField
|
||||||
{
|
{
|
||||||
propertyProvider.setPropertyValue("value", text);
|
id: textField
|
||||||
if(_forceUpdateOnChange)
|
text: (propertyProvider.properties.value) ? propertyProvider.properties.value : ""
|
||||||
|
validator: RegExpValidator { regExp: _allowNegative ? /-?[0-9\.]{0,6}/ : /[0-9\.]{0,6}/ }
|
||||||
|
onEditingFinished:
|
||||||
{
|
{
|
||||||
var extruderIndex = ExtruderManager.activeExtruderIndex;
|
if (propertyProvider && text != propertyProvider.properties.value)
|
||||||
manager.forceUpdate();
|
|
||||||
if(ExtruderManager.activeExtruderIndex != extruderIndex)
|
|
||||||
{
|
{
|
||||||
ExtruderManager.setActiveExtruderIndex(extruderIndex)
|
propertyProvider.setPropertyValue("value", text);
|
||||||
|
if(_forceUpdateOnChange)
|
||||||
|
{
|
||||||
|
var extruderIndex = ExtruderManager.activeExtruderIndex;
|
||||||
|
manager.forceUpdate();
|
||||||
|
if(ExtruderManager.activeExtruderIndex != extruderIndex)
|
||||||
|
{
|
||||||
|
ExtruderManager.setActiveExtruderIndex(extruderIndex)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_afterOnEditingFinished)
|
||||||
|
{
|
||||||
|
_afterOnEditingFinished();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(_afterOnEditingFinished)
|
}
|
||||||
{
|
|
||||||
_afterOnEditingFinished();
|
Label
|
||||||
}
|
{
|
||||||
|
text: unit
|
||||||
|
anchors.right: textField.right
|
||||||
|
anchors.rightMargin: y - textField.y
|
||||||
|
anchors.verticalCenter: textField.verticalCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
text: unit
|
|
||||||
anchors.right: textField.right
|
|
||||||
anchors.rightMargin: y - textField.y
|
|
||||||
anchors.verticalCenter: textField.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -649,13 +606,14 @@ Cura.MachineAction
|
|||||||
id: comboBoxWithOptions
|
id: comboBoxWithOptions
|
||||||
UM.TooltipArea
|
UM.TooltipArea
|
||||||
{
|
{
|
||||||
height: comboBox.height
|
height: childrenRect.height
|
||||||
width: comboBox.width
|
width: childrenRect.width
|
||||||
text: _tooltip
|
text: _tooltip
|
||||||
|
|
||||||
property bool _isExtruderSetting: (typeof(isExtruderSetting) === 'undefined') ? false : isExtruderSetting
|
property bool _isExtruderSetting: (typeof(isExtruderSetting) === 'undefined') ? false : isExtruderSetting
|
||||||
property bool _forceUpdateOnChange: (typeof(forceUpdateOnChange) === 'undefined') ? false : forceUpdateOnChange
|
property bool _forceUpdateOnChange: (typeof(forceUpdateOnChange) === 'undefined') ? false : forceUpdateOnChange
|
||||||
property var _afterOnActivate: (typeof(afterOnActivate) === 'undefined') ? undefined : afterOnActivate
|
property var _afterOnActivate: (typeof(afterOnActivate) === 'undefined') ? undefined : afterOnActivate
|
||||||
|
property string _label: (typeof(label) === 'undefined') ? "" : label
|
||||||
property string _tooltip: (typeof(tooltip) === 'undefined') ? propertyProvider.properties.description : tooltip
|
property string _tooltip: (typeof(tooltip) === 'undefined') ? propertyProvider.properties.description : tooltip
|
||||||
|
|
||||||
UM.SettingPropertyProvider
|
UM.SettingPropertyProvider
|
||||||
@ -678,52 +636,63 @@ Cura.MachineAction
|
|||||||
storeIndex: manager.containerIndex
|
storeIndex: manager.containerIndex
|
||||||
}
|
}
|
||||||
|
|
||||||
ComboBox
|
Row
|
||||||
{
|
{
|
||||||
id: comboBox
|
spacing: UM.Theme.getSize("default_margin").width
|
||||||
model: ListModel
|
|
||||||
|
Label
|
||||||
{
|
{
|
||||||
id: optionsModel
|
text: _label
|
||||||
Component.onCompleted:
|
visible: _label != ""
|
||||||
|
anchors.verticalCenter: textFieldWithUnit.verticalCenter
|
||||||
|
}
|
||||||
|
ComboBox
|
||||||
|
{
|
||||||
|
id: comboBox
|
||||||
|
model: ListModel
|
||||||
{
|
{
|
||||||
// Options come in as a string-representation of an OrderedDict
|
id: optionsModel
|
||||||
var options = propertyProvider.properties.options.match(/^OrderedDict\(\[\((.*)\)\]\)$/);
|
Component.onCompleted:
|
||||||
if(options)
|
|
||||||
{
|
{
|
||||||
options = options[1].split("), (")
|
// Options come in as a string-representation of an OrderedDict
|
||||||
for(var i = 0; i < options.length; i++)
|
var options = propertyProvider.properties.options.match(/^OrderedDict\(\[\((.*)\)\]\)$/);
|
||||||
|
if(options)
|
||||||
{
|
{
|
||||||
var option = options[i].substring(1, options[i].length - 1).split("', '")
|
options = options[1].split("), (")
|
||||||
optionsModel.append({text: option[1], value: option[0]});
|
for(var i = 0; i < options.length; i++)
|
||||||
|
{
|
||||||
|
var option = options[i].substring(1, options[i].length - 1).split("', '")
|
||||||
|
optionsModel.append({text: option[1], value: option[0]});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
currentIndex:
|
||||||
currentIndex:
|
|
||||||
{
|
|
||||||
var currentValue = propertyProvider.properties.value;
|
|
||||||
var index = 0;
|
|
||||||
for(var i = 0; i < optionsModel.count; i++)
|
|
||||||
{
|
{
|
||||||
if(optionsModel.get(i).value == currentValue) {
|
var currentValue = propertyProvider.properties.value;
|
||||||
index = i;
|
var index = 0;
|
||||||
break;
|
for(var i = 0; i < optionsModel.count; i++)
|
||||||
|
{
|
||||||
|
if(optionsModel.get(i).value == currentValue) {
|
||||||
|
index = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return index
|
||||||
}
|
}
|
||||||
return index
|
onActivated:
|
||||||
}
|
|
||||||
onActivated:
|
|
||||||
{
|
|
||||||
if(propertyProvider.properties.value != optionsModel.get(index).value)
|
|
||||||
{
|
{
|
||||||
propertyProvider.setPropertyValue("value", optionsModel.get(index).value);
|
if(propertyProvider.properties.value != optionsModel.get(index).value)
|
||||||
if(_forceUpdateOnChange)
|
|
||||||
{
|
{
|
||||||
manager.forceUpdate();
|
propertyProvider.setPropertyValue("value", optionsModel.get(index).value);
|
||||||
}
|
if(_forceUpdateOnChange)
|
||||||
if(_afterOnActivate)
|
{
|
||||||
{
|
manager.forceUpdate();
|
||||||
_afterOnActivate();
|
}
|
||||||
|
if(_afterOnActivate)
|
||||||
|
{
|
||||||
|
_afterOnActivate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -795,50 +764,70 @@ Cura.MachineAction
|
|||||||
width: textField.width
|
width: textField.width
|
||||||
text: tooltip
|
text: tooltip
|
||||||
|
|
||||||
TextField
|
property string _label: (typeof(label) === 'undefined') ? "" : label
|
||||||
|
|
||||||
|
Row
|
||||||
{
|
{
|
||||||
id: textField
|
spacing: UM.Theme.getSize("default_margin").width
|
||||||
text:
|
|
||||||
|
Label
|
||||||
{
|
{
|
||||||
var polygon = JSON.parse(machineHeadPolygonProvider.properties.value);
|
text: _label
|
||||||
var item = (axis == "x") ? 0 : 1
|
visible: _label != ""
|
||||||
var result = polygon[0][item];
|
anchors.verticalCenter: textFieldWithUnit.verticalCenter
|
||||||
for(var i = 1; i < polygon.length; i++) {
|
}
|
||||||
if (side == "min") {
|
|
||||||
result = Math.min(result, polygon[i][item]);
|
Item
|
||||||
} else {
|
{
|
||||||
result = Math.max(result, polygon[i][item]);
|
width: textField.width
|
||||||
|
height: textField.height
|
||||||
|
|
||||||
|
TextField
|
||||||
|
{
|
||||||
|
id: textField
|
||||||
|
text:
|
||||||
|
{
|
||||||
|
var polygon = JSON.parse(machineHeadPolygonProvider.properties.value);
|
||||||
|
var item = (axis == "x") ? 0 : 1
|
||||||
|
var result = polygon[0][item];
|
||||||
|
for(var i = 1; i < polygon.length; i++) {
|
||||||
|
if (side == "min") {
|
||||||
|
result = Math.min(result, polygon[i][item]);
|
||||||
|
} else {
|
||||||
|
result = Math.max(result, polygon[i][item]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result = Math.abs(result);
|
||||||
|
printHeadPolygon[axis][side] = result;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
validator: RegExpValidator { regExp: /[0-9\.]{0,6}/ }
|
||||||
|
onEditingFinished:
|
||||||
|
{
|
||||||
|
printHeadPolygon[axis][side] = parseFloat(textField.text);
|
||||||
|
var polygon = [];
|
||||||
|
polygon.push([-printHeadPolygon["x"]["min"], printHeadPolygon["y"]["max"]]);
|
||||||
|
polygon.push([-printHeadPolygon["x"]["min"],-printHeadPolygon["y"]["min"]]);
|
||||||
|
polygon.push([ printHeadPolygon["x"]["max"], printHeadPolygon["y"]["max"]]);
|
||||||
|
polygon.push([ printHeadPolygon["x"]["max"],-printHeadPolygon["y"]["mìn"]]);
|
||||||
|
var polygon_string = JSON.stringify(polygon);
|
||||||
|
if(polygon_string != machineHeadPolygonProvider.properties.value)
|
||||||
|
{
|
||||||
|
machineHeadPolygonProvider.setPropertyValue("value", polygon_string);
|
||||||
|
manager.forceUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = Math.abs(result);
|
|
||||||
printHeadPolygon[axis][side] = result;
|
Label
|
||||||
return result;
|
|
||||||
}
|
|
||||||
validator: RegExpValidator { regExp: /[0-9\.]{0,6}/ }
|
|
||||||
onEditingFinished:
|
|
||||||
{
|
|
||||||
printHeadPolygon[axis][side] = parseFloat(textField.text);
|
|
||||||
var polygon = [];
|
|
||||||
polygon.push([-printHeadPolygon["x"]["min"], printHeadPolygon["y"]["max"]]);
|
|
||||||
polygon.push([-printHeadPolygon["x"]["min"],-printHeadPolygon["y"]["min"]]);
|
|
||||||
polygon.push([ printHeadPolygon["x"]["max"], printHeadPolygon["y"]["max"]]);
|
|
||||||
polygon.push([ printHeadPolygon["x"]["max"],-printHeadPolygon["y"]["mìn"]]);
|
|
||||||
var polygon_string = JSON.stringify(polygon);
|
|
||||||
if(polygon_string != machineHeadPolygonProvider.properties.value)
|
|
||||||
{
|
{
|
||||||
machineHeadPolygonProvider.setPropertyValue("value", polygon_string);
|
text: catalog.i18nc("@label", "mm")
|
||||||
manager.forceUpdate();
|
anchors.right: textField.right
|
||||||
|
anchors.rightMargin: y - textField.y
|
||||||
|
anchors.verticalCenter: textField.verticalCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
text: catalog.i18nc("@label", "mm")
|
|
||||||
anchors.right: textField.right
|
|
||||||
anchors.rightMargin: y - textField.y
|
|
||||||
anchors.verticalCenter: textField.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user