summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/button.cpp38
-rw-r--r--scene/gui/file_dialog.cpp22
-rw-r--r--scene/gui/item_list.cpp4
-rw-r--r--scene/gui/label.cpp18
-rw-r--r--scene/gui/line_edit.cpp8
-rw-r--r--scene/gui/link_button.cpp8
-rw-r--r--scene/gui/option_button.cpp6
-rw-r--r--scene/gui/popup_menu.cpp16
-rw-r--r--scene/gui/rich_text_label.cpp16
-rw-r--r--scene/gui/rich_text_label.h2
-rw-r--r--scene/gui/tab_container.cpp42
-rw-r--r--scene/gui/tabs.cpp50
-rw-r--r--scene/gui/text_edit.cpp20
-rw-r--r--scene/gui/text_edit.h4
-rw-r--r--scene/gui/tree.cpp4
-rw-r--r--scene/gui/tree.h2
16 files changed, 130 insertions, 130 deletions
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp
index 119f3539e1..f7c9583fbf 100644
--- a/scene/gui/button.cpp
+++ b/scene/gui/button.cpp
@@ -102,8 +102,8 @@ void Button::_notification(int p_what) {
style->draw(ci, Rect2(Point2(0, 0), size));
}
color = get_theme_color("font_color");
- if (has_theme_color("icon_color_normal")) {
- color_icon = get_theme_color("icon_color_normal");
+ if (has_theme_color("icon_normal_color")) {
+ color_icon = get_theme_color("icon_normal_color");
}
} break;
case DRAW_HOVER_PRESSED: {
@@ -117,13 +117,13 @@ void Button::_notification(int p_what) {
if (!flat) {
style->draw(ci, Rect2(Point2(0, 0), size));
}
- if (has_theme_color("font_color_hover_pressed")) {
- color = get_theme_color("font_color_hover_pressed");
+ if (has_theme_color("font_hover_pressed_color")) {
+ color = get_theme_color("font_hover_pressed_color");
} else {
color = get_theme_color("font_color");
}
- if (has_theme_color("icon_color_hover_pressed")) {
- color_icon = get_theme_color("icon_color_hover_pressed");
+ if (has_theme_color("icon_hover_pressed_color")) {
+ color_icon = get_theme_color("icon_hover_pressed_color");
}
break;
@@ -140,13 +140,13 @@ void Button::_notification(int p_what) {
if (!flat) {
style->draw(ci, Rect2(Point2(0, 0), size));
}
- if (has_theme_color("font_color_pressed")) {
- color = get_theme_color("font_color_pressed");
+ if (has_theme_color("font_pressed_color")) {
+ color = get_theme_color("font_pressed_color");
} else {
color = get_theme_color("font_color");
}
- if (has_theme_color("icon_color_pressed")) {
- color_icon = get_theme_color("icon_color_pressed");
+ if (has_theme_color("icon_pressed_color")) {
+ color_icon = get_theme_color("icon_pressed_color");
}
} break;
@@ -160,9 +160,9 @@ void Button::_notification(int p_what) {
if (!flat) {
style->draw(ci, Rect2(Point2(0, 0), size));
}
- color = get_theme_color("font_color_hover");
- if (has_theme_color("icon_color_hover")) {
- color_icon = get_theme_color("icon_color_hover");
+ color = get_theme_color("font_hover_color");
+ if (has_theme_color("icon_hover_color")) {
+ color_icon = get_theme_color("icon_hover_color");
}
} break;
@@ -176,9 +176,9 @@ void Button::_notification(int p_what) {
if (!flat) {
style->draw(ci, Rect2(Point2(0, 0), size));
}
- color = get_theme_color("font_color_disabled");
- if (has_theme_color("icon_color_disabled")) {
- color_icon = get_theme_color("icon_color_disabled");
+ color = get_theme_color("font_disabled_color");
+ if (has_theme_color("icon_disabled_color")) {
+ color_icon = get_theme_color("icon_disabled_color");
}
} break;
@@ -303,10 +303,10 @@ void Button::_notification(int p_what) {
text_ofs.x -= icon_ofs.x;
}
- Color font_outline_modulate = get_theme_color("font_outline_modulate");
+ Color font_outline_color = get_theme_color("font_outline_color");
int outline_size = get_theme_constant("outline_size");
- if (outline_size > 0 && font_outline_modulate.a > 0) {
- text_buf->draw_outline(ci, text_ofs.floor(), outline_size, font_outline_modulate);
+ if (outline_size > 0 && font_outline_color.a > 0) {
+ text_buf->draw_outline(ci, text_ofs.floor(), outline_size, font_outline_color);
}
text_buf->draw(ci, text_ofs.floor(), color);
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index 5765d6b932..3a0350b9fb 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -50,20 +50,20 @@ VBoxContainer *FileDialog::get_vbox() {
void FileDialog::_theme_changed() {
Color font_color = vbox->get_theme_color("font_color", "Button");
- Color font_color_hover = vbox->get_theme_color("font_color_hover", "Button");
- Color font_color_pressed = vbox->get_theme_color("font_color_pressed", "Button");
+ Color font_hover_color = vbox->get_theme_color("font_hover_color", "Button");
+ Color font_pressed_color = vbox->get_theme_color("font_pressed_color", "Button");
- dir_up->add_theme_color_override("icon_color_normal", font_color);
- dir_up->add_theme_color_override("icon_color_hover", font_color_hover);
- dir_up->add_theme_color_override("icon_color_pressed", font_color_pressed);
+ dir_up->add_theme_color_override("icon_normal_color", font_color);
+ dir_up->add_theme_color_override("icon_hover_color", font_hover_color);
+ dir_up->add_theme_color_override("icon_pressed_color", font_pressed_color);
- refresh->add_theme_color_override("icon_color_normal", font_color);
- refresh->add_theme_color_override("icon_color_hover", font_color_hover);
- refresh->add_theme_color_override("icon_color_pressed", font_color_pressed);
+ refresh->add_theme_color_override("icon_normal_color", font_color);
+ refresh->add_theme_color_override("icon_hover_color", font_hover_color);
+ refresh->add_theme_color_override("icon_pressed_color", font_pressed_color);
- show_hidden->add_theme_color_override("icon_color_normal", font_color);
- show_hidden->add_theme_color_override("icon_color_hover", font_color_hover);
- show_hidden->add_theme_color_override("icon_color_pressed", font_color_pressed);
+ show_hidden->add_theme_color_override("icon_normal_color", font_color);
+ show_hidden->add_theme_color_override("icon_hover_color", font_hover_color);
+ show_hidden->add_theme_color_override("icon_pressed_color", font_pressed_color);
}
void FileDialog::_notification(int p_what) {
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp
index 03ce6bdd3d..799b0ed612 100644
--- a/scene/gui/item_list.cpp
+++ b/scene/gui/item_list.cpp
@@ -890,7 +890,7 @@ void ItemList::_notification(int p_what) {
Color guide_color = get_theme_color("guide_color");
Color font_color = get_theme_color("font_color");
- Color font_color_selected = get_theme_color("font_color_selected");
+ Color font_selected_color = get_theme_color("font_selected_color");
if (has_focus()) {
RenderingServer::get_singleton()->canvas_item_add_clip_ignore(get_canvas_item(), true);
@@ -1188,7 +1188,7 @@ void ItemList::_notification(int p_what) {
max_len = size2.x;
}
- Color modulate = items[i].selected ? font_color_selected : (items[i].custom_fg != Color() ? items[i].custom_fg : font_color);
+ Color modulate = items[i].selected ? font_selected_color : (items[i].custom_fg != Color() ? items[i].custom_fg : font_color);
if (items[i].disabled) {
modulate.a *= 0.5;
}
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp
index bd89fe441c..8fc40955f0 100644
--- a/scene/gui/label.cpp
+++ b/scene/gui/label.cpp
@@ -184,10 +184,10 @@ void Label::_notification(int p_what) {
Ref<StyleBox> style = get_theme_stylebox("normal");
Ref<Font> font = get_theme_font("font");
Color font_color = get_theme_color("font_color");
- Color font_color_shadow = get_theme_color("font_color_shadow");
+ Color font_shadow_color = get_theme_color("font_shadow_color");
Point2 shadow_ofs(get_theme_constant("shadow_offset_x"), get_theme_constant("shadow_offset_y"));
int line_spacing = get_theme_constant("line_spacing");
- Color font_outline_modulate = get_theme_color("font_outline_modulate");
+ Color font_outline_color = get_theme_color("font_outline_color");
int outline_size = get_theme_constant("outline_size");
int shadow_outline_size = get_theme_constant("shadow_outline_size");
bool rtl = is_layout_rtl();
@@ -298,17 +298,17 @@ void Label::_notification(int p_what) {
for (int j = 0; j < gl_size; j++) {
for (int k = 0; k < glyphs[j].repeat; k++) {
if (glyphs[j].font_rid != RID()) {
- if (font_color_shadow.a > 0) {
- TS->font_draw_glyph(glyphs[j].font_rid, ci, glyphs[j].font_size, ofs + Vector2(glyphs[j].x_off, glyphs[j].y_off) + shadow_ofs, glyphs[j].index, font_color_shadow);
+ if (font_shadow_color.a > 0) {
+ TS->font_draw_glyph(glyphs[j].font_rid, ci, glyphs[j].font_size, ofs + Vector2(glyphs[j].x_off, glyphs[j].y_off) + shadow_ofs, glyphs[j].index, font_shadow_color);
if (shadow_outline_size > 0) {
//draw shadow
- TS->font_draw_glyph_outline(glyphs[j].font_rid, ci, glyphs[j].font_size, shadow_outline_size, ofs + Vector2(glyphs[j].x_off, glyphs[j].y_off) + Vector2(-shadow_ofs.x, shadow_ofs.y), glyphs[j].index, font_color_shadow);
- TS->font_draw_glyph_outline(glyphs[j].font_rid, ci, glyphs[j].font_size, shadow_outline_size, ofs + Vector2(glyphs[j].x_off, glyphs[j].y_off) + Vector2(shadow_ofs.x, -shadow_ofs.y), glyphs[j].index, font_color_shadow);
- TS->font_draw_glyph_outline(glyphs[j].font_rid, ci, glyphs[j].font_size, shadow_outline_size, ofs + Vector2(glyphs[j].x_off, glyphs[j].y_off) + Vector2(-shadow_ofs.x, -shadow_ofs.y), glyphs[j].index, font_color_shadow);
+ TS->font_draw_glyph_outline(glyphs[j].font_rid, ci, glyphs[j].font_size, shadow_outline_size, ofs + Vector2(glyphs[j].x_off, glyphs[j].y_off) + Vector2(-shadow_ofs.x, shadow_ofs.y), glyphs[j].index, font_shadow_color);
+ TS->font_draw_glyph_outline(glyphs[j].font_rid, ci, glyphs[j].font_size, shadow_outline_size, ofs + Vector2(glyphs[j].x_off, glyphs[j].y_off) + Vector2(shadow_ofs.x, -shadow_ofs.y), glyphs[j].index, font_shadow_color);
+ TS->font_draw_glyph_outline(glyphs[j].font_rid, ci, glyphs[j].font_size, shadow_outline_size, ofs + Vector2(glyphs[j].x_off, glyphs[j].y_off) + Vector2(-shadow_ofs.x, -shadow_ofs.y), glyphs[j].index, font_shadow_color);
}
}
- if (font_outline_modulate.a != 0.0 && outline_size > 0) {
- TS->font_draw_glyph_outline(glyphs[j].font_rid, ci, glyphs[j].font_size, outline_size, ofs + Vector2(glyphs[j].x_off, glyphs[j].y_off), glyphs[j].index, font_outline_modulate);
+ if (font_outline_color.a != 0.0 && outline_size > 0) {
+ TS->font_draw_glyph_outline(glyphs[j].font_rid, ci, glyphs[j].font_size, outline_size, ofs + Vector2(glyphs[j].x_off, glyphs[j].y_off), glyphs[j].index, font_outline_color);
}
}
ofs.x += glyphs[j].advance;
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 5f0bb453f3..9691cab313 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -770,8 +770,8 @@ void LineEdit::_notification(int p_what) {
int y_ofs = style->get_offset().y + (y_area - text_height) / 2;
Color selection_color = get_theme_color("selection_color");
- Color font_color = is_editable() ? get_theme_color("font_color") : get_theme_color("font_color_uneditable");
- Color font_color_selected = get_theme_color("font_color_selected");
+ Color font_color = is_editable() ? get_theme_color("font_color") : get_theme_color("font_uneditable_color");
+ Color font_selected_color = get_theme_color("font_selected_color");
Color cursor_color = get_theme_color("cursor_color");
// Draw placeholder color.
@@ -839,9 +839,9 @@ void LineEdit::_notification(int p_what) {
for (int j = 0; j < glyphs[i].repeat; j++) {
if (ceil(ofs.x) >= x_ofs && (ofs.x + glyphs[i].advance) <= ofs_max) {
if (glyphs[i].font_rid != RID()) {
- TS->font_draw_glyph(glyphs[i].font_rid, ci, glyphs[i].font_size, ofs + Vector2(glyphs[i].x_off, glyphs[i].y_off), glyphs[i].index, selected ? font_color_selected : font_color);
+ TS->font_draw_glyph(glyphs[i].font_rid, ci, glyphs[i].font_size, ofs + Vector2(glyphs[i].x_off, glyphs[i].y_off), glyphs[i].index, selected ? font_selected_color : font_color);
} else if ((glyphs[i].flags & TextServer::GRAPHEME_IS_VIRTUAL) != TextServer::GRAPHEME_IS_VIRTUAL) {
- TS->draw_hex_code_box(ci, glyphs[i].font_size, ofs + Vector2(glyphs[i].x_off, glyphs[i].y_off), glyphs[i].index, selected ? font_color_selected : font_color);
+ TS->draw_hex_code_box(ci, glyphs[i].font_size, ofs + Vector2(glyphs[i].x_off, glyphs[i].y_off), glyphs[i].index, selected ? font_selected_color : font_color);
}
}
ofs.x += glyphs[i].advance;
diff --git a/scene/gui/link_button.cpp b/scene/gui/link_button.cpp
index 495529017a..8e972438a5 100644
--- a/scene/gui/link_button.cpp
+++ b/scene/gui/link_button.cpp
@@ -163,8 +163,8 @@ void LinkButton::_notification(int p_what) {
} break;
case DRAW_HOVER_PRESSED:
case DRAW_PRESSED: {
- if (has_theme_color("font_color_pressed")) {
- color = get_theme_color("font_color_pressed");
+ if (has_theme_color("font_pressed_color")) {
+ color = get_theme_color("font_pressed_color");
} else {
color = get_theme_color("font_color");
}
@@ -173,12 +173,12 @@ void LinkButton::_notification(int p_what) {
} break;
case DRAW_HOVER: {
- color = get_theme_color("font_color_hover");
+ color = get_theme_color("font_hover_color");
do_underline = underline_mode != UNDERLINE_MODE_NEVER;
} break;
case DRAW_DISABLED: {
- color = get_theme_color("font_color_disabled");
+ color = get_theme_color("font_disabled_color");
do_underline = underline_mode == UNDERLINE_MODE_ALWAYS;
} break;
diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp
index 4f274595a2..e4c1f94b31 100644
--- a/scene/gui/option_button.cpp
+++ b/scene/gui/option_button.cpp
@@ -62,13 +62,13 @@ void OptionButton::_notification(int p_what) {
if (get_theme_constant("modulate_arrow")) {
switch (get_draw_mode()) {
case DRAW_PRESSED:
- clr = get_theme_color("font_color_pressed");
+ clr = get_theme_color("font_pressed_color");
break;
case DRAW_HOVER:
- clr = get_theme_color("font_color_hover");
+ clr = get_theme_color("font_hover_color");
break;
case DRAW_DISABLED:
- clr = get_theme_color("font_color_disabled");
+ clr = get_theme_color("font_disabled_color");
break;
default:
clr = get_theme_color("font_color");
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index e777e6c26b..b2ebb91500 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -471,10 +471,10 @@ void PopupMenu::_draw_items() {
int vseparation = get_theme_constant("vseparation");
int hseparation = get_theme_constant("hseparation");
Color font_color = get_theme_color("font_color");
- Color font_color_disabled = get_theme_color("font_color_disabled");
- Color font_color_accel = get_theme_color("font_color_accel");
- Color font_color_hover = get_theme_color("font_color_hover");
- Color font_color_separator = get_theme_color("font_color_separator");
+ Color font_disabled_color = get_theme_color("font_disabled_color");
+ Color font_accelerator_color = get_theme_color("font_accelerator_color");
+ Color font_hover_color = get_theme_color("font_hover_color");
+ Color font_separator_color = get_theme_color("font_separator_color");
float scroll_width = scroll_container->get_v_scrollbar()->is_visible_in_tree() ? scroll_container->get_v_scrollbar()->get_size().width : 0;
float display_width = control->get_size().width - scroll_width;
@@ -575,14 +575,14 @@ void PopupMenu::_draw_items() {
if (items[i].separator) {
if (text != String()) {
int center = (display_width - items[i].text_buf->get_size().width) / 2;
- items[i].text_buf->draw(ci, Point2(center, item_ofs.y + Math::floor((h - items[i].text_buf->get_size().y) / 2.0)), font_color_separator);
+ items[i].text_buf->draw(ci, Point2(center, item_ofs.y + Math::floor((h - items[i].text_buf->get_size().y) / 2.0)), font_separator_color);
}
} else {
item_ofs.x += icon_ofs + check_ofs;
if (rtl) {
- items[i].text_buf->draw(ci, Size2(control->get_size().width - items[i].text_buf->get_size().width - item_ofs.x, item_ofs.y) + Point2(0, Math::floor((h - items[i].text_buf->get_size().y) / 2.0)), items[i].disabled ? font_color_disabled : (i == mouse_over ? font_color_hover : font_color));
+ items[i].text_buf->draw(ci, Size2(control->get_size().width - items[i].text_buf->get_size().width - item_ofs.x, item_ofs.y) + Point2(0, Math::floor((h - items[i].text_buf->get_size().y) / 2.0)), items[i].disabled ? font_disabled_color : (i == mouse_over ? font_hover_color : font_color));
} else {
- items[i].text_buf->draw(ci, item_ofs + Point2(0, Math::floor((h - items[i].text_buf->get_size().y) / 2.0)), items[i].disabled ? font_color_disabled : (i == mouse_over ? font_color_hover : font_color));
+ items[i].text_buf->draw(ci, item_ofs + Point2(0, Math::floor((h - items[i].text_buf->get_size().y) / 2.0)), items[i].disabled ? font_disabled_color : (i == mouse_over ? font_hover_color : font_color));
}
}
@@ -593,7 +593,7 @@ void PopupMenu::_draw_items() {
} else {
item_ofs.x = display_width - style->get_margin(SIDE_RIGHT) - items[i].accel_text_buf->get_size().x;
}
- items[i].accel_text_buf->draw(ci, item_ofs + Point2(0, Math::floor((h - items[i].text_buf->get_size().y) / 2.0)), i == mouse_over ? font_color_hover : font_color_accel);
+ items[i].accel_text_buf->draw(ci, item_ofs + Point2(0, Math::floor((h - items[i].text_buf->get_size().y) / 2.0)), i == mouse_over ? font_hover_color : font_accelerator_color);
}
// Cache the item vertical offset from the first item and the height
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index e934772371..6d5905aedc 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -618,7 +618,7 @@ void RichTextLabel::_shape_line(ItemFrame *p_frame, int p_line, const Ref<Font>
}
}
-int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_ofs, int p_width, const Color &p_base_color, int p_outline_size, const Color &p_outline_color, const Color &p_font_color_shadow, bool p_shadow_as_outline, const Point2 &p_shadow_ofs) {
+int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_ofs, int p_width, const Color &p_base_color, int p_outline_size, const Color &p_outline_color, const Color &p_font_shadow_color, bool p_shadow_as_outline, const Point2 &p_shadow_ofs) {
Vector2 off;
ERR_FAIL_COND_V(p_frame == nullptr, 0);
@@ -800,7 +800,7 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o
}
for (int j = 0; j < frame->lines.size(); j++) {
- _draw_line(frame, j, p_ofs + rect.position + off + Vector2(0, frame->lines[j].offset.y), rect.size.x, p_base_color, p_outline_size, p_outline_color, p_font_color_shadow, p_shadow_as_outline, p_shadow_ofs);
+ _draw_line(frame, j, p_ofs + rect.position + off + Vector2(0, frame->lines[j].offset.y), rect.size.x, p_base_color, p_outline_size, p_outline_color, p_font_shadow_color, p_shadow_as_outline, p_shadow_ofs);
}
idx++;
}
@@ -920,9 +920,9 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o
if (visible) {
if (frid != RID()) {
if (p_shadow_as_outline) {
- TS->font_draw_glyph_outline(frid, ci, glyphs[i].font_size, size, p_ofs + fx_offset + gloff + Vector2(-shadow_ofs.x, shadow_ofs.y), gl, p_font_color_shadow);
- TS->font_draw_glyph_outline(frid, ci, glyphs[i].font_size, size, p_ofs + fx_offset + gloff + Vector2(shadow_ofs.x, -shadow_ofs.y), gl, p_font_color_shadow);
- TS->font_draw_glyph_outline(frid, ci, glyphs[i].font_size, size, p_ofs + fx_offset + gloff + Vector2(-shadow_ofs.x, -shadow_ofs.y), gl, p_font_color_shadow);
+ TS->font_draw_glyph_outline(frid, ci, glyphs[i].font_size, size, p_ofs + fx_offset + gloff + Vector2(-shadow_ofs.x, shadow_ofs.y), gl, p_font_shadow_color);
+ TS->font_draw_glyph_outline(frid, ci, glyphs[i].font_size, size, p_ofs + fx_offset + gloff + Vector2(shadow_ofs.x, -shadow_ofs.y), gl, p_font_shadow_color);
+ TS->font_draw_glyph_outline(frid, ci, glyphs[i].font_size, size, p_ofs + fx_offset + gloff + Vector2(-shadow_ofs.x, -shadow_ofs.y), gl, p_font_shadow_color);
}
TS->font_draw_glyph_outline(frid, ci, glyphs[i].font_size, size, p_ofs + fx_offset + gloff, gl, font_color);
}
@@ -932,7 +932,7 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o
}
// Draw main text.
- Color selection_fg = get_theme_color("font_color_selected");
+ Color selection_fg = get_theme_color("font_selected_color");
Color selection_bg = get_theme_color("selection_color");
int sel_start = -1;
@@ -1400,7 +1400,7 @@ void RichTextLabel::_notification(int p_what) {
Color base_color = get_theme_color("default_color");
Color outline_color = get_theme_color("outline_color");
int outline_size = get_theme_constant("outline_size");
- Color font_color_shadow = get_theme_color("font_color_shadow");
+ Color font_shadow_color = get_theme_color("font_shadow_color");
bool use_outline = get_theme_constant("shadow_as_outline");
Point2 shadow_ofs(get_theme_constant("shadow_offset_x"), get_theme_constant("shadow_offset_y"));
@@ -1411,7 +1411,7 @@ void RichTextLabel::_notification(int p_what) {
Point2 ofs = text_rect.get_position() + Vector2(0, main->lines[from_line].offset.y - vofs);
while (ofs.y < size.height && from_line < main->lines.size()) {
visible_paragraph_count++;
- visible_line_count += _draw_line(main, from_line, ofs, text_rect.size.x, base_color, outline_size, outline_color, font_color_shadow, use_outline, shadow_ofs);
+ visible_line_count += _draw_line(main, from_line, ofs, text_rect.size.x, base_color, outline_size, outline_color, font_shadow_color, use_outline, shadow_ofs);
ofs.y += main->lines[from_line].text_buf->get_size().y;
from_line++;
}
diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h
index ee37efb68b..037839dac7 100644
--- a/scene/gui/rich_text_label.h
+++ b/scene/gui/rich_text_label.h
@@ -394,7 +394,7 @@ private:
void _shape_line(ItemFrame *p_frame, int p_line, const Ref<Font> &p_base_font, int p_base_font_size, int p_width, int *r_char_offset);
void _resize_line(ItemFrame *p_frame, int p_line, const Ref<Font> &p_base_font, int p_base_font_size, int p_width);
- int _draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_ofs, int p_width, const Color &p_base_color, int p_outline_size, const Color &p_outline_color, const Color &p_font_color_shadow, bool p_shadow_as_outline, const Point2 &shadow_ofs);
+ int _draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_ofs, int p_width, const Color &p_base_color, int p_outline_size, const Color &p_outline_color, const Color &p_font_shadow_color, bool p_shadow_as_outline, const Point2 &shadow_ofs);
float _find_click_in_line(ItemFrame *p_frame, int p_line, const Vector2 &p_ofs, int p_width, const Point2i &p_click, ItemFrame **r_click_frame = nullptr, int *r_click_line = nullptr, Item **r_click_item = nullptr, int *r_click_char = nullptr);
String _roman(int p_num, bool p_capitalize) const;
diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp
index 64a2a1843d..5acc789fbb 100644
--- a/scene/gui/tab_container.cpp
+++ b/scene/gui/tab_container.cpp
@@ -43,11 +43,11 @@ int TabContainer::_get_top_margin() const {
}
// Respect the minimum tab height.
- Ref<StyleBox> tab_bg = get_theme_stylebox("tab_bg");
- Ref<StyleBox> tab_fg = get_theme_stylebox("tab_fg");
+ Ref<StyleBox> tab_unselected = get_theme_stylebox("tab_unselected");
+ Ref<StyleBox> tab_selected = get_theme_stylebox("tab_selected");
Ref<StyleBox> tab_disabled = get_theme_stylebox("tab_disabled");
- int tab_height = MAX(MAX(tab_bg->get_minimum_size().height, tab_fg->get_minimum_size().height), tab_disabled->get_minimum_size().height);
+ int tab_height = MAX(MAX(tab_unselected->get_minimum_size().height, tab_selected->get_minimum_size().height), tab_disabled->get_minimum_size().height);
// Font height or higher icon wins.
int content_height = 0;
@@ -337,8 +337,8 @@ void TabContainer::_notification(int p_what) {
}
Vector<Control *> tabs = _get_tabs();
- Ref<StyleBox> tab_bg = get_theme_stylebox("tab_bg");
- Ref<StyleBox> tab_fg = get_theme_stylebox("tab_fg");
+ Ref<StyleBox> tab_unselected = get_theme_stylebox("tab_unselected");
+ Ref<StyleBox> tab_selected = get_theme_stylebox("tab_selected");
Ref<StyleBox> tab_disabled = get_theme_stylebox("tab_disabled");
Ref<Texture2D> increment = get_theme_icon("increment");
Ref<Texture2D> increment_hl = get_theme_icon("increment_highlight");
@@ -346,9 +346,9 @@ void TabContainer::_notification(int p_what) {
Ref<Texture2D> decrement_hl = get_theme_icon("decrement_highlight");
Ref<Texture2D> menu = get_theme_icon("menu");
Ref<Texture2D> menu_hl = get_theme_icon("menu_highlight");
- Color font_color_fg = get_theme_color("font_color_fg");
- Color font_color_bg = get_theme_color("font_color_bg");
- Color font_color_disabled = get_theme_color("font_color_disabled");
+ Color font_selected_color = get_theme_color("font_selected_color");
+ Color font_unselected_color = get_theme_color("font_unselected_color");
+ Color font_disabled_color = get_theme_color("font_disabled_color");
int side_margin = get_theme_constant("side_margin");
// Find out start and width of the header area.
@@ -433,17 +433,17 @@ void TabContainer::_notification(int p_what) {
int tab_width = tab_widths[i];
if (get_tab_disabled(index)) {
if (rtl) {
- _draw_tab(tab_disabled, font_color_disabled, index, size.width - (tabs_ofs_cache + x) - tab_width);
+ _draw_tab(tab_disabled, font_disabled_color, index, size.width - (tabs_ofs_cache + x) - tab_width);
} else {
- _draw_tab(tab_disabled, font_color_disabled, index, tabs_ofs_cache + x);
+ _draw_tab(tab_disabled, font_disabled_color, index, tabs_ofs_cache + x);
}
} else if (index == current) {
x_current = x;
} else {
if (rtl) {
- _draw_tab(tab_bg, font_color_bg, index, size.width - (tabs_ofs_cache + x) - tab_width);
+ _draw_tab(tab_unselected, font_unselected_color, index, size.width - (tabs_ofs_cache + x) - tab_width);
} else {
- _draw_tab(tab_bg, font_color_bg, index, tabs_ofs_cache + x);
+ _draw_tab(tab_unselected, font_unselected_color, index, tabs_ofs_cache + x);
}
}
@@ -459,9 +459,9 @@ void TabContainer::_notification(int p_what) {
// Draw selected tab in front. only draw selected tab when it's in visible range.
if (tabs.size() > 0 && current - first_tab_cache < tab_widths.size() && current >= first_tab_cache) {
if (rtl) {
- _draw_tab(tab_fg, font_color_fg, current, size.width - (tabs_ofs_cache + x_current) - tab_widths[current]);
+ _draw_tab(tab_selected, font_selected_color, current, size.width - (tabs_ofs_cache + x_current) - tab_widths[current]);
} else {
- _draw_tab(tab_fg, font_color_fg, current, tabs_ofs_cache + x_current);
+ _draw_tab(tab_selected, font_selected_color, current, tabs_ofs_cache + x_current);
}
}
@@ -655,15 +655,15 @@ int TabContainer::_get_tab_width(int p_index) const {
}
// Respect a minimum size.
- Ref<StyleBox> tab_bg = get_theme_stylebox("tab_bg");
- Ref<StyleBox> tab_fg = get_theme_stylebox("tab_fg");
+ Ref<StyleBox> tab_unselected = get_theme_stylebox("tab_unselected");
+ Ref<StyleBox> tab_selected = get_theme_stylebox("tab_selected");
Ref<StyleBox> tab_disabled = get_theme_stylebox("tab_disabled");
if (get_tab_disabled(p_index)) {
width += tab_disabled->get_minimum_size().width;
} else if (p_index == current) {
- width += tab_fg->get_minimum_size().width;
+ width += tab_selected->get_minimum_size().width;
} else {
- width += tab_bg->get_minimum_size().width;
+ width += tab_unselected->get_minimum_size().width;
}
return width;
@@ -1131,13 +1131,13 @@ Size2 TabContainer::get_minimum_size() const {
ms.y = MAX(ms.y, cms.y);
}
- Ref<StyleBox> tab_bg = get_theme_stylebox("tab_bg");
- Ref<StyleBox> tab_fg = get_theme_stylebox("tab_fg");
+ Ref<StyleBox> tab_unselected = get_theme_stylebox("tab_unselected");
+ Ref<StyleBox> tab_selected = get_theme_stylebox("tab_selected");
Ref<StyleBox> tab_disabled = get_theme_stylebox("tab_disabled");
Ref<Font> font = get_theme_font("font");
if (tabs_visible) {
- ms.y += MAX(MAX(tab_bg->get_minimum_size().y, tab_fg->get_minimum_size().y), tab_disabled->get_minimum_size().y);
+ ms.y += MAX(MAX(tab_unselected->get_minimum_size().y, tab_selected->get_minimum_size().y), tab_disabled->get_minimum_size().y);
ms.y += _get_top_margin();
}
diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp
index 3bf71d6c01..c156b1e6f8 100644
--- a/scene/gui/tabs.cpp
+++ b/scene/gui/tabs.cpp
@@ -38,11 +38,11 @@
#include "scene/gui/texture_rect.h"
Size2 Tabs::get_minimum_size() const {
- Ref<StyleBox> tab_bg = get_theme_stylebox("tab_bg");
- Ref<StyleBox> tab_fg = get_theme_stylebox("tab_fg");
+ Ref<StyleBox> tab_unselected = get_theme_stylebox("tab_unselected");
+ Ref<StyleBox> tab_selected = get_theme_stylebox("tab_selected");
Ref<StyleBox> tab_disabled = get_theme_stylebox("tab_disabled");
- int y_margin = MAX(MAX(tab_bg->get_minimum_size().height, tab_fg->get_minimum_size().height), tab_disabled->get_minimum_size().height);
+ int y_margin = MAX(MAX(tab_unselected->get_minimum_size().height, tab_selected->get_minimum_size().height), tab_disabled->get_minimum_size().height);
Size2 ms(0, 0);
@@ -61,9 +61,9 @@ Size2 Tabs::get_minimum_size() const {
if (tabs[i].disabled) {
ms.width += tab_disabled->get_minimum_size().width;
} else if (current == i) {
- ms.width += tab_fg->get_minimum_size().width;
+ ms.width += tab_selected->get_minimum_size().width;
} else {
- ms.width += tab_bg->get_minimum_size().width;
+ ms.width += tab_unselected->get_minimum_size().width;
}
if (tabs[i].right_button.is_valid()) {
@@ -71,7 +71,7 @@ Size2 Tabs::get_minimum_size() const {
Size2 bms = rb->get_size();
bms.width += get_theme_constant("hseparation");
ms.width += bms.width;
- ms.height = MAX(bms.height + tab_bg->get_minimum_size().height, ms.height);
+ ms.height = MAX(bms.height + tab_unselected->get_minimum_size().height, ms.height);
}
if (cb_displaypolicy == CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy == CLOSE_BUTTON_SHOW_ACTIVE_ONLY && i == current)) {
@@ -79,7 +79,7 @@ Size2 Tabs::get_minimum_size() const {
Size2 bms = cb->get_size();
bms.width += get_theme_constant("hseparation");
ms.width += bms.width;
- ms.height = MAX(bms.height + tab_bg->get_minimum_size().height, ms.height);
+ ms.height = MAX(bms.height + tab_unselected->get_minimum_size().height, ms.height);
}
}
@@ -268,12 +268,12 @@ void Tabs::_notification(int p_what) {
_update_cache();
RID ci = get_canvas_item();
- Ref<StyleBox> tab_bg = get_theme_stylebox("tab_bg");
- Ref<StyleBox> tab_fg = get_theme_stylebox("tab_fg");
+ Ref<StyleBox> tab_unselected = get_theme_stylebox("tab_unselected");
+ Ref<StyleBox> tab_selected = get_theme_stylebox("tab_selected");
Ref<StyleBox> tab_disabled = get_theme_stylebox("tab_disabled");
- Color color_fg = get_theme_color("font_color_fg");
- Color color_bg = get_theme_color("font_color_bg");
- Color color_disabled = get_theme_color("font_color_disabled");
+ Color font_selected_color = get_theme_color("font_selected_color");
+ 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");
Vector2 size = get_size();
bool rtl = is_layout_rtl();
@@ -316,13 +316,13 @@ void Tabs::_notification(int p_what) {
if (tabs[i].disabled) {
sb = tab_disabled;
- col = color_disabled;
+ col = font_disabled_color;
} else if (i == current) {
- sb = tab_fg;
- col = color_fg;
+ sb = tab_selected;
+ col = font_selected_color;
} else {
- sb = tab_bg;
- col = color_bg;
+ sb = tab_unselected;
+ col = font_unselected_color;
}
if (w + lsize > limit) {
@@ -652,8 +652,8 @@ void Tabs::_update_hover() {
void Tabs::_update_cache() {
Ref<StyleBox> tab_disabled = get_theme_stylebox("tab_disabled");
- Ref<StyleBox> tab_bg = get_theme_stylebox("tab_bg");
- Ref<StyleBox> tab_fg = get_theme_stylebox("tab_fg");
+ Ref<StyleBox> tab_unselected = get_theme_stylebox("tab_unselected");
+ Ref<StyleBox> tab_selected = get_theme_stylebox("tab_selected");
Ref<Texture2D> incr = get_theme_icon("increment");
Ref<Texture2D> decr = get_theme_icon("decrement");
int limit = get_size().width - incr->get_width() - decr->get_width();
@@ -683,9 +683,9 @@ void Tabs::_update_cache() {
if (tabs[i].disabled) {
sb = tab_disabled;
} else if (i == current) {
- sb = tab_fg;
+ sb = tab_selected;
} else {
- sb = tab_bg;
+ sb = tab_unselected;
}
int lsize = tabs[i].size_cache;
int slen = tabs[i].size_text;
@@ -918,8 +918,8 @@ void Tabs::move_tab(int from, int to) {
int Tabs::get_tab_width(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx, tabs.size(), 0);
- Ref<StyleBox> tab_bg = get_theme_stylebox("tab_bg");
- Ref<StyleBox> tab_fg = get_theme_stylebox("tab_fg");
+ Ref<StyleBox> tab_unselected = get_theme_stylebox("tab_unselected");
+ Ref<StyleBox> tab_selected = get_theme_stylebox("tab_selected");
Ref<StyleBox> tab_disabled = get_theme_stylebox("tab_disabled");
int x = 0;
@@ -937,9 +937,9 @@ int Tabs::get_tab_width(int p_idx) const {
if (tabs[p_idx].disabled) {
x += tab_disabled->get_minimum_size().width;
} else if (current == p_idx) {
- x += tab_fg->get_minimum_size().width;
+ x += tab_selected->get_minimum_size().width;
} else {
- x += tab_bg->get_minimum_size().width;
+ x += tab_unselected->get_minimum_size().width;
}
if (tabs[p_idx].right_button.is_valid()) {
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index f25eb45b85..d5249e9ee5 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -637,7 +637,7 @@ void TextEdit::_notification(int p_what) {
int visible_rows = get_visible_rows() + 1;
- Color color = readonly ? cache.font_color_readonly : cache.font_color;
+ Color color = readonly ? cache.font_readonly_color : cache.font_color;
if (cache.background_color.a > 0.01) {
RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(), get_size()), cache.background_color);
@@ -877,7 +877,7 @@ void TextEdit::_notification(int p_what) {
Color current_color = cache.font_color;
if (readonly) {
- current_color = cache.font_color_readonly;
+ current_color = cache.font_readonly_color;
}
Vector<String> wrap_rows = get_wrap_rows_text(minimap_line);
@@ -918,7 +918,7 @@ void TextEdit::_notification(int p_what) {
if (color_map.has(last_wrap_column + j)) {
current_color = color_map[last_wrap_column + j].get("color");
if (readonly) {
- current_color.a = cache.font_color_readonly.a;
+ current_color.a = cache.font_readonly_color.a;
}
}
color = current_color;
@@ -1001,7 +1001,7 @@ void TextEdit::_notification(int p_what) {
Dictionary color_map = _get_line_syntax_highlighting(line);
// Ensure we at least use the font color.
- Color current_color = readonly ? cache.font_color_readonly : cache.font_color;
+ Color current_color = readonly ? cache.font_readonly_color : cache.font_color;
const Ref<TextParagraph> ldata = text.get_line_data(line);
@@ -1230,7 +1230,7 @@ void TextEdit::_notification(int p_what) {
}
rect.position.y = TS->shaped_text_get_ascent(rid) + cache.font->get_underline_position(cache.font_size);
rect.size.y = cache.font->get_underline_thickness(cache.font_size);
- draw_rect(rect, cache.font_color_selected);
+ draw_rect(rect, cache.font_selected_color);
}
highlighted_word_col = _get_column_pos_of_word(highlighted_word, str, SEARCH_MATCH_CASE | SEARCH_WHOLE_WORDS, highlighted_word_col + 1);
@@ -1249,8 +1249,8 @@ void TextEdit::_notification(int p_what) {
for (int j = 0; j < gl_size; j++) {
if (color_map.has(glyphs[j].start)) {
current_color = color_map[glyphs[j].start].get("color");
- if (readonly && current_color.a > cache.font_color_readonly.a) {
- current_color.a = cache.font_color_readonly.a;
+ if (readonly && current_color.a > cache.font_readonly_color.a) {
+ current_color.a = cache.font_readonly_color.a;
}
}
@@ -1259,7 +1259,7 @@ void TextEdit::_notification(int p_what) {
int sel_to = (line < selection.to_line) ? TS->shaped_text_get_range(rid).y : selection.to_column;
if (glyphs[j].start >= sel_from && glyphs[j].end <= sel_to && override_selected_font_color) {
- current_color = cache.font_color_selected;
+ current_color = cache.font_selected_color;
}
}
@@ -4900,8 +4900,8 @@ void TextEdit::_update_caches() {
cache.caret_color = get_theme_color("caret_color");
cache.caret_background_color = get_theme_color("caret_background_color");
cache.font_color = get_theme_color("font_color");
- cache.font_color_selected = get_theme_color("font_color_selected");
- cache.font_color_readonly = get_theme_color("font_color_readonly");
+ cache.font_selected_color = get_theme_color("font_selected_color");
+ cache.font_readonly_color = get_theme_color("font_readonly_color");
cache.selection_color = get_theme_color("selection_color");
cache.mark_color = get_theme_color("mark_color");
cache.current_line_color = get_theme_color("current_line_color");
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h
index d5b9b46fe2..dc811059c8 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -485,8 +485,8 @@ protected:
Color caret_color;
Color caret_background_color;
Color font_color;
- Color font_color_selected;
- Color font_color_readonly;
+ Color font_selected_color;
+ Color font_readonly_color;
Color selection_color;
Color mark_color;
Color code_folding_color;
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index a968a83dad..0049b54f50 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -1018,7 +1018,7 @@ void Tree::update_cache() {
cache.custom_button_font_highlight = get_theme_color("custom_button_font_highlight");
cache.font_color = get_theme_color("font_color");
- cache.font_color_selected = get_theme_color("font_color_selected");
+ cache.font_selected_color = get_theme_color("font_selected_color");
cache.guide_color = get_theme_color("guide_color");
cache.drop_position_color = get_theme_color("drop_position_color");
cache.hseparation = get_theme_constant("hseparation");
@@ -1433,7 +1433,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
}
}
- Color col = p_item->cells[i].custom_color ? p_item->cells[i].color : get_theme_color(p_item->cells[i].selected ? "font_color_selected" : "font_color");
+ Color col = p_item->cells[i].custom_color ? p_item->cells[i].color : get_theme_color(p_item->cells[i].selected ? "font_selected_color" : "font_color");
Color icon_col = p_item->cells[i].icon_color;
if (p_item->cells[i].dirty) {
diff --git a/scene/gui/tree.h b/scene/gui/tree.h
index dfc02f760d..2136bada0b 100644
--- a/scene/gui/tree.h
+++ b/scene/gui/tree.h
@@ -459,7 +459,7 @@ private:
Ref<Texture2D> updown;
Color font_color;
- Color font_color_selected;
+ Color font_selected_color;
Color guide_color;
Color drop_position_color;
Color relationship_line_color;