diff options
Diffstat (limited to 'scene/gui/item_list.cpp')
-rw-r--r-- | scene/gui/item_list.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 34533375b2..b30a6000ff 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -339,7 +339,7 @@ void ItemList::set_same_column_width(bool p_enable) { update(); shape_changed = true; } -int ItemList::is_same_column_width() const { +bool ItemList::is_same_column_width() const { return same_column_width; } @@ -736,10 +736,10 @@ void ItemList::_notification(int p_what) { Ref<StyleBox> bg = get_stylebox("bg"); int mw = scroll_bar->get_minimum_size().x; - scroll_bar->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, mw + bg->get_margin(MARGIN_RIGHT)); - scroll_bar->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, bg->get_margin(MARGIN_RIGHT)); + scroll_bar->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, -mw + bg->get_margin(MARGIN_RIGHT)); + scroll_bar->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -bg->get_margin(MARGIN_RIGHT)); scroll_bar->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, bg->get_margin(MARGIN_TOP)); - scroll_bar->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, bg->get_margin(MARGIN_BOTTOM)); + scroll_bar->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, -bg->get_margin(MARGIN_BOTTOM)); Size2 size = get_size(); @@ -1277,14 +1277,14 @@ bool ItemList::has_auto_height() const { void ItemList::_bind_methods() { - ClassDB::bind_method(D_METHOD("add_item", "text", "icon:Texture", "selectable"), &ItemList::add_item, DEFVAL(Variant()), DEFVAL(true)); - ClassDB::bind_method(D_METHOD("add_icon_item", "icon:Texture", "selectable"), &ItemList::add_icon_item, DEFVAL(true)); + ClassDB::bind_method(D_METHOD("add_item", "text", "icon", "selectable"), &ItemList::add_item, DEFVAL(Variant()), DEFVAL(true)); + ClassDB::bind_method(D_METHOD("add_icon_item", "icon", "selectable"), &ItemList::add_icon_item, DEFVAL(true)); ClassDB::bind_method(D_METHOD("set_item_text", "idx", "text"), &ItemList::set_item_text); ClassDB::bind_method(D_METHOD("get_item_text", "idx"), &ItemList::get_item_text); - ClassDB::bind_method(D_METHOD("set_item_icon", "idx", "icon:Texture"), &ItemList::set_item_icon); - ClassDB::bind_method(D_METHOD("get_item_icon:Texture", "idx"), &ItemList::get_item_icon); + ClassDB::bind_method(D_METHOD("set_item_icon", "idx", "icon"), &ItemList::set_item_icon); + ClassDB::bind_method(D_METHOD("get_item_icon", "idx"), &ItemList::get_item_icon); ClassDB::bind_method(D_METHOD("set_item_icon_region", "idx", "rect"), &ItemList::set_item_icon_region); ClassDB::bind_method(D_METHOD("get_item_icon_region", "idx"), &ItemList::get_item_icon_region); @@ -1296,7 +1296,7 @@ void ItemList::_bind_methods() { ClassDB::bind_method(D_METHOD("is_item_disabled", "idx"), &ItemList::is_item_disabled); ClassDB::bind_method(D_METHOD("set_item_metadata", "idx", "metadata"), &ItemList::set_item_metadata); - ClassDB::bind_method(D_METHOD("get_item_metadata:Variant", "idx"), &ItemList::get_item_metadata); + ClassDB::bind_method(D_METHOD("get_item_metadata", "idx"), &ItemList::get_item_metadata); ClassDB::bind_method(D_METHOD("set_item_custom_bg_color", "idx", "custom_bg_color"), &ItemList::set_item_custom_bg_color); ClassDB::bind_method(D_METHOD("get_item_custom_bg_color", "idx"), &ItemList::get_item_custom_bg_color); @@ -1352,7 +1352,7 @@ void ItemList::_bind_methods() { ClassDB::bind_method(D_METHOD("ensure_current_is_visible"), &ItemList::ensure_current_is_visible); - ClassDB::bind_method(D_METHOD("get_v_scroll:VScrollBar"), &ItemList::get_v_scroll); + ClassDB::bind_method(D_METHOD("get_v_scroll"), &ItemList::get_v_scroll); ClassDB::bind_method(D_METHOD("_scroll_changed"), &ItemList::_scroll_changed); ClassDB::bind_method(D_METHOD("_gui_input"), &ItemList::_gui_input); |