diff --git a/plugins/LayerView/LayerView.qml b/plugins/LayerView/LayerView.qml index 9dc038fe70..46268a784d 100755 --- a/plugins/LayerView/LayerView.qml +++ b/plugins/LayerView/LayerView.qml @@ -11,6 +11,7 @@ import Cura 1.0 as Cura Item { + id: base width: { if (UM.LayerView.compatibilityMode) { return UM.Theme.getSize("layerview_menu_size_compatibility").width; @@ -25,8 +26,12 @@ Item return UM.Theme.getSize("layerview_menu_size").height + UM.LayerView.extruderCount * (UM.Theme.getSize("layerview_row").height + UM.Theme.getSize("layerview_row_spacing").height) } } + property var buttonTarget: { + var force_binding = parent.y; // ensure this gets reevaluated when the panel moves + return base.mapFromItem(parent.parent, parent.buttonTarget.x, parent.buttonTarget.y); + } - Rectangle { + UM.PointingRectangle { id: layerViewMenu anchors.left: parent.left anchors.top: parent.top @@ -35,6 +40,9 @@ Item z: slider.z - 1 color: UM.Theme.getColor("tool_panel_background") + target: parent.buttonTarget + arrowSize: UM.Theme.getSize("default_arrow").width + ColumnLayout { id: view_settings diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 3addb72bed..612ef6b41b 100755 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -306,9 +306,14 @@ 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 // panel is always anchored to the bottom only, because dynamically switching between bottom and top results in stretching the height + 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 + + property var buttonTarget: Qt.point(viewModeButton.x + viewModeButton.width / 2, viewModeButton.y + viewModeButton.height / 2) height: childrenRect.height;