summaryrefslogtreecommitdiff
path: root/scene/gui/progress_bar.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/progress_bar.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/progress_bar.cpp')
-rw-r--r--scene/gui/progress_bar.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/scene/gui/progress_bar.cpp b/scene/gui/progress_bar.cpp
index 63174b2d7f..6e8dfd5994 100644
--- a/scene/gui/progress_bar.cpp
+++ b/scene/gui/progress_bar.cpp
@@ -74,7 +74,13 @@ void ProgressBar::_notification(int p_what) {
if (percent_visible) {
String txt = TS->format_number(itos(int(get_as_ratio() * 100))) + TS->percent_sign();
TextLine tl = TextLine(txt, font, font_size);
- tl.draw(get_canvas_item(), (Point2(get_size().width - tl.get_size().x, get_size().height - tl.get_size().y) / 2).round(), font_color);
+ Vector2 text_pos = (Point2(get_size().width - tl.get_size().x, get_size().height - tl.get_size().y) / 2).round();
+ Color font_outline_color = get_theme_color("font_outline_color");
+ int outline_size = get_theme_constant("outline_size");
+ if (outline_size > 0 && font_outline_color.a > 0) {
+ tl.draw_outline(get_canvas_item(), text_pos, outline_size, font_outline_color);
+ }
+ tl.draw(get_canvas_item(), text_pos, font_color);
}
}
}