From a47107448ef1476f94ed9406568d4dae24473670 Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Thu, 21 Dec 2017 11:39:37 +0100 Subject: [PATCH] Moved objects menu to lower left and made it collapsible. CURA-4525 --- .../ProcessSlicedLayersJob.py | 2 +- resources/qml/Cura.qml | 40 ++------------ resources/qml/ObjectsList.qml | 55 +++++++++++++------ resources/themes/cura-light/theme.json | 4 +- 4 files changed, 47 insertions(+), 54 deletions(-) diff --git a/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py b/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py index 077e81f8dc..5f632768ec 100644 --- a/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py +++ b/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py @@ -69,7 +69,7 @@ class ProcessSlicedLayersJob(Job): return self._build_plate_number def run(self): - Logger.log("d", "########## Processing new layer for [%s]..." % self._build_plate_number) + Logger.log("d", "Processing new layer for build plate %s..." % self._build_plate_number) start_time = time() view = Application.getInstance().getController().getActiveView() if view.getPluginId() == "SimulationView": diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 9f3ccb67c5..ec9773679a 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -348,7 +348,6 @@ UM.MainWindow Button { id: openFileButton; - visible: !UM.Preferences.getValue("cura/use_multi_build_plate") text: catalog.i18nc("@action:button","Open File"); iconSource: UM.Theme.getIcon("load") style: UM.Theme.styles.tool_button @@ -362,25 +361,6 @@ UM.MainWindow action: Cura.Actions.open; } - Button - { - id: objectsButton; - visible: UM.Preferences.getValue("cura/use_multi_build_plate") - - text: catalog.i18nc("@action:button","Objects list"); - iconSource: UM.Theme.getIcon("plus") - style: UM.Theme.styles.tool_button - tooltip: ''; - anchors - { - top: topbar.bottom; - //top: openFileButton.bottom; - topMargin: UM.Theme.getSize("default_margin").height; - left: parent.left; - } - action: triggerObjectsList; - } - Toolbar { id: toolbar; @@ -389,32 +369,24 @@ UM.MainWindow property int mouseY: base.mouseY anchors { - top: objectsButton.bottom; + top: openFileButton.bottom; topMargin: UM.Theme.getSize("window_margin").height; left: parent.left; } } - Action - { - id: triggerObjectsList; - text: catalog.i18nc("@action:inmenu menubar:file","&Open File(s)..."); - iconName: "document-open"; - shortcut: StandardKey.Open; - onTriggered: objectsList.visible = !objectsList.visible; - } - ObjectsList { id: objectsList; - visible: false; - //z: -10; + visible: UM.Preferences.getValue("cura/use_multi_build_plate"); anchors { - top: objectsButton.top; - left: objectsButton.right; + bottom: parent.bottom; + left: parent.left; leftMargin: UM.Theme.getSize("default_margin").width; rightMargin: UM.Theme.getSize("default_margin").width; + topMargin: UM.Theme.getSize("default_margin").height; + bottomMargin: UM.Theme.getSize("default_margin").height; } } diff --git a/resources/qml/ObjectsList.qml b/resources/qml/ObjectsList.qml index bf7d92c4d6..e0e7e08820 100644 --- a/resources/qml/ObjectsList.qml +++ b/resources/qml/ObjectsList.qml @@ -19,25 +19,43 @@ Rectangle color: UM.Theme.getColor("tool_panel_background") width: UM.Theme.getSize("objects_menu_size").width - height: UM.Theme.getSize("objects_menu_size").height + height: { + if (collapsed) { + return UM.Theme.getSize("objects_menu_size_collapsed").height; + } else { + return UM.Theme.getSize("objects_menu_size").height; + } + } + + property bool collapsed: false; SystemPalette { id: palette } - Button - { - id: openFileButton; - text: catalog.i18nc("@action:button","Open File"); - iconSource: UM.Theme.getIcon("load") - style: UM.Theme.styles.tool_button - tooltip: ''; - anchors + Button { + id: collapseButton + anchors.top: parent.top + anchors.topMargin: Math.floor(UM.Theme.getSize("default_margin").height + (UM.Theme.getSize("layerview_row").height - UM.Theme.getSize("default_margin").height) / 2) + anchors.right: parent.right + anchors.rightMargin: UM.Theme.getSize("default_margin").width + + width: UM.Theme.getSize("standard_arrow").width + height: UM.Theme.getSize("standard_arrow").height + + onClicked: collapsed = !collapsed + + style: ButtonStyle { - top: parent.top; - topMargin: UM.Theme.getSize("default_margin").height; - left: parent.left; - leftMargin: UM.Theme.getSize("default_margin").height; + background: UM.RecolorImage + { + width: control.width + height: control.height + sourceSize.width: width + sourceSize.height: width + color: UM.Theme.getColor("setting_control_text") + source: collapsed ? UM.Theme.getIcon("arrow_left") : UM.Theme.getIcon("arrow_bottom") + } + label: Label{ } } - action: Cura.Actions.open; } Component { @@ -86,11 +104,12 @@ Rectangle { id: objectsList frameVisible: true + visible: !collapsed width: parent.width - 2 * UM.Theme.getSize("default_margin").height anchors { - top: openFileButton.bottom; + top: collapseButton.bottom; topMargin: UM.Theme.getSize("default_margin").height; left: parent.left; leftMargin: UM.Theme.getSize("default_margin").height; @@ -118,10 +137,11 @@ Rectangle CheckBox { id: filterBuildPlateCheckbox + visible: !collapsed checked: boolCheck(UM.Preferences.getValue("view/filter_current_build_plate")) onClicked: UM.Preferences.setValue("view/filter_current_build_plate", checked) - text: catalog.i18nc("@option:check","Filter active build plate"); + text: catalog.i18nc("@option:check","See only current build plate"); anchors { @@ -133,7 +153,6 @@ Rectangle } } - Component { id: buildPlateDelegate Rectangle @@ -167,7 +186,7 @@ Rectangle { id: buildPlateSelection frameVisible: true - height: 100 + height: UM.Theme.getSize("build_plate_selection_size").height width: parent.width - 2 * UM.Theme.getSize("default_margin").height anchors diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index e7e1a377f5..714e578d97 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -393,6 +393,8 @@ "jobspecs_line": [2.0, 2.0], - "objects_menu_size": [20, 40] + "objects_menu_size": [17, 40], + "objects_menu_size_collapsed": [15, 15], + "build_plate_selection_size": [15, 5] } }