Browse Source

Merge branch 'CURA-8202_Resize_new_icons' into CURA-8011_Replace_extruder_icons

Konstantinos Karmas 3 years ago
parent
commit
7c02e1b5e5

+ 7 - 1
cura/Machines/Models/ExtrudersModel.py

@@ -53,6 +53,9 @@ class ExtrudersModel(ListModel):
     EnabledRole = Qt.UserRole + 11
     """Is the extruder enabled?"""
 
+    MaterialTypeRole = Qt.UserRole + 12
+    """The type of the material (e.g. PLA, ABS, PETG, etc.)."""
+
     defaultColors = ["#ffc924", "#86ec21", "#22eeee", "#245bff", "#9124ff", "#ff24c8"]
     """List of colours to display if there is no material or the material has no known colour. """
 
@@ -75,6 +78,7 @@ class ExtrudersModel(ListModel):
         self.addRoleName(self.StackRole, "stack")
         self.addRoleName(self.MaterialBrandRole, "material_brand")
         self.addRoleName(self.ColorNameRole, "color_name")
+        self.addRoleName(self.MaterialTypeRole, "material_type")
         self._update_extruder_timer = QTimer()
         self._update_extruder_timer.setInterval(100)
         self._update_extruder_timer.setSingleShot(True)
@@ -193,7 +197,8 @@ class ExtrudersModel(ListModel):
                     "variant": extruder.variant.getName() if extruder.variant else "",  # e.g. print core
                     "stack": extruder,
                     "material_brand": material_brand,
-                    "color_name": color_name
+                    "color_name": color_name,
+                    "material_type": extruder.material.getMetaDataEntry("material") if extruder.material else "",
                 }
 
                 items.append(item)
@@ -218,6 +223,7 @@ class ExtrudersModel(ListModel):
                     "stack": None,
                     "material_brand": "",
                     "color_name": "",
+                    "material_type": "",
                 }
                 items.append(item)
             if self._items != items:

+ 1 - 1
cura/UI/WhatsNewPagesModel.py

@@ -29,7 +29,7 @@ class WhatsNewPagesModel(WelcomePagesModel):
                 for filename in files:
                     basename = os.path.basename(filename)
                     base, ext = os.path.splitext(basename)
-                    if ext not in include or not base.isdigit():
+                    if ext.lower() not in include or not base.isdigit():
                         continue
                     page_no = int(base)
                     highest = max(highest, page_no)

+ 9 - 36
plugins/PrepareStage/PrepareMenu.qml

@@ -8,7 +8,6 @@ import QtQuick.Controls 2.3
 import UM 1.3 as UM
 import Cura 1.1 as Cura
 
-import QtGraphicalEffects 1.0 // For the dropshadow
 
 Item
 {
@@ -42,42 +41,28 @@ Item
             anchors.left: openFileButton.right
             anchors.right: parent.right
             anchors.leftMargin: UM.Theme.getSize("default_margin").width
+            property int machineSelectorWidth: Math.round((width - printSetupSelectorItem.width) / 3)
 
             height: parent.height
-            spacing: 0
+            // This is a trick to make sure that the borders of the two adjacent buttons' borders overlap. Otherwise
+            // there will be double border (one from each button)
+            spacing: -UM.Theme.getSize("default_lining").width
 
             Cura.MachineSelector
             {
                 id: machineSelection
                 headerCornerSide: Cura.RoundedRectangle.Direction.Left
-                Layout.minimumWidth: UM.Theme.getSize("machine_selector_widget").width
-                Layout.maximumWidth: UM.Theme.getSize("machine_selector_widget").width
+                Layout.preferredWidth: parent.machineSelectorWidth
                 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
             {
                 id: printerSetup
                 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")
+                Layout.preferredWidth: parent.machineSelectorWidth * 2
             }
 
             Item
@@ -106,7 +91,7 @@ Item
                 {
                     id: buttonIcon
                     anchors.centerIn: parent
-                    source: UM.Theme.getIcon("Folder")
+                    source: UM.Theme.getIcon("Folder", "medium")
                     width: UM.Theme.getSize("button_icon").width
                     height: UM.Theme.getSize("button_icon").height
                     color: UM.Theme.getColor("icon")
@@ -120,24 +105,12 @@ Item
                 id: background
                 height: UM.Theme.getSize("stage_menu").height
                 width: UM.Theme.getSize("stage_menu").height
+                border.color: UM.Theme.getColor("lining")
+                border.width: UM.Theme.getSize("default_lining").width
 
                 radius: UM.Theme.getSize("default_radius").width
                 color: openFileButton.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
             }
-
-            DropShadow
-            {
-                id: shadow
-                // Don't blur the shadow
-                radius: 0
-                anchors.fill: background
-                source: background
-                verticalOffset: 2
-                visible: true
-                color: UM.Theme.getColor("action_button_shadow")
-                // Should always be drawn behind the background.
-                z: background.z - 1
-            }
         }
     }
 }

+ 3 - 19
plugins/PreviewStage/PreviewMenu.qml

@@ -35,6 +35,9 @@ Item
         anchors.horizontalCenter: parent.horizontalCenter
         width: parent.width - 2 * UM.Theme.getSize("wide_margin").width
         height: parent.height
+        // This is a trick to make sure that the borders of the two adjacent buttons' borders overlap. Otherwise
+        // there will be double border (one from each button)
+        spacing: -UM.Theme.getSize("default_lining").width
 
         Cura.ViewsSelector
         {
@@ -44,17 +47,6 @@ Item
             headerCornerSide: Cura.RoundedRectangle.Direction.Left
         }
 
-        // 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")
-        }
-
         // This component will grow freely up to complete the width of the row.
         Loader
         {
@@ -64,14 +56,6 @@ Item
             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")
-        }
-
         Item
         {
             id: printSetupSelectorItem

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

@@ -50,7 +50,7 @@ Item
                 id: buildplateIcon
                 anchors.centerIn: parent
                 color: UM.Theme.getColor("monitor_icon_primary")
-                height: parent.height
+                height: UM.Theme.getSize("medium_button_icon").width
                 source: "../svg/icons/Buildplate.svg"
                 width: height
                 visible: buildplate

+ 6 - 22
plugins/UM3NetworkPrinting/resources/qml/MonitorExtruderConfiguration.qml

@@ -37,6 +37,7 @@ Item
     {
         id: extruderIcon
         color: UM.Theme.getColor("monitor_skeleton_loading")
+        size: UM.Theme.getSize("button_icon").width
         position: 0
     }
 
@@ -46,16 +47,18 @@ Item
         anchors
         {
             left: extruderIcon.right
-            leftMargin: 12 * screenScaleFactor // TODO: Theme!
+            leftMargin: UM.Theme.getSize("default_margin").width
+            verticalCenter: extruderIcon.verticalCenter
         }
         color: materialLabel.visible > 0 ? "transparent" : UM.Theme.getColor("monitor_skeleton_loading")
-        height: 18 * screenScaleFactor // TODO: Theme!
+        height: childrenRect.height
         width: Math.max(materialLabel.contentWidth, 60 * screenScaleFactor) // TODO: Theme!
         radius: 2 * screenScaleFactor // TODO: Theme!
 
         Label
         {
             id: materialLabel
+            anchors.top: parent.top
 
             color: UM.Theme.getColor("text")
             elide: Text.ElideRight
@@ -63,29 +66,13 @@ Item
             text: ""
             visible: text !== ""
 
-            // FIXED-LINE-HEIGHT:
-            height: parent.height
-            verticalAlignment: Text.AlignVCenter
             renderType: Text.NativeRendering
         }
-    }
-
-    Rectangle
-    {
-        id: printCoreLabelWrapper
-        anchors
-        {
-            left: materialLabelWrapper.left
-            bottom: parent.bottom
-        }
-        color: printCoreLabel.visible > 0 ? "transparent" : UM.Theme.getColor("monitor_skeleton_loading")
-        height: 18 * screenScaleFactor // TODO: Theme!
-        width: Math.max(printCoreLabel.contentWidth, 36 * screenScaleFactor) // TODO: Theme!
-        radius: 2 * screenScaleFactor // TODO: Theme!
 
         Label
         {
             id: printCoreLabel
+            anchors.top: materialLabel.bottom
 
             color: UM.Theme.getColor("text")
             elide: Text.ElideRight
@@ -93,9 +80,6 @@ Item
             text: ""
             visible: text !== ""
 
-            // FIXED-LINE-HEIGHT:
-            height: parent.height
-            verticalAlignment: Text.AlignVCenter
             renderType: Text.NativeRendering
         }
     }

+ 1 - 2
plugins/UM3NetworkPrinting/resources/qml/MonitorIconExtruder.qml

@@ -38,6 +38,7 @@ Item
     Label
     {
         id: positionLabel
+        anchors.centerIn: icon
         font: UM.Theme.getFont("small")
         color: UM.Theme.getColor("text")
         height: Math.round(size / 2)
@@ -45,8 +46,6 @@ Item
         text: position + 1
         verticalAlignment: Text.AlignVCenter
         width: Math.round(size / 2)
-        x: Math.round(size * 0.25)
-        y: Math.round(size * 0.15625)
         visible: position >= 0
         renderType: Text.NativeRendering
     }

BIN
resources/images/whats_new/0.png


BIN
resources/images/whats_new/2.png


BIN
resources/images/whats_new/3.PNG


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