From f6950956bdab064cc1e027b93a0ddd0d94dda882 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 19 Feb 2017 23:19:30 -0300 Subject: Editor Export Settings Dialog is completed!! Now on to make some exporters.. --- scene/gui/dialogs.cpp | 4 ++-- scene/gui/item_list.cpp | 16 ++++++++++++++++ scene/gui/item_list.h | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) (limited to 'scene') diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index 2f97ce2d51..72d3f0e8f8 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -272,7 +272,7 @@ void AcceptDialog::_update_child_rects() { if (!c) continue; - if (c==hbc || c==label || c==get_close_button()) + if (c==hbc || c==label || c==get_close_button() || c->is_set_as_toplevel()) continue; c->set_pos(cpos); @@ -299,7 +299,7 @@ Size2 AcceptDialog::get_minimum_size() const { if (!c) continue; - if (c==hbc || c==label || c==const_cast(this)->get_close_button()) + if (c==hbc || c==label || c==const_cast(this)->get_close_button() || c->is_set_as_toplevel()) continue; Size2 cminsize = c->get_combined_minimum_size(); diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 4e10f1d622..d16688407c 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -1204,6 +1204,22 @@ int ItemList::get_item_at_pos(const Point2& p_pos, bool p_exact) const { return closest; } +bool ItemList::is_pos_at_end_of_items(const Point2& p_pos) const { + + if (items.empty()) + return true; + + Vector2 pos=p_pos; + Ref bg = get_stylebox("bg"); + pos-=bg->get_offset(); + pos.y+=scroll_bar->get_value(); + + Rect2 endrect = items[items.size()-1].rect_cache; + return (pos.y > endrect.pos.y + endrect.size.y); + +} + + String ItemList::get_tooltip(const Point2& p_pos) const { int closest = get_item_at_pos(p_pos); diff --git a/scene/gui/item_list.h b/scene/gui/item_list.h index f4a864c782..35ffb1be9c 100644 --- a/scene/gui/item_list.h +++ b/scene/gui/item_list.h @@ -191,6 +191,7 @@ public: virtual String get_tooltip(const Point2& p_pos) const; int get_item_at_pos(const Point2& p_pos,bool p_exact=false) const; + bool is_pos_at_end_of_items(const Point2& p_pos) const; void set_icon_scale(real_t p_scale); real_t get_icon_scale() const; -- cgit v1.2.3