Browse Source

Fix height of expandable component adapting to contents

Since the children don't adjust their height based on if they are visible (which would cause a binding loop) we just need to adjust the height of the total menu based on which children are visible. Easy enough.

Contributes to issue CURA-5876.
Ghostkeeper 6 years ago
parent
commit
dfe55b8f23
1 changed files with 13 additions and 1 deletions
  1. 13 1
      resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml

+ 13 - 1
resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml

@@ -139,7 +139,19 @@ Cura.ExpandableComponent
         Item
         {
             width: parent.width
-            height: childrenRect.height
+            height:
+            {
+                var height = 0;
+                if(autoConfiguration.visible)
+                {
+                    height += autoConfiguration.height;
+                }
+                if(customConfiguration.visible)
+                {
+                    height += customConfiguration.height;
+                }
+                return height;
+            }
             AutoConfiguration
             {
                 id: autoConfiguration