mirror of
https://github.com/godotengine/godot.git
synced 2025-01-26 11:51:13 +00:00
Fix binding for ItemList.sort_items_by_text
Also forces to recompute the cached rect for all items. Fixes #5799
This commit is contained in:
parent
93c3c801db
commit
51b03f0bf5
@ -1211,8 +1211,11 @@ String ItemList::get_tooltip(const Point2& p_pos) const {
|
||||
}
|
||||
|
||||
void ItemList::sort_items_by_text() {
|
||||
|
||||
items.sort();
|
||||
update();
|
||||
shape_changed=true;
|
||||
|
||||
if (select_mode==SELECT_SINGLE) {
|
||||
for(int i=0;i<items.size();i++) {
|
||||
if (items[i].selected) {
|
||||
@ -1304,7 +1307,7 @@ void ItemList::_bind_methods(){
|
||||
ObjectTypeDB::bind_method(_MD("remove_item","idx"),&ItemList::remove_item);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("clear"),&ItemList::clear);
|
||||
ObjectTypeDB::bind_method(_MD("sort_items_by_text"),&ItemList::clear);
|
||||
ObjectTypeDB::bind_method(_MD("sort_items_by_text"),&ItemList::sort_items_by_text);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("set_fixed_column_width","width"),&ItemList::set_fixed_column_width);
|
||||
ObjectTypeDB::bind_method(_MD("get_fixed_column_width"),&ItemList::get_fixed_column_width);
|
||||
|
Loading…
Reference in New Issue
Block a user