mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-07 14:04:03 -06:00
Add a combo box and menu entries to select the current machine variant
This commit is contained in:
parent
255caf8693
commit
900e733839
2 changed files with 41 additions and 1 deletions
|
@ -135,6 +135,23 @@ UM.MainWindow {
|
|||
|
||||
MenuSeparator { }
|
||||
|
||||
Instantiator {
|
||||
model: UM.MachineVariantsModel { }
|
||||
MenuItem {
|
||||
text: model.name;
|
||||
checkable: true;
|
||||
checked: model.active;
|
||||
exclusiveGroup: machineVariantsGroup;
|
||||
onTriggered: UM.MachineManager.setActiveMachineVariant(model.name)
|
||||
}
|
||||
onObjectAdded: machineMenu.insertItem(index, object)
|
||||
onObjectRemoved: machineMenu.removeItem(object)
|
||||
}
|
||||
|
||||
ExclusiveGroup { id: machineVariantsGroup; }
|
||||
|
||||
MenuSeparator { visible: UM.MachineManager.hasVariants; }
|
||||
|
||||
MenuItem { action: actions.addMachine; }
|
||||
MenuItem { action: actions.configureMachines; }
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import QtQuick.Controls 1.1
|
|||
import QtQuick.Controls.Styles 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
import UM 1.0 as UM
|
||||
import UM 1.1 as UM
|
||||
|
||||
Rectangle {
|
||||
id: base;
|
||||
|
@ -60,6 +60,28 @@ Rectangle {
|
|||
onCurrentModeIndexChanged: UM.Preferences.setValue("cura/active_mode", currentModeIndex);
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true;
|
||||
implicitHeight: UM.Theme.sizes.setting.height;
|
||||
|
||||
visible: UM.MachineManager.hasVariants;
|
||||
|
||||
Row {
|
||||
spacing: UM.Theme.sizes.default_margin.width;
|
||||
Label {
|
||||
anchors.verticalCenter: parent.verticalCenter;
|
||||
text: "Variant";
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
anchors.verticalCenter: parent.verticalCenter;
|
||||
model: UM.MachineVariantsModel { }
|
||||
textRole: "name"
|
||||
onActivated: UM.MachineManager.setActiveMachineVariant(model.getItem(index).name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true;
|
||||
implicitHeight: UM.Theme.sizes.setting.height;
|
||||
|
@ -83,6 +105,7 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: sidebarContents;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue