Move Variant selection to directly below Machine selection

This commit is contained in:
fieldOfView 2015-12-29 16:21:13 +01:00
parent 5ec00b2f6d
commit b7f413dbb7
2 changed files with 58 additions and 59 deletions

View file

@ -14,63 +14,9 @@ Item{
property int totalHeightProfileSetup: childrenRect.height property int totalHeightProfileSetup: childrenRect.height
property Action manageProfilesAction property Action manageProfilesAction
Rectangle {
id: variantRow
anchors.top: base.top
width: base.width
height: UM.Theme.sizes.sidebar_setup.height
//visible: UM.MachineManager.hasVariants;
visible: true
Label{
id: variantLabel
text: catalog.i18nc("@label","Variant:");
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
anchors.verticalCenter: parent.verticalCenter
width: parent.width/100*45
font: UM.Theme.fonts.default;
}
ToolButton {
id: variantSelection
text: UM.MachineManager.activeMachineVariant
width: parent.width/100*55
height: UM.Theme.sizes.setting_control.height
tooltip: UM.MachineManager.activeMachineInstance;
anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width
anchors.verticalCenter: parent.verticalCenter
style: UM.Theme.styles.sidebar_header_button
menu: Menu
{
id: variantsSelectionMenu
Instantiator
{
model: UM.MachineVariantsModel { id: variantsModel }
MenuItem
{
text: model.name;
checkable: true;
checked: model.active;
exclusiveGroup: variantSelectionMenuGroup;
onTriggered: UM.MachineManager.setActiveMachineVariant(variantsModel.getItem(index).name)
}
onObjectAdded: variantsSelectionMenu.insertItem(index, object)
onObjectRemoved: variantsSelectionMenu.removeItem(object)
}
ExclusiveGroup { id: variantSelectionMenuGroup; }
}
}
}
Rectangle{ Rectangle{
id: globalProfileRow; id: globalProfileRow
anchors.top: UM.MachineManager.hasVariants ? variantRow.bottom : base.top anchors.top: base.top
anchors.topMargin: UM.MachineManager.hasVariants ? UM.Theme.sizes.default_lining.height : 0
//anchors.top: variantRow.bottom
height: UM.Theme.sizes.sidebar_setup.height height: UM.Theme.sizes.sidebar_setup.height
width: base.width width: base.width
@ -79,7 +25,7 @@ Item{
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width; anchors.leftMargin: UM.Theme.sizes.default_margin.width;
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: catalog.i18nc("@label","Global Profile:"); text: catalog.i18nc("@label","Profile:");
width: parent.width/100*45 width: parent.width/100*45
font: UM.Theme.fonts.default; font: UM.Theme.fonts.default;
color: UM.Theme.colors.text; color: UM.Theme.colors.text;

View file

@ -17,7 +17,7 @@ Item
property int totalHeightHeader: childrenRect.height property int totalHeightHeader: childrenRect.height
Rectangle { Rectangle {
id: settingsModeRow id: sidebarTabRow
width: base.width width: base.width
height: 0 height: 0
anchors.top: parent.top anchors.top: parent.top
@ -29,7 +29,7 @@ Item
text: catalog.i18nc("@label:listbox","Print Job"); text: catalog.i18nc("@label:listbox","Print Job");
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width; anchors.leftMargin: UM.Theme.sizes.default_margin.width;
anchors.top: settingsModeRow.bottom anchors.top: sidebarTabRow.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.sizes.default_margin.height
width: parent.width/100*45 width: parent.width/100*45
font: UM.Theme.fonts.large; font: UM.Theme.fonts.large;
@ -93,4 +93,57 @@ Item
} }
} }
} }
Rectangle {
id: variantRow
anchors.top: machineSelectionRow.bottom
anchors.topMargin: UM.MachineManager.hasVariants ? UM.Theme.sizes.default_margin.height : 0
width: base.width
height: UM.MachineManager.hasVariants ? UM.Theme.sizes.sidebar_setup.height : 0
visible: UM.MachineManager.hasVariants
Label{
id: variantLabel
text: catalog.i18nc("@label","Nozzle:");
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
anchors.verticalCenter: parent.verticalCenter
width: parent.width/100*45
font: UM.Theme.fonts.default;
color: UM.Theme.colors.text;
}
ToolButton {
id: variantSelection
text: UM.MachineManager.activeMachineVariant
width: parent.width/100*55
height: UM.Theme.sizes.setting_control.height
tooltip: UM.MachineManager.activeMachineInstance;
anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width
anchors.verticalCenter: parent.verticalCenter
style: UM.Theme.styles.sidebar_header_button
menu: Menu
{
id: variantsSelectionMenu
Instantiator
{
model: UM.MachineVariantsModel { id: variantsModel }
MenuItem
{
text: model.name;
checkable: true;
checked: model.active;
exclusiveGroup: variantSelectionMenuGroup;
onTriggered: UM.MachineManager.setActiveMachineVariant(variantsModel.getItem(index).name)
}
onObjectAdded: variantsSelectionMenu.insertItem(index, object)
onObjectRemoved: variantsSelectionMenu.removeItem(object)
}
ExclusiveGroup { id: variantSelectionMenuGroup; }
}
}
}
} }