Browse Source

Replace shadow with border in headerbar in simulation view

CURA-8202
Konstantinos Karmas 3 years ago
parent
commit
bf40ccc3f2

+ 6 - 19
plugins/PreviewStage/PreviewMenu.qml

@@ -35,26 +35,21 @@ 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
         {
             id: viewsSelector
             height: parent.height
             width: UM.Theme.getSize("views_selector").width
+            headerBackgroundBorder.width: UM.Theme.getSize("default_lining").width
+            headerBackgroundBorder.color: UM.Theme.getColor("lining")
+            enableHeaderShadow: false
             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 +59,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

+ 3 - 0
plugins/SimulationView/SimulationViewMenuComponent.qml

@@ -16,6 +16,9 @@ Cura.ExpandableComponent
     id: base
 
     dragPreferencesNamePrefix: "view/colorscheme"
+    headerBackgroundBorder.width: UM.Theme.getSize("default_lining").width
+    headerBackgroundBorder.color: UM.Theme.getColor("lining")
+    enableHeaderShadow: false
 
     contentHeaderTitle: catalog.i18nc("@label", "Color scheme")