Code Style: camelCase for qnl properties, brackets, commas

CURA-6683
This commit is contained in:
Nino van Hooff 2019-09-18 09:45:26 +02:00
parent c3bbd884b5
commit be7bd59e30

View file

@ -15,14 +15,14 @@ Item
id: base
width: childrenRect.width
height: childrenRect.height
property var all_categories_except_support: [ "machine_settings", "resolution", "shell", "infill", "material", "speed",
property var allCategoriesExceptSupport: [ "machine_settings", "resolution", "shell", "infill", "material", "speed",
"travel", "cooling", "platform_adhesion", "dual", "meshfix", "blackmagic", "experimental"]
readonly property string normal_mesh_type: ""
readonly property string support_mesh_type: "support_mesh"
readonly property string cutting_mesh_type: "cutting_mesh"
readonly property string infill_mesh_type: "infill_mesh"
readonly property string anti_overhang_mesh_type: "anti_overhang_mesh"
readonly property string normalMeshType: ""
readonly property string supportMeshType: "support_mesh"
readonly property string cuttingMeshType: "cutting_mesh"
readonly property string infillMeshType: "infill_mesh"
readonly property string antiOverhangMeshType: "anti_overhang_mesh"
property var currentMeshType: UM.ActiveTool.properties.getValue("MeshType")
@ -30,16 +30,15 @@ Item
onCurrentMeshTypeChanged:
{
// set checked state of mesh type buttons
normalButton.checked = currentMeshType === normal_mesh_type
supportMeshButton.checked = currentMeshType === support_mesh_type
overhangMeshButton.checked = currentMeshType === infill_mesh_type || currentMeshType === cutting_mesh_type
antiOverhangMeshButton.checked = currentMeshType === anti_overhang_mesh_type
normalButton.checked = type === normalMeshType
supportMeshButton.checked = type === supportMeshType
overhangMeshButton.checked = type === infillMeshType || type === cuttingMeshType
antiOverhangMeshButton.checked = type === antiOverhangMeshType
// update active type label
for (var button in meshTypeButtons.children)
{
if (meshTypeButtons.children[button].checked)
{
if (meshTypeButtons.children[button].checked){
meshTypeLabel.text = catalog.i18nc("@label", "Mesh Type") + ": " + meshTypeButtons.children[button].text
break
}
@ -50,11 +49,11 @@ Item
{
if (infillOnlyCheckbox.checked)
{
setMeshType(infill_mesh_type)
setMeshType(infillMeshType)
}
else
{
setMeshType(cutting_mesh_type)
setMeshType(cuttingMeshType)
}
}
@ -63,6 +62,23 @@ Item
UM.ActiveTool.setProperty("MeshType", type)
}
function updateView(type) {
// set checked state of mesh type buttons
normalButton.checked = type === normal_mesh_type
supportMeshButton.checked = type === support_mesh_type
overhangMeshButton.checked = type === infill_mesh_type || type === cutting_mesh_type
antiOverhangMeshButton.checked = type === anti_overhang_mesh_type
// update active type label
for (var button in meshTypeButtons.children)
{
if(meshTypeButtons.children[button].checked){
meshTypeLabel.text = catalog.i18nc("@label","Mesh Type") + ": " + meshTypeButtons.children[button].text
break
}
}
}
UM.I18nCatalog { id: catalog; name: "uranium"}
Column
@ -85,7 +101,7 @@ Item
iconSource: UM.Theme.getIcon("pos_normal");
property bool needBorder: true
checkable: true
onClicked: setMeshType(normal_mesh_type);
onClicked: setMeshType(normalMeshType);
style: UM.Theme.styles.tool_button;
z: 4
}
@ -97,7 +113,7 @@ Item
iconSource: UM.Theme.getIcon("pos_print_as_support");
property bool needBorder: true
checkable:true
onClicked: setMeshType(support_mesh_type)
onClicked: setMeshType(supportMeshType)
style: UM.Theme.styles.tool_button;
z: 3
}
@ -109,7 +125,7 @@ Item
iconSource: UM.Theme.getIcon("pos_modify_overlaps");
property bool needBorder: true
checkable:true
onClicked: setMeshType(infill_mesh_type)
onClicked: setMeshType(infillMeshType)
style: UM.Theme.styles.tool_button;
z: 2
}
@ -121,7 +137,7 @@ Item
iconSource: UM.Theme.getIcon("pos_modify_dont_support_overlap");
property bool needBorder: true
checkable: true
onClicked: setMeshType(anti_overhang_mesh_type)
onClicked: setMeshType(antiOverhangMeshType)
style: UM.Theme.styles.tool_button;
z: 1
}
@ -145,14 +161,14 @@ Item
style: UM.Theme.styles.checkbox;
visible: currentMeshType === infill_mesh_type || currentMeshType === cutting_mesh_type
visible: currentMeshType === infillMeshType || currentMeshType === cuttingMeshType
onClicked: setOverhangsMeshType()
Binding
{
target: infillOnlyCheckbox
property: "checked"
value: currentMeshType === infill_mesh_type
value: currentMeshType === infillMeshType
}
}
@ -195,7 +211,7 @@ Item
if (currentMeshType == "support_mesh")
{
excluded_settings = excluded_settings.concat(base.all_categories_except_support)
excluded_settings = excluded_settings.concat(base.allCategoriesExceptSupport)
}
return excluded_settings
}
@ -371,7 +387,7 @@ Item
settingPickDialog.visible = true;
if (currentMeshType == "support_mesh")
{
settingPickDialog.additional_excluded_settings = base.all_categories_except_support;
settingPickDialog.additional_excluded_settings = base.allCategoriesExceptSupport;
}
else
{