diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 50419067b4..f040469916 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -169,6 +169,14 @@ UM.MainWindow action: Cura.Actions.open } + MachineAndConfigurationSelector + { + anchors.left: openFileButton.right + //anchors.right: sidebar.left + anchors.leftMargin: UM.Theme.getSize("default_margin").height + anchors.top: openFileButton.top + } + Toolbar { id: toolbar diff --git a/resources/qml/PrepareSidebar.qml b/resources/qml/PrepareSidebar.qml index fe0fb033f7..a44f3fad7d 100644 --- a/resources/qml/PrepareSidebar.qml +++ b/resources/qml/PrepareSidebar.qml @@ -9,6 +9,8 @@ import UM 1.2 as UM import Cura 1.0 as Cura import "Menus" import "Menus/ConfigurationMenu" +import "components" + Rectangle { @@ -19,7 +21,6 @@ Rectangle property bool hideView: Cura.MachineManager.activeMachineName == "" // Is there an output device for this printer? - property bool isNetworkPrinter: Cura.MachineManager.activeMachineNetworkKey != "" property bool printerConnected: Cura.MachineManager.printerConnected property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands property var connectedPrinter: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null @@ -85,41 +86,11 @@ Rectangle } } - MachineSelection - { - id: machineSelection - width: base.width - configSelection.width - separator.width - height: UM.Theme.getSize("sidebar_header").height - anchors.top: base.top - anchors.left: parent.left - } - - Rectangle - { - id: separator - visible: configSelection.visible - width: visible ? Math.round(UM.Theme.getSize("sidebar_lining_thin").height / 2) : 0 - height: UM.Theme.getSize("sidebar_header").height - color: UM.Theme.getColor("sidebar_lining_thin") - anchors.left: machineSelection.right - } - - ConfigurationSelection - { - id: configSelection - visible: isNetworkPrinter && printerConnected - width: visible ? Math.round(base.width * 0.15) : 0 - height: UM.Theme.getSize("sidebar_header").height - anchors.top: base.top - anchors.right: parent.right - panelWidth: base.width - } - SidebarHeader { id: header width: parent.width visible: !hideSettings && (machineExtruderCount.properties.value > 1 || Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants) - anchors.top: machineSelection.bottom + anchors.top: parent.top onShowTooltip: base.showTooltip(item, location, text) onHideTooltip: base.hideTooltip() @@ -160,10 +131,9 @@ Rectangle } // Settings mode selection toggle - Rectangle + Item { id: settingsModeSelection - color: "transparent" width: Math.round(parent.width * 0.55) height: UM.Theme.getSize("sidebar_header_mode_toggle").height @@ -328,7 +298,6 @@ Rectangle anchors.bottomMargin: UM.Theme.getSize("sidebar_margin").height height: timeDetails.height + costSpec.height width: base.width - (saveButton.buttonRowWidth + UM.Theme.getSize("sidebar_margin").width) - clip: true Label { diff --git a/resources/qml/components/MachineAndConfigurationSelector.qml b/resources/qml/components/MachineAndConfigurationSelector.qml new file mode 100644 index 0000000000..5b919c42d8 --- /dev/null +++ b/resources/qml/components/MachineAndConfigurationSelector.qml @@ -0,0 +1,48 @@ +// Copyright (c) 2017 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.7 + +import UM 1.2 as UM +import Cura 1.0 as Cura +import "../Menus" +import "../Menus/ConfigurationMenu" +import ".." + +Rectangle +{ + color: UM.Theme.getColor("sidebar_lining_thin") + + implicitHeight: UM.Theme.getSize("sidebar_header").height + implicitWidth: UM.Theme.getSize("sidebar").width + + property bool isNetworkPrinter: Cura.MachineManager.activeMachineNetworkKey != "" + property bool printerConnected: Cura.MachineManager.printerConnected + + MachineSelection + { + id: machineSelection + anchors + { + left: parent.left + right: configSelection.left + rightMargin: UM.Theme.getSize("sidebar_lining_thin").height / 2 + top: parent.top + bottom: parent.bottom + } + } + + ConfigurationSelection + { + id: configSelection + visible: isNetworkPrinter && printerConnected + width: visible ? Math.round(parent.width * 0.15) : 0 + panelWidth: parent.width + anchors + { + right: parent.right + top: parent.top + bottom: parent.bottom + } + } +} \ No newline at end of file