From c6c09a83271d368e68afec1ce106b246b770f1f4 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 24 Dec 2018 16:16:23 +0100 Subject: [PATCH] Limit height of settings drop-down to window size It seems to be very hard to limit it to not overlap with the action panel. Well, going out of the window is a bigger problem so at least we can fix that. Contributes to issue CURA-6054. --- .../qml/PrintSetupSelector/PrintSetupSelectorContents.qml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml b/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml index 52c2807b81..35c5f008b6 100644 --- a/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml +++ b/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml @@ -165,6 +165,14 @@ Item { h = 200 * screenScaleFactor; } + + //Absolute mouse Y position in the window, to prevent it from going outside the window. + var mouse_absolute_y = mapToGlobal(mouseX, mouseY).y - UM.Preferences.getValue("general/window_top"); + if(mouse_absolute_y > base.height) + { + h -= mouse_absolute_y - base.height; + } + UM.Preferences.setValue("view/settings_list_height", h); } }