mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 19:35:56 +08:00
Add a combo box and menu entries to select the current machine variant
This commit is contained in:
parent
255caf8693
commit
900e733839
@ -135,6 +135,23 @@ UM.MainWindow {
|
|||||||
|
|
||||||
MenuSeparator { }
|
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.addMachine; }
|
||||||
MenuItem { action: actions.configureMachines; }
|
MenuItem { action: actions.configureMachines; }
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import QtQuick.Controls 1.1
|
|||||||
import QtQuick.Controls.Styles 1.1
|
import QtQuick.Controls.Styles 1.1
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts 1.1
|
||||||
|
|
||||||
import UM 1.0 as UM
|
import UM 1.1 as UM
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: base;
|
id: base;
|
||||||
@ -60,6 +60,28 @@ Rectangle {
|
|||||||
onCurrentModeIndexChanged: UM.Preferences.setValue("cura/active_mode", currentModeIndex);
|
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 {
|
Item {
|
||||||
Layout.fillWidth: true;
|
Layout.fillWidth: true;
|
||||||
implicitHeight: UM.Theme.sizes.setting.height;
|
implicitHeight: UM.Theme.sizes.setting.height;
|
||||||
@ -83,6 +105,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: sidebarContents;
|
id: sidebarContents;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user