Browse Source

Fix RadioCheckbars layout getting out of wack sometimes

CURA-6598
Jaime van Kessel 5 years ago
parent
commit
c80cd9679f

+ 6 - 1
resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml

@@ -78,7 +78,7 @@ Item
                     left: parent.left
                     right: parent.right
                 }
-                height: childrenRect.height
+                height: intentCategoryLabel.height
 
                 Label
                 {
@@ -110,6 +110,11 @@ Item
                             // When user created profile is active, no quality tickbox should be active.
                             return false
                         }
+
+                        if(modelItem === null)
+                        {
+                            return false
+                        }
                         return Cura.MachineManager.activeQualityType == modelItem.quality_type && Cura.MachineManager.activeIntentCategory == modelItem.intent_category
                     }
 

+ 2 - 1
resources/qml/RadioCheckbar.qml

@@ -57,10 +57,11 @@ Item
             Item
             {
                 Layout.fillWidth: true
+                Layout.fillHeight: true
                 // The last item of the repeater needs to be shorter, as we don't need another part to fit
                 // the horizontal bar. The others should essentially not be limited.
                 Layout.maximumWidth: index + 1 === repeater.count ? activeComponent.width: 200000000
-                height: activeComponent.height
+
                 property bool isEnabled: model.available
                 // The horizontal bar between the checkable options.
                 // Note that the horizontal bar points towards the previous item.