Browse Source

Merge branch 'ui_rework_4_0' into CURA-5876-Configuration_dropdown

Conflicts:
	plugins/PrepareStage/PrepareMenu.qml: Some indentation change caused it to misalign the diffs, thinking it couldn't merge two of the same lines which actually weren't the same lines.
	resources/qml/Menus/ConfigurationMenu/QuickConfigurationSelector.qml: This file was deleted in my branch. I'm holding for the new version.
Ghostkeeper 6 years ago
parent
commit
826044da7e

+ 2 - 41
Jenkinsfile

@@ -38,20 +38,9 @@ parallel_nodes(['linux && cura', 'windows && cura'])
                 {
                     if (isUnix())
                     {
-                        // For Linux to show everything
-                        def branch = env.BRANCH_NAME
-                        if(!fileExists("${env.CURA_ENVIRONMENT_PATH}/${branch}"))
-                        {
-                            branch = "master"
-                        }
-                        def uranium_dir = get_workspace_dir("Ultimaker/Uranium/${branch}")
-
+                        // For Linux
                         try {
-                            sh """
-                                cd ..
-                                export PYTHONPATH=.:"${uranium_dir}"
-                                ${env.CURA_ENVIRONMENT_PATH}/${branch}/bin/pytest -x --verbose --full-trace --capture=no ./tests
-                            """
+                            sh 'make CTEST_OUTPUT_ON_FAILURE=TRUE test'
                         } catch(e)
                         {
                             currentBuild.result = "UNSTABLE"
@@ -70,34 +59,6 @@ parallel_nodes(['linux && cura', 'windows && cura'])
                         }
                     }
                 }
-
-                stage('Code Style')
-                {
-                    if (isUnix())
-                    {
-                        // For Linux to show everything.
-                        // CMake also runs this test, but if it fails then the test just shows "failed" without details of what exactly failed.
-                        def branch = env.BRANCH_NAME
-                        if(!fileExists("${env.CURA_ENVIRONMENT_PATH}/${branch}"))
-                        {
-                            branch = "master"
-                        }
-                        def uranium_dir = get_workspace_dir("Ultimaker/Uranium/${branch}")
-
-                        try
-                        {
-                            sh """
-                                cd ..
-                                export PYTHONPATH=.:"${uranium_dir}"
-                                ${env.CURA_ENVIRONMENT_PATH}/${branch}/bin/python3 run_mypy.py
-                            """
-                        }
-                        catch(e)
-                        {
-                            currentBuild.result = "UNSTABLE"
-                        }
-                    }
-                }
             }
         }
 

+ 2 - 0
cmake/CuraTests.cmake

@@ -6,6 +6,8 @@ include(CMakeParseArguments)
 
 find_package(PythonInterp 3.5.0 REQUIRED)
 
+add_custom_target(test-verbose COMMAND ${CMAKE_CTEST_COMMAND} --verbose)
+
 function(cura_add_test)
     set(_single_args NAME DIRECTORY PYTHONPATH)
     cmake_parse_arguments("" "" "${_single_args}" "" ${ARGN})

+ 3 - 1
cura/BuildVolume.py

@@ -489,7 +489,9 @@ class BuildVolume(SceneNode):
 
     def _updateRaftThickness(self):
         old_raft_thickness = self._raft_thickness
-        self._adhesion_type = self._global_container_stack.getProperty("adhesion_type", "value")
+        if self._global_container_stack.extruders:
+            # This might be called before the extruder stacks have initialised, in which case getting the adhesion_type fails
+            self._adhesion_type = self._global_container_stack.getProperty("adhesion_type", "value")
         self._raft_thickness = 0.0
         if self._adhesion_type == "raft":
             self._raft_thickness = (

+ 1 - 1
cura/Scene/ConvexHullDecorator.py

@@ -272,7 +272,7 @@ class ConvexHullDecorator(SceneNodeDecorator):
         head_and_fans = self._getHeadAndFans().intersectionConvexHulls(mirrored)
 
         # Min head hull is used for the push free
-        convex_hull = self._compute2DConvexHeadFull()
+        convex_hull = self._compute2DConvexHull()
         if convex_hull:
             return convex_hull.getMinkowskiHull(head_and_fans)
         return None

+ 6 - 1
cura/Settings/CuraFormulaFunctions.py

@@ -5,6 +5,7 @@ from typing import Any, List, Optional, TYPE_CHECKING
 
 from UM.Settings.PropertyEvaluationContext import PropertyEvaluationContext
 from UM.Settings.SettingFunction import SettingFunction
+from UM.Logger import Logger
 
 if TYPE_CHECKING:
     from cura.CuraApplication import CuraApplication
@@ -38,7 +39,11 @@ class CuraFormulaFunctions:
             extruder_position = int(machine_manager.defaultExtruderPosition)
 
         global_stack = machine_manager.activeMachine
-        extruder_stack = global_stack.extruders[str(extruder_position)]
+        try:
+            extruder_stack = global_stack.extruders[str(extruder_position)]
+        except KeyError:
+            Logger.log("w", "Value for %s of extruder %s was requested, but that extruder is not available" % (property_key, extruder_position))
+            return None
 
         value = extruder_stack.getRawProperty(property_key, "value", context = context)
         if isinstance(value, SettingFunction):

+ 44 - 56
plugins/PrepareStage/PrepareMenu.qml

@@ -24,74 +24,62 @@ Item
     Item
     {
         anchors.horizontalCenter: parent.horizontalCenter
-        width: openFileButtonBackground.width + itemRowBackground.width
+        width: openFileButtonBackground.width + itemRow.width + UM.Theme.getSize("default_margin").width
         height: parent.height
 
-        Rectangle
+        RowLayout
         {
-            id: itemRowBackground
-            radius: UM.Theme.getSize("default_radius").width
+            id: itemRow
 
-            color: UM.Theme.getColor("toolbar_background")
+            anchors.left: openFileButtonBackground.right
+            anchors.leftMargin: UM.Theme.getSize("default_margin").width
 
-            width: itemRow.width + UM.Theme.getSize("default_margin").width
+            width: Math.round(0.9 * prepareMenu.width)
             height: parent.height
+            spacing: 0
 
-            anchors.left: openFileButtonBackground.right
-            anchors.leftMargin: UM.Theme.getSize("default_margin").width
+            Cura.MachineSelector
+            {
+                id: machineSelection
+                z: openFileButtonBackground.z - 1 //Ensure that the tooltip of the open file button stays above the item row.
+                headerCornerSide: Cura.RoundedRectangle.Direction.Left
+                Layout.minimumWidth: UM.Theme.getSize("machine_selector_widget").width
+                Layout.maximumWidth: UM.Theme.getSize("machine_selector_widget").width
+                Layout.fillWidth: true
+                Layout.fillHeight: true
+            }
 
-            RowLayout
+            // Separator line
+            Rectangle
             {
-                id: itemRow
+                height: parent.height
+                width: UM.Theme.getSize("default_lining").width
+                color: UM.Theme.getColor("lining")
+            }
 
-                anchors.centerIn: parent
+            Cura.ConfigurationMenu
+            {
+                Layout.fillHeight: true
+                Layout.fillWidth: true
+                Layout.preferredWidth: itemRow.width - machineSelection.width - printSetupSelectorItem.width - 2 * UM.Theme.getSize("default_lining").width
+            }
 
-                width: 0.9 * prepareMenu.width
+            // Separator line
+            Rectangle
+            {
                 height: parent.height
-                spacing: 0
-
-                Cura.MachineSelector
-                {
-                    id: machineSelection
-                    z: openFileButtonBackground.z - 1 //Ensure that the tooltip of the open file button stays above the item row.
-                    Layout.minimumWidth: UM.Theme.getSize("machine_selector_widget").width
-                    Layout.maximumWidth: UM.Theme.getSize("machine_selector_widget").width
-                    Layout.fillWidth: true
-                    Layout.fillHeight: true
-                }
-
-                // Separator line
-                Rectangle
-                {
-                    height: parent.height
-                    width: UM.Theme.getSize("default_lining").width
-                    color: UM.Theme.getColor("lining")
-                }
-
-                Cura.ConfigurationMenu
-                {
-                    Layout.fillHeight: true
-                    Layout.fillWidth: true
-                    Layout.preferredWidth: itemRow.width - machineSelection.width - printSetupSelectorItem.width - 2 * UM.Theme.getSize("default_lining").width
-                }
-
-                // Separator line
-                Rectangle
-                {
-                    height: parent.height
-                    width: UM.Theme.getSize("default_lining").width
-                    color: UM.Theme.getColor("lining")
-                }
-
-                Item
-                {
-                    id: printSetupSelectorItem
-                    // This is a work around to prevent the printSetupSelector from having to be re-loaded every time
-                    // a stage switch is done.
-                    children: [printSetupSelector]
-                    height: childrenRect.height
-                    width: childrenRect.width
-                }
+                width: UM.Theme.getSize("default_lining").width
+                color: UM.Theme.getColor("lining")
+            }
+
+            Item
+            {
+                id: printSetupSelectorItem
+                // This is a work around to prevent the printSetupSelector from having to be re-loaded every time
+                // a stage switch is done.
+                children: [printSetupSelector]
+                height: childrenRect.height
+                width: childrenRect.width
             }
         }
 

+ 91 - 98
plugins/PreviewStage/PreviewMenu.qml

@@ -2,8 +2,7 @@
 // Cura is released under the terms of the LGPLv3 or higher.
 
 import QtQuick 2.7
-
-import QtQuick.Controls 2.4
+import QtQuick.Controls 2.3
 
 import UM 1.3 as UM
 import Cura 1.1 as Cura
@@ -23,130 +22,124 @@ Item
         name: "cura"
     }
 
-    Rectangle
-    {
-        anchors.fill: stageMenu
-        anchors.leftMargin: -radius
-        radius: UM.Theme.getSize("default_radius").width
-        color: UM.Theme.getColor("toolbar_background")
-    }
 
-    Item
+    Row
     {
-        id: stageMenu
+        id: stageMenuRow
+        anchors.centerIn: parent
         height: parent.height
-        width: stageMenuRow.width + UM.Theme.getSize("default_margin").width
-        anchors.horizontalCenter: parent.horizontalCenter
-        Row
+
+        Cura.ExpandableComponent
         {
-            id: stageMenuRow
-            anchors.centerIn: parent
+            id: viewSelector
+            iconSource: expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left")
             height: parent.height
+            width: UM.Theme.getSize("views_selector").width
+            headerCornerSide: Cura.RoundedRectangle.Direction.Left
 
-            Cura.ExpandableComponent
-            {
-                id: viewSelector
-                iconSource: expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left")
-                height: parent.height
-
-                property var viewModel: UM.ViewModel { }
+            property var viewModel: UM.ViewModel { }
 
-                property var activeView:
+            property var activeView:
+            {
+                for (var i = 0; i < viewModel.rowCount(); i++)
                 {
-                    for (var i = 0; i < viewModel.rowCount(); i++)
+                    if (viewModel.items[i].active)
                     {
-                        if (viewModel.getItem(i).active)
-                        {
-                            return viewModel.getItem(i)
-                        }
+                        return viewModel.items[i]
                     }
-                    // Nothing was active, so just return the first one (the list is sorted by priority, so the most
-                    // important one should be returned)
-                    return viewModel.getItem(0)
                 }
+                return null
+            }
 
-                // Ensure that the controller is synced with whatever happend here.
-                onActiveViewChanged: UM.Controller.setActiveView(activeView.id)
-
-                headerItem: Label
+            Component.onCompleted:
+            {
+                // Nothing was active, so just return the first one (the list is sorted by priority, so the most
+                // important one should be returned)
+                if (activeView == null)
                 {
-                    text: viewSelector.activeView.name
-                    verticalAlignment: Text.AlignVCenter
-                    height: parent.height
-                    elide: Text.ElideRight
-                    font: UM.Theme.getFont("default")
-                    color: UM.Theme.getColor("text")
+                    UM.Controller.setActiveView(viewModel.getItem(0).id)
                 }
+            }
 
-                popupItem: Column
-                {
-                    id: viewSelectorPopup
-                    width: viewSelector.width - 2 * UM.Theme.getSize("default_margin").width
+            headerItem: Label
+            {
+                text: viewSelector.activeView ? viewSelector.activeView.name : ""
+                verticalAlignment: Text.AlignVCenter
+                height: parent.height
+                elide: Text.ElideRight
+                font: UM.Theme.getFont("default")
+                color: UM.Theme.getColor("text")
+                renderType: Text.NativeRendering
+            }
 
-                    // For some reason the height/width of the column gets set to 0 if this is not set...
-                    Component.onCompleted:
-                    {
-                        height = implicitHeight
-                        width = viewSelector.width - 2 * UM.Theme.getSize("default_margin").width
-                    }
+            popupItem: Column
+            {
+                id: viewSelectorPopup
+                width: viewSelector.width - 2 * UM.Theme.getSize("default_margin").width
+
+                // For some reason the height/width of the column gets set to 0 if this is not set...
+                Component.onCompleted:
+                {
+                    height = implicitHeight
+                    width = viewSelector.width - 2 * UM.Theme.getSize("default_margin").width
+                }
 
-                    Repeater
+                Repeater
+                {
+                    id: viewsList
+                    model: viewSelector.viewModel
+                    RoundButton
                     {
-                        id: viewsList
-                        model: viewSelector.viewModel
-                        RoundButton
+                        text: name
+                        radius: UM.Theme.getSize("default_radius").width
+                        checkable: true
+                        checked: viewSelector.activeView != null ? viewSelector.activeView.id == id : false
+                        onClicked:
                         {
-                            text: name
-                            radius: UM.Theme.getSize("default_radius").width
-                            checkable: true
-                            checked: active
-                            onClicked:
-                            {
-                                viewSelector.togglePopup()
-                                UM.Controller.setActiveView(id)
-                            }
+                            viewSelector.togglePopup()
+                            UM.Controller.setActiveView(id)
                         }
                     }
-
                 }
+
             }
+        }
 
-            // Separator line
-            Rectangle
-            {
-                height: parent.height
-                // If there is no viewPanel, we only need a single spacer, so hide this one.
-                visible: viewPanel.source != ""
-                width: visible ? UM.Theme.getSize("default_lining").width : 0
+        // Separator line
+        Rectangle
+        {
+            height: parent.height
+            // If there is no viewPanel, we only need a single spacer, so hide this one.
+            visible: viewPanel.source != ""
+            width: visible ? UM.Theme.getSize("default_lining").width : 0
 
-                color: UM.Theme.getColor("lining")
-            }
+            color: UM.Theme.getColor("lining")
+        }
 
-            Loader
-            {
-                id: viewPanel
-                height: parent.height
-                width: childrenRect.width
-                source: UM.Controller.activeView != null && UM.Controller.activeView.stageMenuComponent != null ? UM.Controller.activeView.stageMenuComponent : ""
-            }
+        Loader
+        {
+            id: viewPanel
+            height: parent.height
+            width: childrenRect.width
+            source: UM.Controller.activeView != null && UM.Controller.activeView.stageMenuComponent != null ? UM.Controller.activeView.stageMenuComponent : ""
+        }
 
-            // Separator line
-            Rectangle
-            {
-                height: parent.height
-                width: UM.Theme.getSize("default_lining").width
-                color: UM.Theme.getColor("lining")
-            }
+        // Separator line
+        Rectangle
+        {
+            height: parent.height
+            width: UM.Theme.getSize("default_lining").width
+            color: UM.Theme.getColor("lining")
+        }
 
-            Item
-            {
-                id: printSetupSelectorItem
-                // This is a work around to prevent the printSetupSelector from having to be re-loaded every time
-                // a stage switch is done.
-                children: [printSetupSelector]
-                height: childrenRect.height
-                width: childrenRect.width
-            }
+        Item
+        {
+            id: printSetupSelectorItem
+            // This is a work around to prevent the printSetupSelector from having to be re-loaded every time
+            // a stage switch is done.
+            children: [printSetupSelector]
+            height: childrenRect.height
+            width: childrenRect.width
         }
     }
 }

+ 8 - 4
plugins/SimulationView/SimulationViewMenuComponent.qml

@@ -40,7 +40,6 @@ Cura.ExpandableComponent
         id: layerViewTypesLabel
         text: catalog.i18nc("@label", "Color scheme")
         font: UM.Theme.getFont("default")
-        visible: !UM.SimulationView.compatibilityMode
         color: UM.Theme.getColor("setting_control_text")
         height: base.height
         verticalAlignment: Text.AlignVCenter
@@ -65,7 +64,7 @@ Cura.ExpandableComponent
         property int top_layer_count: UM.Preferences.getValue("view/top_layer_count")
 
         width: UM.Theme.getSize("layerview_menu_size").width - 2 * UM.Theme.getSize("default_margin").width
-        height: childrenRect.height
+        height: implicitHeight
 
         spacing: UM.Theme.getSize("layerview_row_spacing").height
 
@@ -132,6 +131,7 @@ Cura.ExpandableComponent
             visible: UM.SimulationView.compatibilityMode
             height: UM.Theme.getSize("layerview_row").height
             width: parent.width
+            renderType: Text.NativeRendering
         }
 
         Item  // Spacer
@@ -188,7 +188,7 @@ Cura.ExpandableComponent
                         leftMargin: UM.Theme.getSize("checkbox").width + Math.round(UM.Theme.getSize("default_margin").width / 2)
                         rightMargin: UM.Theme.getSize("default_margin").width * 2
                     }
-
+                    renderType: Text.NativeRendering
                 }
             }
         }
@@ -254,6 +254,7 @@ Cura.ExpandableComponent
                     text: label
                     font: UM.Theme.getFont("default")
                     elide: Text.ElideRight
+                    renderType: Text.NativeRendering
                     color: UM.Theme.getColor("setting_control_text")
                     anchors.verticalCenter: parent.verticalCenter
                     anchors.left: legendModelCheckBox.left
@@ -271,6 +272,7 @@ Cura.ExpandableComponent
             text: catalog.i18nc("@label", "Only Show Top Layers")
             visible: UM.SimulationView.compatibilityMode
             style: UM.Theme.styles.checkbox
+            width: parent.width
         }
 
         CheckBox
@@ -278,6 +280,7 @@ Cura.ExpandableComponent
             checked: viewSettings.top_layer_count == 5
             onClicked: UM.Preferences.setValue("view/top_layer_count", checked ? 5 : 1)
             text: catalog.i18nc("@label", "Show 5 Detailed Layers On Top")
+            width: parent.width
             visible: UM.SimulationView.compatibilityMode
             style: UM.Theme.styles.checkbox
         }
@@ -310,7 +313,7 @@ Cura.ExpandableComponent
                 width: parent.width
                 color: UM.Theme.getColor("setting_control_text")
                 font: UM.Theme.getFont("default")
-
+                renderType: Text.NativeRendering
                 Rectangle
                 {
                     anchors.verticalCenter: parent.verticalCenter
@@ -357,6 +360,7 @@ Cura.ExpandableComponent
                 anchors.left: parent.left
                 color: UM.Theme.getColor("setting_control_text")
                 font: UM.Theme.getFont("default")
+                renderType: Text.NativeRendering
             }
 
             Label

+ 1 - 1
plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml

@@ -83,7 +83,7 @@ Item
             model: packageData.supported_configs
             headerDelegate: Rectangle
             {
-                color: UM.Theme.getColor("sidebar")
+                color: UM.Theme.getColor("main_background")
                 height: UM.Theme.getSize("toolbox_chart_row").height
                 Label
                 {

+ 1 - 1
plugins/UM3NetworkPrinting/resources/qml/ClusterControlItem.qml

@@ -13,7 +13,7 @@ Component {
         property var shadowRadius: UM.Theme.getSize("monitor_shadow_radius").width;
         property var cornerRadius: UM.Theme.getSize("monitor_corner_radius").width;
         anchors.fill: parent;
-        color: UM.Theme.getColor("sidebar");
+        color: UM.Theme.getColor("main_background");
         visible: OutputDevice != null;
 
         UM.I18nCatalog {

Some files were not shown because too many files changed in this diff