Rearrange nozzle/material selection into one line

In preparation for CURA-330, where we will need multiple instances of the nozzle/material combo.
This commit is contained in:
fieldOfView 2016-04-27 20:29:21 +02:00
parent d34c28543b
commit d7aa8e71bf

View File

@ -97,31 +97,40 @@ Item
Rectangle {
id: variantRow
anchors.top: machineSelectionRow.bottom
anchors.topMargin: UM.MachineManager.hasVariants ? UM.Theme.getSize("default_margin").height : 0
anchors.topMargin: visible ? UM.Theme.getSize("default_margin").height : 0
width: base.width
height: UM.MachineManager.hasVariants ? UM.Theme.getSize("sidebar_setup").height : 0
visible: UM.MachineManager.hasVariants
height: visible ? UM.Theme.getSize("sidebar_setup").height : 0
visible: UM.MachineManager.hasVariants || UM.MachineManager.hasMaterials
Label{
id: variantLabel
text: catalog.i18nc("@label","Nozzle:");
text: (UM.MachineManager.hasVariants && UM.MachineManager.hasMaterials) ? catalog.i18nc("@label","Nozzle & Material:"):
UM.MachineManager.hasVariants ? catalog.i18nc("@label","Nozzle:") : catalog.i18nc("@label","Material:");
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width;
anchors.leftMargin: UM.Theme.getSize("default_margin").width
anchors.verticalCenter: parent.verticalCenter
width: parent.width/100*45
font: UM.Theme.getFont("default");
color: UM.Theme.getColor("text");
}
ToolButton {
id: variantSelection
text: UM.MachineManager.activeMachineVariant
width: parent.width/100*55
height: UM.Theme.getSize("setting_control").height
tooltip: UM.MachineManager.activeMachineVariant;
Rectangle {
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width
anchors.verticalCenter: parent.verticalCenter
width: parent.width/100*55
height: UM.Theme.getSize("setting_control").height
ToolButton {
id: variantSelection
text: UM.MachineManager.activeMachineVariant
tooltip: UM.MachineManager.activeMachineVariant;
visible: UM.MachineManager.hasVariants
height: UM.Theme.getSize("setting_control").height
width: materialSelection.visible ? (parent.width - UM.Theme.getSize("default_margin").width) / 2 : parent.width
anchors.left: parent.left
style: UM.Theme.styles.sidebar_header_button
menu: Menu
@ -156,36 +165,16 @@ Item
ExclusiveGroup { id: variantSelectionMenuGroup; }
}
}
}
Rectangle {
id: materialSelectionRow
anchors.top: variantRow.bottom
anchors.topMargin: UM.MachineManager.hasMaterials ? UM.Theme.getSize("default_margin").height : 0
width: base.width
height: UM.MachineManager.hasMaterials ? UM.Theme.getSize("sidebar_setup").height : 0
visible: UM.MachineManager.hasMaterials
Label{
id: materialSelectionLabel
text: catalog.i18nc("@label","Material:");
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width;
anchors.verticalCenter: parent.verticalCenter
width: parent.width/100*45
font: UM.Theme.getFont("default");
color: UM.Theme.getColor("text");
}
ToolButton {
id: materialSelection
text: UM.MachineManager.activeMaterial
width: parent.width/100*55
tooltip: UM.MachineManager.activeMaterial
visible: UM.MachineManager.hasMaterials
height: UM.Theme.getSize("setting_control").height
tooltip: UM.MachineManager.activeMaterial;
width: variantSelection.visible ? (parent.width - UM.Theme.getSize("default_margin").width) / 2 : parent.width
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width
anchors.verticalCenter: parent.verticalCenter
style: UM.Theme.styles.sidebar_header_button
menu: Menu
@ -221,4 +210,5 @@ Item
}
}
}
}
}