Merge branch 'fix_layerview_small_windows' of https://github.com/fieldOfView/Cura

This commit is contained in:
Jaime van Kessel 2017-06-23 15:11:57 +02:00
commit 78141cf330
2 changed files with 16 additions and 3 deletions

View file

@ -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

View file

@ -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;