Fix theming code in Panel, SplitContainer, RichTextLabel

This commit is contained in:
Yuri Sizov 2022-09-06 20:48:58 +03:00
parent 43f03e2ce6
commit 39ef611a7d
4 changed files with 3 additions and 8 deletions

View File

@ -15,7 +15,5 @@
<theme_item name="panel" data_type="style" type="StyleBox">
The style of this [Panel].
</theme_item>
<theme_item name="panel_fg" data_type="style" type="StyleBox">
</theme_item>
</theme_items>
</class>

View File

@ -1693,7 +1693,6 @@ void RichTextLabel::_update_theme_item_cache() {
theme_cache.shadow_offset_x = get_theme_constant(SNAME("shadow_offset_x"));
theme_cache.shadow_offset_y = get_theme_constant(SNAME("shadow_offset_y"));
theme_cache.outline_size = get_theme_constant(SNAME("outline_size"));
theme_cache.outline_color = get_theme_color(SNAME("outline_color"));
theme_cache.bold_font = get_theme_font(SNAME("bold_font"));
theme_cache.bold_font_size = get_theme_font_size(SNAME("bold_font_size"));
@ -3941,7 +3940,7 @@ void RichTextLabel::append_text(const String &p_bbcode) {
int fs = theme_cache.normal_font_size * 3;
Ref<Font> f = theme_cache.normal_font;
Color color = theme_cache.default_color;
Color outline_color = theme_cache.outline_color;
Color outline_color = theme_cache.font_outline_color;
int outline_size = theme_cache.outline_size;
Rect2 dropcap_margins = Rect2();

View File

@ -82,9 +82,8 @@ void SplitContainer::_compute_middle_sep(bool p_clamp) {
int ms_second = second->get_combined_minimum_size()[axis];
// Determine the separation between items.
Ref<Texture2D> g = get_theme_icon(SNAME("grabber"));
int sep = get_theme_constant(SNAME("separation"));
sep = (dragger_visibility != DRAGGER_HIDDEN_COLLAPSED) ? MAX(sep, vertical ? g->get_height() : g->get_width()) : 0;
Ref<Texture2D> g = _get_grabber_icon();
int sep = (dragger_visibility != DRAGGER_HIDDEN_COLLAPSED) ? MAX(theme_cache.separation, vertical ? g->get_height() : g->get_width()) : 0;
// Compute the wished separation_point.
int wished_middle_sep = 0;

View File

@ -139,7 +139,6 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
// Panel
theme->set_stylebox("panel", "Panel", make_flat_stylebox(style_normal_color, 0, 0, 0, 0));
theme->set_stylebox("panel_fg", "Panel", make_flat_stylebox(style_normal_color, 0, 0, 0, 0));
// Button