summaryrefslogtreecommitdiff
path: root/scene/gui/item_list.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/item_list.cpp')
-rw-r--r--scene/gui/item_list.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp
index 197e474fd6..3b3d7164b6 100644
--- a/scene/gui/item_list.cpp
+++ b/scene/gui/item_list.cpp
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "item_list.h"
#include "os/os.h"
#include "project_settings.h"
@@ -930,6 +931,9 @@ void ItemList::_notification(int p_what) {
scroll_bar->hide();
} else {
scroll_bar->show();
+
+ if (do_autoscroll_to_bottom)
+ scroll_bar->set_value(max);
}
break;
}
@@ -1313,6 +1317,11 @@ Size2 ItemList::get_minimum_size() const {
return Size2();
}
+void ItemList::set_autoscroll_to_bottom(const bool p_enable) {
+
+ do_autoscroll_to_bottom = p_enable;
+}
+
void ItemList::set_auto_height(bool p_enable) {
auto_height = p_enable;
@@ -1466,6 +1475,7 @@ ItemList::ItemList() {
ensure_selected_visible = false;
defer_select_single = -1;
allow_rmb_select = false;
+ do_autoscroll_to_bottom = false;
icon_scale = 1.0f;
set_clip_contents(true);