Merge pull request #661 from adolson/add-tab-binding
couple tab and tab container fixes
This commit is contained in:
commit
326fd93e1d
@ -113,7 +113,7 @@ void TabContainer::_input_event(const InputEvent& p_event) {
|
||||
break;
|
||||
}
|
||||
|
||||
String s = c->has_meta("_tab_title")?String(XL_MESSAGE(String(c->get_meta("_tab_title")))):String(c->get_name());
|
||||
String s = c->has_meta("_tab_name")?String(XL_MESSAGE(String(c->get_meta("_tab_name")))):String(c->get_name());
|
||||
int tab_width=font->get_string_size(s).width;
|
||||
|
||||
if (c->has_meta("_tab_icon")) {
|
||||
@ -220,7 +220,7 @@ void TabContainer::_notification(int p_what) {
|
||||
continue;
|
||||
|
||||
|
||||
String s = c->has_meta("_tab_title")?String(XL_MESSAGE(String(c->get_meta("_tab_title")))):String(c->get_name());
|
||||
String s = c->has_meta("_tab_name")?String(XL_MESSAGE(String(c->get_meta("_tab_name")))):String(c->get_name());
|
||||
w+=font->get_string_size(s).width;
|
||||
if (c->has_meta("_tab_icon")) {
|
||||
Ref<Texture> icon = c->get_meta("_tab_icon");
|
||||
@ -284,7 +284,7 @@ void TabContainer::_notification(int p_what) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String s = c->has_meta("_tab_title")?String(c->get_meta("_tab_title")):String(c->get_name());
|
||||
String s = c->has_meta("_tab_name")?String(c->get_meta("_tab_name")):String(c->get_name());
|
||||
int w=font->get_string_size(s).width;
|
||||
Ref<Texture> icon;
|
||||
if (c->has_meta("_tab_icon")) {
|
||||
|
@ -278,7 +278,8 @@ void Tabs::_bind_methods() {
|
||||
ObjectTypeDB::bind_method(_MD("get_tab_title","tab_idx"),&Tabs::get_tab_title);
|
||||
ObjectTypeDB::bind_method(_MD("set_tab_icon","tab_idx","icon:Texture"),&Tabs::set_tab_icon);
|
||||
ObjectTypeDB::bind_method(_MD("get_tab_icon:Texture","tab_idx"),&Tabs::get_tab_icon);
|
||||
ObjectTypeDB::bind_method(_MD("remove_tab","tab_idx","icon:Texture"),&Tabs::remove_tab);
|
||||
ObjectTypeDB::bind_method(_MD("remove_tab","tab_idx"),&Tabs::remove_tab);
|
||||
ObjectTypeDB::bind_method(_MD("add_tab","title","icon:Texture"),&Tabs::add_tab);
|
||||
|
||||
ADD_SIGNAL(MethodInfo("tab_changed",PropertyInfo(Variant::INT,"tab")));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user