mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 05:48:59 +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
|
||||
{
|
||||
width: settingsTabs.columnWidth
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
spacing: UM.Theme.getSize("default_lining").height
|
||||
|
||||
Label
|
||||
{
|
||||
@ -91,64 +91,46 @@ Cura.MachineAction
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
Grid
|
||||
{
|
||||
columns: 2
|
||||
columnSpacing: UM.Theme.getSize("default_margin").width
|
||||
rowSpacing: UM.Theme.getSize("default_lining").width
|
||||
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "X (Width)")
|
||||
}
|
||||
Loader
|
||||
{
|
||||
id: buildAreaWidthField
|
||||
sourceComponent: numericTextFieldWithUnit
|
||||
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
|
||||
{
|
||||
text: catalog.i18nc("@label", "Y (Depth)")
|
||||
}
|
||||
Loader
|
||||
{
|
||||
id: buildAreaDepthField
|
||||
sourceComponent: numericTextFieldWithUnit
|
||||
property string settingKey: "machine_depth"
|
||||
property string label: catalog.i18nc("@label", "Y (Depth)")
|
||||
property string unit: catalog.i18nc("@label", "mm")
|
||||
property bool forceUpdateOnChange: true
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Z (Height)")
|
||||
}
|
||||
Loader
|
||||
{
|
||||
id: buildAreaHeightField
|
||||
sourceComponent: numericTextFieldWithUnit
|
||||
property string settingKey: "machine_height"
|
||||
property string label: catalog.i18nc("@label", "Z (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 }
|
||||
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Build Plate Shape")
|
||||
}
|
||||
|
||||
Loader
|
||||
{
|
||||
id: shapeComboBox
|
||||
sourceComponent: comboBoxWithOptions
|
||||
property string settingKey: "machine_shape"
|
||||
property string label: catalog.i18nc("@label", "Build plate shape")
|
||||
property bool forceUpdateOnChange: true
|
||||
}
|
||||
|
||||
@ -156,44 +138,36 @@ Cura.MachineAction
|
||||
{
|
||||
id: centerIsZeroCheckBox
|
||||
sourceComponent: simpleCheckBox
|
||||
property string label: catalog.i18nc("@option:check", "Machine Center is Zero")
|
||||
property string settingKey: "machine_center_is_zero"
|
||||
property string label: catalog.i18nc("@option:check", "Origin at center")
|
||||
property bool forceUpdateOnChange: true
|
||||
}
|
||||
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 string label: catalog.i18nc("@option:check", "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 string label: catalog.i18nc("@label", "GCode flavor")
|
||||
property bool forceUpdateOnChange: true
|
||||
property var afterOnActivate: manager.updateHasMaterialsMetadata
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Column
|
||||
{
|
||||
width: settingsTabs.columnWidth
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
spacing: UM.Theme.getSize("default_lining").height
|
||||
|
||||
Label
|
||||
{
|
||||
@ -201,97 +175,79 @@ Cura.MachineAction
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
Grid
|
||||
{
|
||||
columns: 2
|
||||
columnSpacing: UM.Theme.getSize("default_margin").width
|
||||
rowSpacing: UM.Theme.getSize("default_lining").width
|
||||
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "X min")
|
||||
}
|
||||
Loader
|
||||
{
|
||||
id: printheadXMinField
|
||||
sourceComponent: headPolygonTextField
|
||||
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"
|
||||
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
|
||||
{
|
||||
text: catalog.i18nc("@label", "Y min")
|
||||
}
|
||||
Loader
|
||||
{
|
||||
id: printheadYMinField
|
||||
sourceComponent: headPolygonTextField
|
||||
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\".")
|
||||
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
|
||||
{
|
||||
text: catalog.i18nc("@label", "X max")
|
||||
}
|
||||
Loader
|
||||
{
|
||||
id: printheadXMaxField
|
||||
sourceComponent: headPolygonTextField
|
||||
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\".")
|
||||
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
|
||||
{
|
||||
text: catalog.i18nc("@label", "Y max")
|
||||
}
|
||||
Loader
|
||||
{
|
||||
id: printheadYMaxField
|
||||
sourceComponent: headPolygonTextField
|
||||
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\".")
|
||||
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 }
|
||||
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Gantry height")
|
||||
}
|
||||
Loader
|
||||
{
|
||||
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\".")
|
||||
}
|
||||
|
||||
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
|
||||
height: childrenRect.height
|
||||
width: childrenRect.width
|
||||
text: machineExtruderCountProvider.properties.description
|
||||
|
||||
Row
|
||||
{
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Number of Extruders")
|
||||
anchors.verticalCenter: extruderCountComboBox.verticalCenter
|
||||
}
|
||||
ComboBox
|
||||
{
|
||||
id: extruderCountComboBox
|
||||
@ -313,11 +269,8 @@ Cura.MachineAction
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Material Diameter")
|
||||
}
|
||||
|
||||
Loader
|
||||
{
|
||||
id: materialDiameterField
|
||||
@ -326,11 +279,7 @@ Cura.MachineAction
|
||||
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.")
|
||||
property var afterOnEditingFinished: manager.updateMaterialForDiameter
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Nozzle size")
|
||||
visible: nozzleSizeField.visible
|
||||
property string label: catalog.i18nc("@label", "Material diameter")
|
||||
}
|
||||
Loader
|
||||
{
|
||||
@ -338,11 +287,11 @@ Cura.MachineAction
|
||||
visible: !Cura.MachineManager.hasVariants && machineExtruderCountProvider.properties.value == 1
|
||||
sourceComponent: numericTextFieldWithUnit
|
||||
property string settingKey: "machine_nozzle_size"
|
||||
property string label: catalog.i18nc("@label", "Nozzle size")
|
||||
property string unit: catalog.i18nc("@label", "mm")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Row
|
||||
{
|
||||
@ -413,7 +362,7 @@ Cura.MachineAction
|
||||
|
||||
Column
|
||||
{
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
spacing: UM.Theme.getSize("default_lining").width
|
||||
|
||||
Label
|
||||
{
|
||||
@ -421,56 +370,44 @@ Cura.MachineAction
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
Grid
|
||||
{
|
||||
columns: 2
|
||||
columnSpacing: UM.Theme.getSize("default_margin").width
|
||||
rowSpacing: UM.Theme.getSize("default_lining").width
|
||||
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Nozzle size")
|
||||
visible: extruderNozzleSizeField.visible
|
||||
}
|
||||
Loader
|
||||
{
|
||||
id: extruderNozzleSizeField
|
||||
visible: !Cura.MachineManager.hasVariants
|
||||
sourceComponent: numericTextFieldWithUnit
|
||||
property string settingKey: "machine_nozzle_size"
|
||||
property bool isExtruderSetting: true
|
||||
property string label: catalog.i18nc("@label", "Nozzle size")
|
||||
property string unit: catalog.i18nc("@label", "mm")
|
||||
property bool isExtruderSetting: true
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Nozzle offset X")
|
||||
}
|
||||
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
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Nozzle offset Y")
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
@ -577,14 +514,15 @@ Cura.MachineAction
|
||||
id: numericTextFieldWithUnit
|
||||
UM.TooltipArea
|
||||
{
|
||||
height: textField.height
|
||||
width: textField.width
|
||||
height: childrenRect.height
|
||||
width: childrenRect.width
|
||||
text: _tooltip
|
||||
|
||||
property bool _isExtruderSetting: (typeof(isExtruderSetting) === 'undefined') ? false: isExtruderSetting
|
||||
property bool _allowNegative: (typeof(allowNegative) === 'undefined') ? false : allowNegative
|
||||
property var _afterOnEditingFinished: (typeof(afterOnEditingFinished) === 'undefined') ? undefined : afterOnEditingFinished
|
||||
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
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
@ -607,6 +545,23 @@ Cura.MachineAction
|
||||
storeIndex: manager.containerIndex
|
||||
}
|
||||
|
||||
Row
|
||||
{
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Label
|
||||
{
|
||||
text: _label
|
||||
visible: _label != ""
|
||||
anchors.verticalCenter: textFieldWithUnit.verticalCenter
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
width: textField.width
|
||||
height: textField.height
|
||||
|
||||
id: textFieldWithUnit
|
||||
TextField
|
||||
{
|
||||
id: textField
|
||||
@ -643,19 +598,22 @@ Cura.MachineAction
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component
|
||||
{
|
||||
id: comboBoxWithOptions
|
||||
UM.TooltipArea
|
||||
{
|
||||
height: comboBox.height
|
||||
width: comboBox.width
|
||||
height: childrenRect.height
|
||||
width: childrenRect.width
|
||||
text: _tooltip
|
||||
|
||||
property bool _isExtruderSetting: (typeof(isExtruderSetting) === 'undefined') ? false : isExtruderSetting
|
||||
property bool _forceUpdateOnChange: (typeof(forceUpdateOnChange) === 'undefined') ? false : forceUpdateOnChange
|
||||
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
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
@ -678,6 +636,16 @@ Cura.MachineAction
|
||||
storeIndex: manager.containerIndex
|
||||
}
|
||||
|
||||
Row
|
||||
{
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Label
|
||||
{
|
||||
text: _label
|
||||
visible: _label != ""
|
||||
anchors.verticalCenter: textFieldWithUnit.verticalCenter
|
||||
}
|
||||
ComboBox
|
||||
{
|
||||
id: comboBox
|
||||
@ -730,6 +698,7 @@ Cura.MachineAction
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component
|
||||
{
|
||||
@ -795,6 +764,24 @@ Cura.MachineAction
|
||||
width: textField.width
|
||||
text: tooltip
|
||||
|
||||
property string _label: (typeof(label) === 'undefined') ? "" : label
|
||||
|
||||
Row
|
||||
{
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Label
|
||||
{
|
||||
text: _label
|
||||
visible: _label != ""
|
||||
anchors.verticalCenter: textFieldWithUnit.verticalCenter
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
width: textField.width
|
||||
height: textField.height
|
||||
|
||||
TextField
|
||||
{
|
||||
id: textField
|
||||
@ -841,6 +828,8 @@ Cura.MachineAction
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property var printHeadPolygon:
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user