Browse Source

Allow text to be wider if favourite button is not shown

It can take the space of the favourite button then.
Ghostkeeper 2 years ago
parent
commit
eee3a06743
1 changed files with 3 additions and 3 deletions
  1. 3 3
      resources/qml/Preferences/Materials/MaterialsSlot.qml

+ 3 - 3
resources/qml/Preferences/Materials/MaterialsSlot.qml

@@ -47,7 +47,7 @@ Rectangle
         radius: width / 2
         anchors.verticalCenter: materialSlot.verticalCenter
         anchors.left: materialSlot.left
-        anchors.leftMargin: 2 * UM.Theme.getSize("default_margin").width
+        anchors.leftMargin: UM.Theme.getSize("default_margin").width
     }
     UM.Label
     {
@@ -58,7 +58,7 @@ Rectangle
         wrapMode: Text.NoWrap
         verticalAlignment: Text.AlignVCenter
         anchors.left: swatch.right
-        anchors.right: favoriteButton.left
+        anchors.right: favoriteButton.visible ? favoriteButton.left : parent.right
         anchors.leftMargin: UM.Theme.getSize("default_margin").width
         anchors.rightMargin: UM.Theme.getSize("narrow_margin").width
         anchors.verticalCenter: materialSlot.verticalCenter
@@ -102,7 +102,7 @@ Rectangle
         ]
 
         implicitHeight: parent.height
-        implicitWidth: height
+        implicitWidth: favoriteIndicator.width
         anchors.right: materialSlot.right
         visible: false