|
@@ -87,11 +87,19 @@ Rectangle
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ onCurrentModeIndexChanged:
|
|
|
+ {
|
|
|
+ UM.Preferences.setValue("cura/active_mode", currentModeIndex);
|
|
|
+ if(modesListModel.count > base.currentModeIndex)
|
|
|
+ {
|
|
|
+ sidebarContents.push({ "item": modesListModel.get(base.currentModeIndex).item, "replace": true });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
SidebarHeader {
|
|
|
id: header
|
|
|
width: parent.width
|
|
|
- visible: machineExtruderCount.properties.value > 1 || Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants
|
|
|
-
|
|
|
+ visible: (machineExtruderCount.properties.value > 1 || Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants) && Cura.SidebarController.activeSidebarId == "default"
|
|
|
onShowTooltip: base.showTooltip(item, location, text)
|
|
|
onHideTooltip: base.hideTooltip()
|
|
|
}
|
|
@@ -99,22 +107,13 @@ Rectangle
|
|
|
Rectangle {
|
|
|
id: headerSeparator
|
|
|
width: parent.width
|
|
|
- visible: settingsModeSelection.visible && header.visible
|
|
|
+ visible: settingsModeSelection.visible && header.visible && Cura.SidebarController.activeSidebarId == "default"
|
|
|
height: visible ? UM.Theme.getSize("sidebar_lining").height : 0
|
|
|
color: UM.Theme.getColor("sidebar_lining")
|
|
|
anchors.top: header.bottom
|
|
|
anchors.topMargin: visible ? UM.Theme.getSize("sidebar_margin").height : 0
|
|
|
}
|
|
|
|
|
|
- onCurrentModeIndexChanged:
|
|
|
- {
|
|
|
- UM.Preferences.setValue("cura/active_mode", currentModeIndex);
|
|
|
- if(modesListModel.count > base.currentModeIndex)
|
|
|
- {
|
|
|
- sidebarContents.push({ "item": modesListModel.get(base.currentModeIndex).item, "replace": true });
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
Label {
|
|
|
id: settingsModeLabel
|
|
|
text: !hideSettings ? catalog.i18nc("@label:listbox", "Print Setup") : catalog.i18nc("@label:listbox","Print Setup disabled\nG-code files cannot be modified");
|
|
@@ -125,7 +124,7 @@ Rectangle
|
|
|
width: Math.floor(parent.width * 0.45)
|
|
|
font: UM.Theme.getFont("large")
|
|
|
color: UM.Theme.getColor("text")
|
|
|
- visible: !monitoringPrint && !hideView
|
|
|
+ visible: !monitoringPrint && !hideView && Cura.SidebarController.activeSidebarId == "default"
|
|
|
}
|
|
|
|
|
|
Rectangle {
|
|
@@ -147,7 +146,7 @@ Rectangle
|
|
|
}
|
|
|
}
|
|
|
anchors.topMargin: UM.Theme.getSize("sidebar_margin").height
|
|
|
- visible: !monitoringPrint && !hideSettings && !hideView
|
|
|
+ visible: !monitoringPrint && !hideSettings && !hideView && Cura.SidebarController.activeSidebarId == "default"
|
|
|
Component{
|
|
|
id: wizardDelegate
|
|
|
Button {
|
|
@@ -228,7 +227,7 @@ Rectangle
|
|
|
anchors.topMargin: UM.Theme.getSize("sidebar_margin").height
|
|
|
anchors.left: base.left
|
|
|
anchors.right: base.right
|
|
|
- visible: !monitoringPrint && !hideSettings
|
|
|
+ visible: !monitoringPrint && !hideSettings && Cura.SidebarController.activeSidebarId == "default"
|
|
|
|
|
|
delegate: StackViewDelegate
|
|
|
{
|
|
@@ -259,6 +258,29 @@ Rectangle
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // The sidebarRepeater exposes sidebar views provided by plugins.
|
|
|
+ // Whenever a plugin sidebar view is active (e.g. not "default"), that sidebar view is shown.
|
|
|
+ Repeater
|
|
|
+ {
|
|
|
+ id: sidebarRepeater
|
|
|
+
|
|
|
+ model: Cura.SidebarViewModel { }
|
|
|
+
|
|
|
+ delegate: Loader
|
|
|
+ {
|
|
|
+ id: delegate
|
|
|
+ asynchronous: true
|
|
|
+ visible: model.active
|
|
|
+
|
|
|
+ // dynamically get the component from the sidebar controller or set the default sidebar
|
|
|
+ sourceComponent: {
|
|
|
+ if (model.id !== "default") {
|
|
|
+ return Cura.SidebarController.getSidebarComponent(model.id)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
Loader
|
|
|
{
|
|
|
id: controlItem
|