summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-02-19 23:19:30 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-02-19 23:21:35 -0300
commitf6950956bdab064cc1e027b93a0ddd0d94dda882 (patch)
tree595f634ffbd8d5419c82500971e5c3ce2308d229 /scene
parent5e3fc7d06956dcda8b50cd4f028c83cf967f7223 (diff)
Editor Export Settings Dialog is completed!! Now on to make some exporters..
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/dialogs.cpp4
-rw-r--r--scene/gui/item_list.cpp16
-rw-r--r--scene/gui/item_list.h1
3 files changed, 19 insertions, 2 deletions
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<AcceptDialog*>(this)->get_close_button())
+ if (c==hbc || c==label || c==const_cast<AcceptDialog*>(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<StyleBox> 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;