diff options
Diffstat (limited to 'scene/gui/tab_bar.cpp')
-rw-r--r-- | scene/gui/tab_bar.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/gui/tab_bar.cpp b/scene/gui/tab_bar.cpp index dd410e2472..3d88c117e7 100644 --- a/scene/gui/tab_bar.cpp +++ b/scene/gui/tab_bar.cpp @@ -50,7 +50,7 @@ Size2 TabBar::get_minimum_size() const { Ref<Texture2D> tex = tabs[i].icon; if (tex.is_valid()) { ms.height = MAX(ms.height, tex->get_size().height); - if (tabs[i].text != "") { + if (!tabs[i].text.is_empty()) { ms.width += get_theme_constant(SNAME("hseparation")); } } @@ -270,7 +270,7 @@ void TabBar::_shape(int p_tab) { tabs.write[p_tab].text_buf->set_direction((TextServer::Direction)tabs[p_tab].text_direction); } - tabs.write[p_tab].text_buf->add_string(tabs.write[p_tab].xl_text, font, font_size, tabs[p_tab].opentype_features, (tabs[p_tab].language != "") ? tabs[p_tab].language : TranslationServer::get_singleton()->get_tool_locale()); + tabs.write[p_tab].text_buf->add_string(tabs.write[p_tab].xl_text, font, font_size, tabs[p_tab].opentype_features, !tabs[p_tab].language.is_empty() ? tabs[p_tab].language : TranslationServer::get_singleton()->get_tool_locale()); } void TabBar::_notification(int p_what) { @@ -385,7 +385,7 @@ void TabBar::_notification(int p_what) { } else { icon->draw(ci, Point2i(w, sb->get_margin(SIDE_TOP) + ((sb_rect.size.y - sb_ms.y) - icon->get_height()) / 2)); } - if (tabs[i].text != "") { + if (!tabs[i].text.is_empty()) { w += icon->get_width() + get_theme_constant(SNAME("hseparation")); } } @@ -980,7 +980,7 @@ int TabBar::get_tab_width(int p_idx) const { Ref<Texture2D> tex = tabs[p_idx].icon; if (tex.is_valid()) { x += tex->get_width(); - if (tabs[p_idx].text != "") { + if (!tabs[p_idx].text.is_empty()) { x += get_theme_constant(SNAME("hseparation")); } } |