Layout Layer View menu, removed item, changed size. CURA-3321

This commit is contained in:
Jack Ha 2017-01-30 11:24:51 +01:00
parent bb1fa3ae04
commit b1d95f3464
3 changed files with 66 additions and 15 deletions

View File

@ -60,7 +60,7 @@ class LayerView(View):
self._controller.getScene().getRoot().childrenChanged.connect(self._onSceneChanged)
self._layer_view_type = 0 # 0 is material color, 1 is color by linetype, 2 is speed
self._only_color_active_extruder = True
self._only_color_active_extruder = False
self._extruder_opacity = [1.0, 1.0, 1.0, 1.0]
self._show_travel_moves = 0
self._show_support = 1

View File

@ -148,16 +148,26 @@ Item
Rectangle {
anchors.left: parent.right
//anchors.verticalCenter: parent.verticalCenter
//anchors.top: toolbar.top
//anchors.top: sidebar.top
anchors.bottom: slider_background.top
//anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.leftMargin: UM.Theme.getSize("default_margin").width
width: UM.Theme.getSize("slider_layerview_background").width * 4
height: slider.height + UM.Theme.getSize("default_margin").height * 10
width: UM.Theme.getSize("layerview_menu_size").width
height: UM.Theme.getSize("layerview_menu_size").height
color: UM.Theme.getColor("tool_panel_background");
border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("lining")
Label
{
id: layerViewTypesLabel
anchors.top: parent.top
anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
text: catalog.i18nc("@label","Color scheme")
}
ListModel
{
id: layerViewTypes
@ -173,12 +183,57 @@ Item
ComboBox
{
id: layer_type_combobox
anchors.top: parent.top
id: layerTypeCombobox
anchors.top: layerViewTypesLabel.bottom
anchors.topMargin: UM.Theme.getSize("margin_small").height
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width
model: layerViewTypes
visible: !UM.LayerView.compatibilityMode
onActivated: {
UM.LayerView.setLayerViewType(layerViewTypes.get(index).type_id);
}
}
Label
{
id: layerRangeTypeLabel
anchors.top: layerTypeCombobox.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
model: layerViewTypes
text: catalog.i18nc("@label","Layer range")
}
ListModel
{
id: layerRangeTypes
ListElement {
text: "All layers"
range_type_id: 0
}
ListElement {
text: "Layer range"
range_type_id: 1
}
ListElement {
text: "Single layer"
range_type_id: 2
}
}
ComboBox
{
id: layerRangeTypeCombobox
anchors.top: layerRangeTypeLabel.bottom
anchors.topMargin: UM.Theme.getSize("margin_small").height
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width
model: layerRangeTypes
visible: !UM.LayerView.compatibilityMode
onActivated: {
UM.LayerView.setLayerViewType(layerViewTypes.get(index).type_id);
@ -195,7 +250,7 @@ Item
ColumnLayout {
id: view_settings
anchors.top: layer_type_combobox.bottom
anchors.top: layerRangeTypeCombobox.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height
x: UM.Theme.getSize("default_margin").width
@ -249,13 +304,6 @@ Item
}
text: "Show infill"
}
CheckBox {
checked: true
onClicked: {
UM.LayerView.setOnlyColorActiveExtruder(checked);
}
text: "Only color active extruder"
}
}
}
}

View File

@ -239,6 +239,7 @@
"default_lining": [0.08, 0.08],
"default_arrow": [0.8, 0.8],
"logo": [9.5, 2.0],
"margin_small": [0.5, 0.5],
"sidebar": [35.0, 10.0],
"sidebar_header": [0.0, 4.0],
@ -287,6 +288,8 @@
"slider_layerview_background": [4.0, 0.0],
"slider_layerview_margin": [3.0, 3.0],
"layerview_menu_size": [16.0, 25.0],
"checkbox": [2.0, 2.0],
"tooltip": [20.0, 10.0],