Browse Source

Make layerview panel hug the bottom of small windows

Fixes https://github.com/Ultimaker/Cura/issues/2013
fieldOfView 7 years ago
parent
commit
29e152582f
1 changed files with 5 additions and 2 deletions
  1. 5 2
      resources/qml/Cura.qml

+ 5 - 2
resources/qml/Cura.qml

@@ -306,9 +306,12 @@ UM.MainWindow
             {
                 id: view_panel
 
-                anchors.top: viewModeButton.bottom
-                anchors.topMargin: UM.Theme.getSize("default_margin").height;
+                property bool hugBottom: parent.height < viewModeButton.y + viewModeButton.height + height + UM.Theme.getSize("default_margin").height
+
+                anchors.bottom: parent.bottom
+                anchors.bottomMargin: hugBottom ? 0 : parent.height - (viewModeButton.y + viewModeButton.height + height + UM.Theme.getSize("default_margin").height)
                 anchors.left: viewModeButton.left;
+                anchors.leftMargin: hugBottom ? viewModeButton.width + UM.Theme.getSize("default_margin").width : 0
 
                 height: childrenRect.height;