Browse Source

Simplify the main_window_header_tab style

Jaime van Kessel 6 years ago
parent
commit
dc66bdacc6
1 changed files with 16 additions and 18 deletions
  1. 16 18
      resources/themes/cura-light/styles.qml

+ 16 - 18
resources/themes/cura-light/styles.qml

@@ -103,33 +103,29 @@ QtObject
             // This property will be back-propagated when the width of the label is calculated
             property var buttonWidth: 0
 
-            background: Item
+            background: Rectangle
             {
+                id: backgroundRectangle
                 implicitHeight: control.height
                 implicitWidth: buttonWidth
-                Rectangle
-                {
-                    id: buttonFace
-                    implicitHeight: parent.height
-                    implicitWidth: parent.width
-                    radius: UM.Theme.getSize("action_button_radius").width
+                radius: UM.Theme.getSize("action_button_radius").width
 
-                    color:
+                color:
+                {
+                    if (control.checked)
                     {
-                        if (control.checked)
-                        {
-                            return UM.Theme.getColor("main_window_header_button_background_active")
-                        }
-                        else
+                        return UM.Theme.getColor("main_window_header_button_background_active")
+                    }
+                    else
+                    {
+                        if (control.hovered)
                         {
-                            if (control.hovered)
-                            {
-                                return UM.Theme.getColor("main_window_header_button_background_hovered")
-                            }
-                            return UM.Theme.getColor("main_window_header_button_background_inactive")
+                            return UM.Theme.getColor("main_window_header_button_background_hovered")
                         }
+                        return UM.Theme.getColor("main_window_header_button_background_inactive")
                     }
                 }
+
             }
 
             label: Item
@@ -168,6 +164,8 @@ QtObject
                     buttonWidth = width
                 }
             }
+
+
         }
     }