Move labels into components with the controls...

...so they are both children of the same TooltipArea
This commit is contained in:
fieldOfView 2017-07-11 16:40:05 +02:00
parent 2ba0dd094e
commit 219d1938c2

View File

@ -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,64 +91,46 @@ Cura.MachineAction
font.bold: true font.bold: true
} }
Grid Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
{
columns: 2
columnSpacing: UM.Theme.getSize("default_margin").width
rowSpacing: UM.Theme.getSize("default_lining").width
Label
{
text: catalog.i18nc("@label", "X (Width)")
}
Loader Loader
{ {
id: buildAreaWidthField id: buildAreaWidthField
sourceComponent: numericTextFieldWithUnit sourceComponent: numericTextFieldWithUnit
property string settingKey: "machine_width" property string settingKey: "machine_width"
property string label: catalog.i18nc("@label", "X (Width)")
property string unit: catalog.i18nc("@label", "mm") property string unit: catalog.i18nc("@label", "mm")
property bool forceUpdateOnChange: true property bool forceUpdateOnChange: true
} }
Label
{
text: catalog.i18nc("@label", "Y (Depth)")
}
Loader Loader
{ {
id: buildAreaDepthField id: buildAreaDepthField
sourceComponent: numericTextFieldWithUnit sourceComponent: numericTextFieldWithUnit
property string settingKey: "machine_depth" property string settingKey: "machine_depth"
property string label: catalog.i18nc("@label", "Y (Depth)")
property string unit: catalog.i18nc("@label", "mm") property string unit: catalog.i18nc("@label", "mm")
property bool forceUpdateOnChange: true property bool forceUpdateOnChange: true
} }
Label
{
text: catalog.i18nc("@label", "Z (Height)")
}
Loader Loader
{ {
id: buildAreaHeightField id: buildAreaHeightField
sourceComponent: numericTextFieldWithUnit sourceComponent: numericTextFieldWithUnit
property string settingKey: "machine_height" property string settingKey: "machine_height"
property string label: catalog.i18nc("@label", "Z (Height)")
property string unit: catalog.i18nc("@label", "mm") property string unit: catalog.i18nc("@label", "mm")
property bool forceUpdateOnChange: true 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", "Build Plate Shape")
}
Loader Loader
{ {
id: shapeComboBox id: shapeComboBox
sourceComponent: comboBoxWithOptions sourceComponent: comboBoxWithOptions
property string settingKey: "machine_shape" property string settingKey: "machine_shape"
property string label: catalog.i18nc("@label", "Build plate shape")
property bool forceUpdateOnChange: true property bool forceUpdateOnChange: true
} }
@ -156,44 +138,36 @@ Cura.MachineAction
{ {
id: centerIsZeroCheckBox id: centerIsZeroCheckBox
sourceComponent: simpleCheckBox sourceComponent: simpleCheckBox
property string label: catalog.i18nc("@option:check", "Machine Center is Zero")
property string settingKey: "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 property bool forceUpdateOnChange: true
} }
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
Loader Loader
{ {
id: heatedBedCheckBox id: heatedBedCheckBox
sourceComponent: simpleCheckBox sourceComponent: simpleCheckBox
property string label: catalog.i18nc("@option:check", "Heated Bed")
property var settingKey: "machine_heated_bed" property var settingKey: "machine_heated_bed"
property string label: catalog.i18nc("@option:check", "Heated bed")
property bool forceUpdateOnChange: true 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 }
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
Label
{
text: catalog.i18nc("@label", "GCode Flavor")
}
Loader Loader
{ {
id: gcodeFlavorComboBox id: gcodeFlavorComboBox
sourceComponent: comboBoxWithOptions sourceComponent: comboBoxWithOptions
property string settingKey: "machine_gcode_flavor" property string settingKey: "machine_gcode_flavor"
property string label: catalog.i18nc("@label", "GCode flavor")
property bool forceUpdateOnChange: true property bool forceUpdateOnChange: true
property var afterOnActivate: manager.updateHasMaterialsMetadata 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 }
{
columns: 2
columnSpacing: UM.Theme.getSize("default_margin").width
rowSpacing: UM.Theme.getSize("default_lining").width
Label
{
text: catalog.i18nc("@label", "X min")
}
Loader Loader
{ {
id: printheadXMinField id: printheadXMinField
sourceComponent: headPolygonTextField 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 axis: "x"
property string side: "min" 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 Loader
{ {
id: printheadYMinField id: printheadYMinField
sourceComponent: headPolygonTextField 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 axis: "y"
property string side: "min" 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 Loader
{ {
id: printheadXMaxField id: printheadXMaxField
sourceComponent: headPolygonTextField 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 axis: "x"
property string side: "max" 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 Loader
{ {
id: printheadYMaxField id: printheadYMaxField
sourceComponent: headPolygonTextField 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 axis: "y"
property string side: "max" 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 } Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
Label
{
text: catalog.i18nc("@label", "Gantry height")
}
Loader Loader
{ {
id: gantryHeightField id: gantryHeightField
sourceComponent: numericTextFieldWithUnit sourceComponent: numericTextFieldWithUnit
property string settingKey: "gantry_height" property string settingKey: "gantry_height"
property string label: catalog.i18nc("@label", "Gantry height")
property string unit: catalog.i18nc("@label", "mm") 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\".") 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 }
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 UM.TooltipArea
{ {
id: extruderCountControl id: extruderCountControl
visible: manager.definedExtruderCount > 1 visible: manager.definedExtruderCount > 1
height: extruderCountComboBox.height height: childrenRect.height
width: extruderCountComboBox.width width: childrenRect.width
text: machineExtruderCountProvider.properties.description 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 ComboBox
{ {
id: extruderCountComboBox id: extruderCountComboBox
@ -313,11 +269,8 @@ Cura.MachineAction
} }
} }
} }
Label
{
text: catalog.i18nc("@label", "Material Diameter")
} }
Loader Loader
{ {
id: materialDiameterField id: materialDiameterField
@ -326,11 +279,7 @@ Cura.MachineAction
property string unit: catalog.i18nc("@label", "mm") 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 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 property var afterOnEditingFinished: manager.updateMaterialForDiameter
} property string label: catalog.i18nc("@label", "Material diameter")
Label
{
text: catalog.i18nc("@label", "Nozzle size")
visible: nozzleSizeField.visible
} }
Loader Loader
{ {
@ -338,11 +287,11 @@ Cura.MachineAction
visible: !Cura.MachineManager.hasVariants && machineExtruderCountProvider.properties.value == 1 visible: !Cura.MachineManager.hasVariants && machineExtruderCountProvider.properties.value == 1
sourceComponent: numericTextFieldWithUnit sourceComponent: numericTextFieldWithUnit
property string settingKey: "machine_nozzle_size" property string settingKey: "machine_nozzle_size"
property string label: catalog.i18nc("@label", "Nozzle size")
property string unit: catalog.i18nc("@label", "mm") property string unit: catalog.i18nc("@label", "mm")
} }
} }
} }
}
Row Row
{ {
@ -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,56 +370,44 @@ Cura.MachineAction
font.bold: true font.bold: true
} }
Grid Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
{
columns: 2
columnSpacing: UM.Theme.getSize("default_margin").width
rowSpacing: UM.Theme.getSize("default_lining").width
Label
{
text: catalog.i18nc("@label", "Nozzle size")
visible: extruderNozzleSizeField.visible
}
Loader Loader
{ {
id: extruderNozzleSizeField id: extruderNozzleSizeField
visible: !Cura.MachineManager.hasVariants visible: !Cura.MachineManager.hasVariants
sourceComponent: numericTextFieldWithUnit sourceComponent: numericTextFieldWithUnit
property string settingKey: "machine_nozzle_size" 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 string unit: catalog.i18nc("@label", "mm")
property bool isExtruderSetting: true
} }
Label
{
text: catalog.i18nc("@label", "Nozzle offset X")
}
Loader Loader
{ {
id: extruderOffsetXField id: extruderOffsetXField
sourceComponent: numericTextFieldWithUnit sourceComponent: numericTextFieldWithUnit
property string settingKey: "machine_nozzle_offset_x" property string settingKey: "machine_nozzle_offset_x"
property string label: catalog.i18nc("@label", "Nozzle offset X")
property string unit: catalog.i18nc("@label", "mm") property string unit: catalog.i18nc("@label", "mm")
property bool isExtruderSetting: true property bool isExtruderSetting: true
property bool forceUpdateOnChange: true property bool forceUpdateOnChange: true
property bool allowNegative: true property bool allowNegative: true
} }
Label
{
text: catalog.i18nc("@label", "Nozzle offset Y")
}
Loader Loader
{ {
id: extruderOffsetYField id: extruderOffsetYField
sourceComponent: numericTextFieldWithUnit sourceComponent: numericTextFieldWithUnit
property string settingKey: "machine_nozzle_offset_y" property string settingKey: "machine_nozzle_offset_y"
property string label: catalog.i18nc("@label", "Nozzle offset Y")
property string unit: catalog.i18nc("@label", "mm") property string unit: catalog.i18nc("@label", "mm")
property bool isExtruderSetting: true property bool isExtruderSetting: true
property bool forceUpdateOnChange: true property bool forceUpdateOnChange: true
property bool allowNegative: true property bool allowNegative: true
} }
}
Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
Row Row
{ {
@ -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,6 +545,23 @@ Cura.MachineAction
storeIndex: manager.containerIndex 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 TextField
{ {
id: textField id: textField
@ -643,19 +598,22 @@ Cura.MachineAction
} }
} }
} }
}
}
Component Component
{ {
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,6 +636,16 @@ Cura.MachineAction
storeIndex: manager.containerIndex storeIndex: manager.containerIndex
} }
Row
{
spacing: UM.Theme.getSize("default_margin").width
Label
{
text: _label
visible: _label != ""
anchors.verticalCenter: textFieldWithUnit.verticalCenter
}
ComboBox ComboBox
{ {
id: comboBox id: comboBox
@ -730,6 +698,7 @@ Cura.MachineAction
} }
} }
} }
}
Component Component
{ {
@ -795,6 +764,24 @@ Cura.MachineAction
width: textField.width width: textField.width
text: tooltip 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 TextField
{ {
id: textField id: textField
@ -841,6 +828,8 @@ Cura.MachineAction
} }
} }
} }
}
}
property var printHeadPolygon: property var printHeadPolygon:
{ {