1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-01 16:38:31 +00:00

Popups are now windows also (broken!)

This commit is contained in:
Juan Linietsky
2020-03-12 09:37:40 -03:00
parent 543fb1c4da
commit 441f1a5fe9
159 changed files with 3311 additions and 3285 deletions

View File

@@ -76,15 +76,15 @@ void GradientEdit::_show_color_picker() {
if (grabbed == -1)
return;
picker->set_pick_color(points[grabbed].color);
Size2 minsize = popup->get_combined_minimum_size();
Size2 minsize = popup->get_contents_minimum_size();
bool show_above = false;
if (get_global_position().y + get_size().y + minsize.y > get_viewport_rect().size.y) {
show_above = true;
}
if (show_above) {
popup->set_position(get_global_position() - Vector2(0, minsize.y));
popup->set_position(get_screen_position() - Vector2(0, minsize.y));
} else {
popup->set_position(get_global_position() + Vector2(0, get_size().y));
popup->set_position(get_screen_position() + Vector2(0, get_size().y));
}
popup->popup();
}