mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-08 14:34:01 -06:00
Solved merge conflicts. CURA-4525
This commit is contained in:
commit
5152b2ae65
329 changed files with 47911 additions and 17916 deletions
|
@ -20,14 +20,34 @@ UM.MainWindow
|
|||
viewportRect: Qt.rect(0, 0, (base.width - sidebar.width) / base.width, 1.0)
|
||||
property bool showPrintMonitor: false
|
||||
|
||||
// This connection is here to support legacy printer output devices that use the showPrintMonitor signal on Application to switch to the monitor stage
|
||||
// It should be phased out in newer plugin versions.
|
||||
Connections
|
||||
{
|
||||
target: Printer
|
||||
target: CuraApplication
|
||||
onShowPrintMonitor: {
|
||||
if (show) {
|
||||
topbar.startMonitoringPrint()
|
||||
UM.Controller.setActiveStage("MonitorStage")
|
||||
} else {
|
||||
topbar.stopMonitoringPrint()
|
||||
UM.Controller.setActiveStage("PrepareStage")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onWidthChanged:
|
||||
{
|
||||
// If slidebar is collapsed then it should be invisible
|
||||
// otherwise after the main_window resize the sidebar will be fully re-drawn
|
||||
if (sidebar.collapsed){
|
||||
if (sidebar.visible == true){
|
||||
sidebar.visible = false
|
||||
sidebar.initialWidth = 0
|
||||
}
|
||||
}
|
||||
else{
|
||||
if (sidebar.visible == false){
|
||||
sidebar.visible = true
|
||||
sidebar.initialWidth = UM.Theme.getSize("sidebar").width
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,6 +66,7 @@ UM.MainWindow
|
|||
//
|
||||
// This has been fixed for QtQuick Controls 2 since the Shortcut item has a context property.
|
||||
Cura.Actions.parent = backgroundItem
|
||||
CuraApplication.purgeWindows()
|
||||
}
|
||||
|
||||
Item
|
||||
|
@ -115,7 +136,7 @@ UM.MainWindow
|
|||
MenuItem
|
||||
{
|
||||
id: saveWorkspaceMenu
|
||||
text: catalog.i18nc("@title:menu menubar:file","Save project")
|
||||
text: catalog.i18nc("@title:menu menubar:file","Save &Project...")
|
||||
onTriggered:
|
||||
{
|
||||
if(UM.Preferences.getValue("cura/dialog_on_project_save"))
|
||||
|
@ -177,7 +198,7 @@ UM.MainWindow
|
|||
|
||||
MenuSeparator { }
|
||||
|
||||
MenuItem { text: catalog.i18nc("@action:inmenu", "Set as Active Extruder"); onTriggered: ExtruderManager.setActiveExtruderIndex(model.index) }
|
||||
MenuItem { text: catalog.i18nc("@action:inmenu", "Set as Active Extruder"); onTriggered: Cura.ExtruderManager.setActiveExtruderIndex(model.index) }
|
||||
}
|
||||
onObjectAdded: settingsMenu.insertItem(index, object)
|
||||
onObjectRemoved: settingsMenu.removeItem(object)
|
||||
|
@ -331,7 +352,7 @@ UM.MainWindow
|
|||
text: catalog.i18nc("@action:button","Open File");
|
||||
iconSource: UM.Theme.getIcon("load")
|
||||
style: UM.Theme.styles.tool_button
|
||||
tooltip: '';
|
||||
tooltip: ""
|
||||
anchors
|
||||
{
|
||||
top: topbar.bottom;
|
||||
|
@ -374,32 +395,6 @@ UM.MainWindow
|
|||
}
|
||||
}
|
||||
|
||||
Topbar
|
||||
{
|
||||
id: topbar
|
||||
anchors.left:parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
monitoringPrint: base.showPrintMonitor
|
||||
onStartMonitoringPrint: base.showPrintMonitor = true
|
||||
onStopMonitoringPrint: base.showPrintMonitor = false
|
||||
}
|
||||
|
||||
Sidebar
|
||||
{
|
||||
id: sidebar;
|
||||
|
||||
anchors
|
||||
{
|
||||
top: topbar.bottom;
|
||||
bottom: parent.bottom;
|
||||
right: parent.right;
|
||||
}
|
||||
z: 1
|
||||
width: UM.Theme.getSize("sidebar").width;
|
||||
monitoringPrint: base.showPrintMonitor
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: triggerObjectsList;
|
||||
|
@ -424,39 +419,94 @@ UM.MainWindow
|
|||
|
||||
}
|
||||
|
||||
Rectangle
|
||||
Topbar
|
||||
{
|
||||
id: viewportOverlay
|
||||
id: topbar
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
}
|
||||
|
||||
Loader
|
||||
{
|
||||
id: sidebar
|
||||
|
||||
property bool collapsed: false;
|
||||
property var initialWidth: UM.Theme.getSize("sidebar").width;
|
||||
|
||||
function callExpandOrCollapse() {
|
||||
if (collapsed) {
|
||||
sidebar.visible = true;
|
||||
sidebar.initialWidth = UM.Theme.getSize("sidebar").width;
|
||||
viewportRect = Qt.rect(0, 0, (base.width - sidebar.width) / base.width, 1.0);
|
||||
expandSidebarAnimation.start();
|
||||
} else {
|
||||
viewportRect = Qt.rect(0, 0, 1, 1.0);
|
||||
collapseSidebarAnimation.start();
|
||||
}
|
||||
collapsed = !collapsed;
|
||||
UM.Preferences.setValue("cura/sidebar_collapse", collapsed);
|
||||
}
|
||||
|
||||
color: UM.Theme.getColor("viewport_overlay")
|
||||
anchors
|
||||
{
|
||||
top: topbar.bottom
|
||||
top: topbar.top
|
||||
bottom: parent.bottom
|
||||
left:parent.left
|
||||
right: sidebar.left
|
||||
}
|
||||
visible: opacity > 0
|
||||
opacity: base.showPrintMonitor ? 1 : 0
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.AllButtons
|
||||
width: initialWidth
|
||||
x: base.width - sidebar.width
|
||||
source: UM.Controller.activeStage.sidebarComponent
|
||||
|
||||
onWheel: wheel.accepted = true
|
||||
NumberAnimation {
|
||||
id: collapseSidebarAnimation
|
||||
target: sidebar
|
||||
properties: "x"
|
||||
to: base.width
|
||||
duration: 100
|
||||
}
|
||||
|
||||
NumberAnimation {
|
||||
id: expandSidebarAnimation
|
||||
target: sidebar
|
||||
properties: "x"
|
||||
to: base.width - sidebar.width
|
||||
duration: 100
|
||||
}
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
var sidebarCollapsed = UM.Preferences.getValue("cura/sidebar_collapse");
|
||||
|
||||
if (sidebarCollapsed) {
|
||||
sidebar.collapsed = true;
|
||||
viewportRect = Qt.rect(0, 0, 1, 1.0)
|
||||
collapseSidebarAnimation.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loader
|
||||
{
|
||||
sourceComponent: Cura.MachineManager.printerOutputDevices.length > 0 ? Cura.MachineManager.printerOutputDevices[0].monitorItem: null
|
||||
visible: base.showPrintMonitor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenterOffset: - UM.Theme.getSize("sidebar").width / 2
|
||||
anchors.verticalCenterOffset: UM.Theme.getSize("sidebar_header").height / 2
|
||||
property real maximumWidth: viewportOverlay.width
|
||||
property real maximumHeight: viewportOverlay.height
|
||||
id: main
|
||||
|
||||
anchors
|
||||
{
|
||||
top: topbar.bottom
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
right: sidebar.left
|
||||
}
|
||||
|
||||
MouseArea
|
||||
{
|
||||
visible: UM.Controller.activeStage.mainComponent != ""
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.AllButtons
|
||||
onWheel: wheel.accepted = true
|
||||
}
|
||||
|
||||
source: UM.Controller.activeStage.mainComponent
|
||||
}
|
||||
|
||||
UM.MessageStack
|
||||
|
@ -472,6 +522,13 @@ UM.MainWindow
|
|||
}
|
||||
}
|
||||
|
||||
// Expand or collapse sidebar
|
||||
Connections
|
||||
{
|
||||
target: Cura.Actions.expandSidebar
|
||||
onTriggered: sidebar.callExpandOrCollapse()
|
||||
}
|
||||
|
||||
UM.PreferencesDialog
|
||||
{
|
||||
id: preferences
|
||||
|
@ -873,7 +930,7 @@ UM.MainWindow
|
|||
|
||||
Connections
|
||||
{
|
||||
target: Printer
|
||||
target: CuraApplication
|
||||
onShowMessageBox:
|
||||
{
|
||||
messageDialog.title = title
|
||||
|
@ -919,7 +976,7 @@ UM.MainWindow
|
|||
|
||||
Connections
|
||||
{
|
||||
target: Printer
|
||||
target: CuraApplication
|
||||
onRequestAddPrinter:
|
||||
{
|
||||
addMachineDialog.visible = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue