Fix QML warnings & errors

CURA-5829
This commit is contained in:
Jaime van Kessel 2018-10-31 10:55:05 +01:00
parent 15f586ffae
commit 1e9aff44f6
2 changed files with 23 additions and 36 deletions

View file

@ -15,5 +15,4 @@ Loader
id: previewMain id: previewMain
source: UM.Controller.activeView != null && UM.Controller.activeView.mainComponent != null ? UM.Controller.activeView.mainComponent : "" source: UM.Controller.activeView != null && UM.Controller.activeView.mainComponent != null ? UM.Controller.activeView.mainComponent : ""
onSourceChanged: print("THE SOURCE IS", source)
} }

View file

@ -70,7 +70,8 @@ Item
border.width: UM.Theme.getSize("default_lining").width border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("lining") border.color: UM.Theme.getColor("lining")
Button { Button
{
id: collapseButton id: collapseButton
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: Math.round(UM.Theme.getSize("default_margin").height + (UM.Theme.getSize("layerview_row").height - UM.Theme.getSize("default_margin").height) / 2) anchors.topMargin: Math.round(UM.Theme.getSize("default_margin").height + (UM.Theme.getSize("layerview_row").height - UM.Theme.getSize("default_margin").height) / 2)
@ -97,7 +98,7 @@ Item
} }
} }
ColumnLayout Column
{ {
id: viewSettings id: viewSettings
@ -126,11 +127,10 @@ Item
Label Label
{ {
id: layerViewTypesLabel id: layerViewTypesLabel
anchors.left: parent.left
text: catalog.i18nc("@label","Color scheme") text: catalog.i18nc("@label","Color scheme")
font: UM.Theme.getFont("default"); font: UM.Theme.getFont("default");
visible: !UM.SimulationView.compatibilityMode visible: !UM.SimulationView.compatibilityMode
Layout.fillWidth: true width: parent.width
color: UM.Theme.getColor("setting_control_text") color: UM.Theme.getColor("setting_control_text")
} }
@ -162,13 +162,10 @@ Item
ComboBox ComboBox
{ {
id: layerTypeCombobox id: layerTypeCombobox
anchors.left: parent.left width: parent.width
Layout.fillWidth: true
Layout.preferredWidth: UM.Theme.getSize("layerview_row").width
model: layerViewTypes model: layerViewTypes
visible: !UM.SimulationView.compatibilityMode visible: !UM.SimulationView.compatibilityMode
style: UM.Theme.styles.combobox style: UM.Theme.styles.combobox
anchors.right: parent.right
onActivated: onActivated:
{ {
@ -194,14 +191,12 @@ Item
Label Label
{ {
id: compatibilityModeLabel id: compatibilityModeLabel
anchors.left: parent.left
text: catalog.i18nc("@label","Compatibility Mode") text: catalog.i18nc("@label","Compatibility Mode")
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
visible: UM.SimulationView.compatibilityMode visible: UM.SimulationView.compatibilityMode
Layout.fillWidth: true height: UM.Theme.getSize("layerview_row").height
Layout.preferredHeight: UM.Theme.getSize("layerview_row").height width: parent.width
Layout.preferredWidth: UM.Theme.getSize("layerview_row").width
} }
Item Item
@ -253,9 +248,9 @@ Item
border.color: UM.Theme.getColor("lining") border.color: UM.Theme.getColor("lining")
visible: !viewSettings.show_legend & !viewSettings.show_gradient visible: !viewSettings.show_legend & !viewSettings.show_gradient
} }
Layout.fillWidth: true height: UM.Theme.getSize("layerview_row").height + UM.Theme.getSize("default_lining").height
Layout.preferredHeight: UM.Theme.getSize("layerview_row").height + UM.Theme.getSize("default_lining").height width: parent.width
Layout.preferredWidth: UM.Theme.getSize("layerview_row").width
style: UM.Theme.styles.checkbox style: UM.Theme.styles.checkbox
Label Label
{ {
@ -264,8 +259,8 @@ Item
color: UM.Theme.getColor("setting_control_text") color: UM.Theme.getColor("setting_control_text")
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: extrudersModelCheckBox.left; anchors.left: extrudersModelCheckBox.left
anchors.right: extrudersModelCheckBox.right; anchors.right: extrudersModelCheckBox.right
anchors.leftMargin: UM.Theme.getSize("checkbox").width + Math.round(UM.Theme.getSize("default_margin").width / 2) anchors.leftMargin: UM.Theme.getSize("checkbox").width + Math.round(UM.Theme.getSize("default_margin").width / 2)
anchors.rightMargin: UM.Theme.getSize("default_margin").width * 2 anchors.rightMargin: UM.Theme.getSize("default_margin").width * 2
} }
@ -325,9 +320,8 @@ Item
border.color: UM.Theme.getColor("lining") border.color: UM.Theme.getColor("lining")
visible: viewSettings.show_legend visible: viewSettings.show_legend
} }
Layout.fillWidth: true height: UM.Theme.getSize("layerview_row").height + UM.Theme.getSize("default_lining").height
Layout.preferredHeight: UM.Theme.getSize("layerview_row").height + UM.Theme.getSize("default_lining").height width: parent.width
Layout.preferredWidth: UM.Theme.getSize("layerview_row").width
style: UM.Theme.styles.checkbox style: UM.Theme.styles.checkbox
Label Label
{ {
@ -336,8 +330,8 @@ Item
elide: Text.ElideRight elide: Text.ElideRight
color: UM.Theme.getColor("setting_control_text") color: UM.Theme.getColor("setting_control_text")
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: legendModelCheckBox.left; anchors.left: legendModelCheckBox.left
anchors.right: legendModelCheckBox.right; anchors.right: legendModelCheckBox.right
anchors.leftMargin: UM.Theme.getSize("checkbox").width + Math.round(UM.Theme.getSize("default_margin").width / 2) anchors.leftMargin: UM.Theme.getSize("checkbox").width + Math.round(UM.Theme.getSize("default_margin").width / 2)
anchors.rightMargin: UM.Theme.getSize("default_margin").width * 2 anchors.rightMargin: UM.Theme.getSize("default_margin").width * 2
} }
@ -349,7 +343,7 @@ Item
checked: viewSettings.only_show_top_layers checked: viewSettings.only_show_top_layers
onClicked: onClicked:
{ {
UM.Preferences.setValue("view/only_show_top_layers", checked ? 1.0 : 0.0); UM.Preferences.setValue("view/only_show_top_layers", checked ? 1.0 : 0.0)
} }
text: catalog.i18nc("@label", "Only Show Top Layers") text: catalog.i18nc("@label", "Only Show Top Layers")
visible: UM.SimulationView.compatibilityMode visible: UM.SimulationView.compatibilityMode
@ -360,7 +354,7 @@ Item
checked: viewSettings.top_layer_count == 5 checked: viewSettings.top_layer_count == 5
onClicked: onClicked:
{ {
UM.Preferences.setValue("view/top_layer_count", checked ? 5 : 1); UM.Preferences.setValue("view/top_layer_count", checked ? 5 : 1)
} }
text: catalog.i18nc("@label", "Show 5 Detailed Layers On Top") text: catalog.i18nc("@label", "Show 5 Detailed Layers On Top")
visible: UM.SimulationView.compatibilityMode visible: UM.SimulationView.compatibilityMode
@ -401,9 +395,8 @@ Item
border.color: UM.Theme.getColor("lining") border.color: UM.Theme.getColor("lining")
visible: viewSettings.show_legend visible: viewSettings.show_legend
} }
Layout.fillWidth: true height: UM.Theme.getSize("layerview_row").height + UM.Theme.getSize("default_lining").height
Layout.preferredHeight: UM.Theme.getSize("layerview_row").height + UM.Theme.getSize("default_lining").height width: parent.width
Layout.preferredWidth: UM.Theme.getSize("layerview_row").width
color: UM.Theme.getColor("setting_control_text") color: UM.Theme.getColor("setting_control_text")
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
} }
@ -416,11 +409,6 @@ Item
visible: viewSettings.show_gradient visible: viewSettings.show_gradient
width: parent.width width: parent.width
height: UM.Theme.getSize("layerview_row").height height: UM.Theme.getSize("layerview_row").height
anchors
{
topMargin: UM.Theme.getSize("slider_layerview_margin").height
horizontalCenter: parent.horizontalCenter
}
Label Label
{ {