summaryrefslogtreecommitdiff
path: root/scene/gui/tabs.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-02-14 13:49:14 +0100
committerGitHub <noreply@github.com>2021-02-14 13:49:14 +0100
commitcdfd3ffe15dbf6f41bdade308d69a75f3d4eb3a7 (patch)
treec99de3fd861139b3b18073605b2ee97f783f0329 /scene/gui/tabs.cpp
parent6fb1ed2bca09e88509608a761b0ce300dd997c19 (diff)
parent1f60ac1e08ddec42e416b9fad6ed646999857b59 (diff)
Merge pull request #44747 from bruvzg/missing_outlines
[CTL] Add missing theme properties for outlines, fix underline scaling, and RTL cell padding.
Diffstat (limited to 'scene/gui/tabs.cpp')
-rw-r--r--scene/gui/tabs.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp
index 66f04e5569..da1a9698d0 100644
--- a/scene/gui/tabs.cpp
+++ b/scene/gui/tabs.cpp
@@ -275,6 +275,9 @@ void Tabs::_notification(int p_what) {
Color font_unselected_color = get_theme_color("font_unselected_color");
Color font_disabled_color = get_theme_color("font_disabled_color");
Ref<Texture2D> close = get_theme_icon("close");
+ Color font_outline_color = get_theme_color("font_outline_color");
+ int outline_size = get_theme_constant("outline_size");
+
Vector2 size = get_size();
bool rtl = is_layout_rtl();
@@ -357,9 +360,17 @@ void Tabs::_notification(int p_what) {
}
if (rtl) {
- tabs[i].text_buf->draw(ci, Point2i(size.width - w - tabs[i].text_buf->get_size().x, sb->get_margin(SIDE_TOP) + ((sb_rect.size.y - sb_ms.y) - tabs[i].text_buf->get_size().y) / 2), col);
+ Vector2 text_pos = Point2i(size.width - w - tabs[i].text_buf->get_size().x, sb->get_margin(SIDE_TOP) + ((sb_rect.size.y - sb_ms.y) - tabs[i].text_buf->get_size().y) / 2);
+ if (outline_size > 0 && font_outline_color.a > 0) {
+ tabs[i].text_buf->draw_outline(ci, text_pos, outline_size, font_outline_color);
+ }
+ tabs[i].text_buf->draw(ci, text_pos, col);
} else {
- tabs[i].text_buf->draw(ci, Point2i(w, sb->get_margin(SIDE_TOP) + ((sb_rect.size.y - sb_ms.y) - tabs[i].text_buf->get_size().y) / 2), col);
+ Vector2 text_pos = Point2i(w, sb->get_margin(SIDE_TOP) + ((sb_rect.size.y - sb_ms.y) - tabs[i].text_buf->get_size().y) / 2);
+ if (outline_size > 0 && font_outline_color.a > 0) {
+ tabs[i].text_buf->draw_outline(ci, text_pos, outline_size, font_outline_color);
+ }
+ tabs[i].text_buf->draw(ci, text_pos, col);
}
w += tabs[i].size_text;