Merge pull request #57796 from akien-mga/revert-sname-theme-setters

This commit is contained in:
Rémi Verschelde 2022-02-08 11:13:24 +01:00 committed by GitHub
commit a66e55069e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
90 changed files with 1583 additions and 1583 deletions

View File

@ -4368,7 +4368,7 @@ void AnimationTrackEditor::_update_tracks() {
g->set_timeline(timeline); g->set_timeline(timeline);
groups.push_back(g); groups.push_back(g);
VBoxContainer *vb = memnew(VBoxContainer); VBoxContainer *vb = memnew(VBoxContainer);
vb->add_theme_constant_override(SNAME("separation"), 0); vb->add_theme_constant_override("separation", 0);
vb->add_child(g); vb->add_child(g);
track_vbox->add_child(vb); track_vbox->add_child(vb);
group_sort[base_path] = vb; group_sort[base_path] = vb;
@ -4519,7 +4519,7 @@ void AnimationTrackEditor::_notification(int p_what) {
view_group->set_icon(get_theme_icon(view_group->is_pressed() ? SNAME("AnimationTrackList") : SNAME("AnimationTrackGroup"), SNAME("EditorIcons"))); view_group->set_icon(get_theme_icon(view_group->is_pressed() ? SNAME("AnimationTrackList") : SNAME("AnimationTrackGroup"), SNAME("EditorIcons")));
selected_filter->set_icon(get_theme_icon(SNAME("AnimationFilter"), SNAME("EditorIcons"))); selected_filter->set_icon(get_theme_icon(SNAME("AnimationFilter"), SNAME("EditorIcons")));
imported_anim_warning->set_icon(get_theme_icon(SNAME("NodeWarning"), SNAME("EditorIcons"))); imported_anim_warning->set_icon(get_theme_icon(SNAME("NodeWarning"), SNAME("EditorIcons")));
main_panel->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); main_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
edit->get_popup()->set_item_icon(edit->get_popup()->get_item_index(EDIT_APPLY_RESET), get_theme_icon(SNAME("Reload"), SNAME("EditorIcons"))); edit->get_popup()->set_item_icon(edit->get_popup()->get_item_index(EDIT_APPLY_RESET), get_theme_icon(SNAME("Reload"), SNAME("EditorIcons")));
} }
@ -6085,7 +6085,7 @@ AnimationTrackEditor::AnimationTrackEditor() {
timeline_scroll->add_child(timeline_vbox); timeline_scroll->add_child(timeline_vbox);
timeline_vbox->set_v_size_flags(SIZE_EXPAND_FILL); timeline_vbox->set_v_size_flags(SIZE_EXPAND_FILL);
timeline_vbox->set_h_size_flags(SIZE_EXPAND_FILL); timeline_vbox->set_h_size_flags(SIZE_EXPAND_FILL);
timeline_vbox->add_theme_constant_override(SNAME("separation"), 0); timeline_vbox->add_theme_constant_override("separation", 0);
info_message = memnew(Label); info_message = memnew(Label);
info_message->set_text(TTR("Select an AnimationPlayer node to create and edit animations.")); info_message->set_text(TTR("Select an AnimationPlayer node to create and edit animations."));
@ -6140,7 +6140,7 @@ AnimationTrackEditor::AnimationTrackEditor() {
scroll->add_child(track_vbox); scroll->add_child(track_vbox);
track_vbox->set_h_size_flags(SIZE_EXPAND_FILL); track_vbox->set_h_size_flags(SIZE_EXPAND_FILL);
scroll->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); scroll->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED);
track_vbox->add_theme_constant_override(SNAME("separation"), 0); track_vbox->add_theme_constant_override("separation", 0);
HBoxContainer *bottom_hb = memnew(HBoxContainer); HBoxContainer *bottom_hb = memnew(HBoxContainer);
add_child(bottom_hb); add_child(bottom_hb);

View File

@ -105,7 +105,7 @@ void FindReplaceBar::_notification(int p_what) {
hide_button->set_pressed_texture(get_theme_icon(SNAME("Close"), SNAME("EditorIcons"))); hide_button->set_pressed_texture(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size()); hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size());
} else if (p_what == NOTIFICATION_THEME_CHANGED) { } else if (p_what == NOTIFICATION_THEME_CHANGED) {
matches_label->add_theme_color_override(SNAME("font_color"), results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor"))); matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor")));
} else if (p_what == NOTIFICATION_PREDELETE) { } else if (p_what == NOTIFICATION_PREDELETE) {
if (base_text_editor) { if (base_text_editor) {
base_text_editor->remove_find_replace_bar(); base_text_editor->remove_find_replace_bar();
@ -301,7 +301,7 @@ void FindReplaceBar::_replace_all() {
} }
text_editor->set_v_scroll(vsval); text_editor->set_v_scroll(vsval);
matches_label->add_theme_color_override(SNAME("font_color"), rc > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor"))); matches_label->add_theme_color_override("font_color", rc > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor")));
matches_label->set_text(vformat(TTR("%d replaced."), rc)); matches_label->set_text(vformat(TTR("%d replaced."), rc));
text_editor->call_deferred(SNAME("connect"), "text_changed", callable_mp(this, &FindReplaceBar::_editor_text_changed)); text_editor->call_deferred(SNAME("connect"), "text_changed", callable_mp(this, &FindReplaceBar::_editor_text_changed));
@ -365,7 +365,7 @@ void FindReplaceBar::_update_matches_label() {
} else { } else {
matches_label->show(); matches_label->show();
matches_label->add_theme_color_override(SNAME("font_color"), results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor"))); matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor")));
matches_label->set_text(vformat(results_count == 1 ? TTR("%d match.") : TTR("%d matches."), results_count)); matches_label->set_text(vformat(results_count == 1 ? TTR("%d match.") : TTR("%d matches."), results_count));
} }
} }
@ -818,7 +818,7 @@ void CodeTextEditor::_zoom_changed() {
void CodeTextEditor::_reset_zoom() { void CodeTextEditor::_reset_zoom() {
EditorSettings::get_singleton()->set("interface/editor/code_font_size", 14); EditorSettings::get_singleton()->set("interface/editor/code_font_size", 14);
text_editor->add_theme_font_size_override(SNAME("font_size"), 14 * EDSCALE); text_editor->add_theme_font_size_override("font_size", 14 * EDSCALE);
} }
void CodeTextEditor::_line_col_changed() { void CodeTextEditor::_line_col_changed() {
@ -936,7 +936,7 @@ bool CodeTextEditor::_add_font_size(int p_delta) {
if (new_size != old_size) { if (new_size != old_size) {
EditorSettings::get_singleton()->set("interface/editor/code_font_size", new_size / EDSCALE); EditorSettings::get_singleton()->set("interface/editor/code_font_size", new_size / EDSCALE);
text_editor->add_theme_font_size_override(SNAME("font_size"), new_size); text_editor->add_theme_font_size_override("font_size", new_size);
} }
return true; return true;
@ -1567,14 +1567,14 @@ void CodeTextEditor::_update_text_editor_theme() {
Ref<Font> status_bar_font = get_theme_font(SNAME("status_source"), SNAME("EditorFonts")); Ref<Font> status_bar_font = get_theme_font(SNAME("status_source"), SNAME("EditorFonts"));
int status_bar_font_size = get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts")); int status_bar_font_size = get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts"));
error->add_theme_font_override(SNAME("font"), status_bar_font); error->add_theme_font_override("font", status_bar_font);
error->add_theme_font_size_override(SNAME("font_size"), status_bar_font_size); error->add_theme_font_size_override("font_size", status_bar_font_size);
int count = status_bar->get_child_count(); int count = status_bar->get_child_count();
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
Control *n = Object::cast_to<Control>(status_bar->get_child(i)); Control *n = Object::cast_to<Control>(status_bar->get_child(i));
if (n) { if (n) {
n->add_theme_font_override(SNAME("font"), status_bar_font); n->add_theme_font_override("font", status_bar_font);
n->add_theme_font_size_override(SNAME("font_size"), status_bar_font_size); n->add_theme_font_size_override("font_size", status_bar_font_size);
} }
} }
error->end_bulk_theme_override(); error->end_bulk_theme_override();
@ -1666,17 +1666,17 @@ void CodeTextEditor::_notification(int p_what) {
case NOTIFICATION_ENTER_TREE: case NOTIFICATION_ENTER_TREE:
case NOTIFICATION_THEME_CHANGED: { case NOTIFICATION_THEME_CHANGED: {
error_button->set_icon(get_theme_icon(SNAME("StatusError"), SNAME("EditorIcons"))); error_button->set_icon(get_theme_icon(SNAME("StatusError"), SNAME("EditorIcons")));
error_button->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); error_button->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
error_button->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("status_source"), SNAME("EditorFonts"))); error_button->add_theme_font_override("font", get_theme_font(SNAME("status_source"), SNAME("EditorFonts")));
error_button->add_theme_font_size_override(SNAME("font_size"), get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts"))); error_button->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts")));
warning_button->set_icon(get_theme_icon(SNAME("NodeWarning"), SNAME("EditorIcons"))); warning_button->set_icon(get_theme_icon(SNAME("NodeWarning"), SNAME("EditorIcons")));
warning_button->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("warning_color"), SNAME("Editor"))); warning_button->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
warning_button->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("status_source"), SNAME("EditorFonts"))); warning_button->add_theme_font_override("font", get_theme_font(SNAME("status_source"), SNAME("EditorFonts")));
warning_button->add_theme_font_size_override(SNAME("font_size"), get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts"))); warning_button->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts")));
line_and_col_txt->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("status_source"), SNAME("EditorFonts"))); line_and_col_txt->add_theme_font_override("font", get_theme_font(SNAME("status_source"), SNAME("EditorFonts")));
line_and_col_txt->add_theme_font_size_override(SNAME("font_size"), get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts"))); line_and_col_txt->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts")));
if (p_what == NOTIFICATION_ENTER_TREE) { if (p_what == NOTIFICATION_ENTER_TREE) {
break; break;
@ -1935,5 +1935,5 @@ CodeTextEditor::CodeTextEditor() {
font_resize_timer->connect("timeout", callable_mp(this, &CodeTextEditor::_font_resize_timeout)); font_resize_timer->connect("timeout", callable_mp(this, &CodeTextEditor::_font_resize_timeout));
EditorSettings::get_singleton()->connect("settings_changed", callable_mp(this, &CodeTextEditor::_on_settings_change)); EditorSettings::get_singleton()->connect("settings_changed", callable_mp(this, &CodeTextEditor::_on_settings_change));
add_theme_constant_override(SNAME("separation"), 4 * EDSCALE); add_theme_constant_override("separation", 4 * EDSCALE);
} }

View File

@ -381,7 +381,7 @@ void ConnectDialog::init(ConnectionData p_cd, bool p_edit) {
void ConnectDialog::popup_dialog(const String &p_for_signal) { void ConnectDialog::popup_dialog(const String &p_for_signal) {
from_signal->set_text(p_for_signal); from_signal->set_text(p_for_signal);
error_label->add_theme_color_override(SNAME("font_color"), error_label->get_theme_color(SNAME("error_color"), SNAME("Editor"))); error_label->add_theme_color_override("font_color", error_label->get_theme_color(SNAME("error_color"), SNAME("Editor")));
if (!advanced->is_pressed()) { if (!advanced->is_pressed()) {
error_label->set_visible(!_find_first_script(get_tree()->get_edited_scene_root(), get_tree()->get_edited_scene_root())); error_label->set_visible(!_find_first_script(get_tree()->get_edited_scene_root(), get_tree()->get_edited_scene_root()));
} }
@ -1200,7 +1200,7 @@ ConnectionsDock::ConnectionsDock(EditorNode *p_editor) {
tree->connect("item_activated", callable_mp(this, &ConnectionsDock::_tree_item_activated)); tree->connect("item_activated", callable_mp(this, &ConnectionsDock::_tree_item_activated));
tree->connect("item_rmb_selected", callable_mp(this, &ConnectionsDock::_rmb_pressed)); tree->connect("item_rmb_selected", callable_mp(this, &ConnectionsDock::_rmb_pressed));
add_theme_constant_override(SNAME("separation"), 3 * EDSCALE); add_theme_constant_override("separation", 3 * EDSCALE);
EDITOR_DEF("interface/editors/default_signal_callback_name", "_on_{node_name}_{signal_name}"); EDITOR_DEF("interface/editors/default_signal_callback_name", "_on_{node_name}_{signal_name}");
} }

View File

@ -733,7 +733,7 @@ CreateDialog::CreateDialog() {
favorites->set_allow_reselect(true); favorites->set_allow_reselect(true);
favorites->connect("cell_selected", callable_mp(this, &CreateDialog::_favorite_selected)); favorites->connect("cell_selected", callable_mp(this, &CreateDialog::_favorite_selected));
favorites->connect("item_activated", callable_mp(this, &CreateDialog::_favorite_activated)); favorites->connect("item_activated", callable_mp(this, &CreateDialog::_favorite_activated));
favorites->add_theme_constant_override(SNAME("draw_guides"), 1); favorites->add_theme_constant_override("draw_guides", 1);
#ifndef _MSC_VER #ifndef _MSC_VER
#warning cannot forward drag data to a non control, must be fixed #warning cannot forward drag data to a non control, must be fixed
#endif #endif
@ -750,7 +750,7 @@ CreateDialog::CreateDialog() {
recent->set_allow_reselect(true); recent->set_allow_reselect(true);
recent->connect("item_selected", callable_mp(this, &CreateDialog::_history_selected)); recent->connect("item_selected", callable_mp(this, &CreateDialog::_history_selected));
recent->connect("item_activated", callable_mp(this, &CreateDialog::_history_activated)); recent->connect("item_activated", callable_mp(this, &CreateDialog::_history_activated));
recent->add_theme_constant_override(SNAME("draw_guides"), 1); recent->add_theme_constant_override("draw_guides", 1);
VBoxContainer *vbc = memnew(VBoxContainer); VBoxContainer *vbc = memnew(VBoxContainer);
vbc->set_custom_minimum_size(Size2(300, 0) * EDSCALE); vbc->set_custom_minimum_size(Size2(300, 0) * EDSCALE);

View File

@ -55,8 +55,8 @@ EditorDebuggerNode::EditorDebuggerNode() {
singleton = this; singleton = this;
} }
add_theme_constant_override(SNAME("margin_left"), -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_LEFT)); add_theme_constant_override("margin_left", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_LEFT));
add_theme_constant_override(SNAME("margin_right"), -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_RIGHT)); add_theme_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_RIGHT));
tabs = memnew(TabContainer); tabs = memnew(TabContainer);
tabs->set_tab_alignment(TabContainer::ALIGNMENT_LEFT); tabs->set_tab_alignment(TabContainer::ALIGNMENT_LEFT);
@ -66,7 +66,7 @@ EditorDebuggerNode::EditorDebuggerNode() {
Ref<StyleBoxEmpty> empty; Ref<StyleBoxEmpty> empty;
empty.instantiate(); empty.instantiate();
tabs->add_theme_style_override(SNAME("panel"), empty); tabs->add_theme_style_override("panel", empty);
auto_switch_remote_scene_tree = EDITOR_DEF("debugger/auto_switch_to_remote_scene_tree", false); auto_switch_remote_scene_tree = EDITOR_DEF("debugger/auto_switch_to_remote_scene_tree", false);
_add_debugger(); _add_debugger();
@ -113,7 +113,7 @@ ScriptEditorDebugger *EditorDebuggerNode::_add_debugger() {
if (tabs->get_tab_count() > 1) { if (tabs->get_tab_count() > 1) {
node->clear_style(); node->clear_style();
tabs->set_tabs_visible(true); tabs->set_tabs_visible(true);
tabs->add_theme_style_override(SNAME("panel"), EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles"))); tabs->add_theme_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles")));
} }
if (!debugger_plugins.is_empty()) { if (!debugger_plugins.is_empty()) {
@ -233,10 +233,10 @@ void EditorDebuggerNode::_notification(int p_what) {
switch (p_what) { switch (p_what) {
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
if (tabs->get_tab_count() > 1) { if (tabs->get_tab_count() > 1) {
add_theme_constant_override(SNAME("margin_left"), -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_LEFT)); add_theme_constant_override("margin_left", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_LEFT));
add_theme_constant_override(SNAME("margin_right"), -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_RIGHT)); add_theme_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_RIGHT));
tabs->add_theme_style_override(SNAME("panel"), EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles"))); tabs->add_theme_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles")));
} }
} break; } break;
case NOTIFICATION_READY: { case NOTIFICATION_READY: {
@ -271,20 +271,20 @@ void EditorDebuggerNode::_notification(int p_what) {
if (error_count == 0 && warning_count == 0) { if (error_count == 0 && warning_count == 0) {
debugger_button->set_text(TTR("Debugger")); debugger_button->set_text(TTR("Debugger"));
debugger_button->remove_theme_color_override(SNAME("font_color")); debugger_button->remove_theme_color_override("font_color");
debugger_button->set_icon(Ref<Texture2D>()); debugger_button->set_icon(Ref<Texture2D>());
} else { } else {
debugger_button->set_text(TTR("Debugger") + " (" + itos(error_count + warning_count) + ")"); debugger_button->set_text(TTR("Debugger") + " (" + itos(error_count + warning_count) + ")");
if (error_count >= 1 && warning_count >= 1) { if (error_count >= 1 && warning_count >= 1) {
debugger_button->set_icon(get_theme_icon(SNAME("ErrorWarning"), SNAME("EditorIcons"))); debugger_button->set_icon(get_theme_icon(SNAME("ErrorWarning"), SNAME("EditorIcons")));
// Use error color to represent the highest level of severity reported. // Use error color to represent the highest level of severity reported.
debugger_button->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); debugger_button->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
} else if (error_count >= 1) { } else if (error_count >= 1) {
debugger_button->set_icon(get_theme_icon(SNAME("Error"), SNAME("EditorIcons"))); debugger_button->set_icon(get_theme_icon(SNAME("Error"), SNAME("EditorIcons")));
debugger_button->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); debugger_button->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
} else { } else {
debugger_button->set_icon(get_theme_icon(SNAME("Warning"), SNAME("EditorIcons"))); debugger_button->set_icon(get_theme_icon(SNAME("Warning"), SNAME("EditorIcons")));
debugger_button->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("warning_color"), SNAME("Editor"))); debugger_button->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
} }
} }
last_error_count = error_count; last_error_count = error_count;

View File

@ -46,8 +46,8 @@ void EditorNetworkProfiler::_notification(int p_what) {
outgoing_bandwidth_text->set_right_icon(get_theme_icon(SNAME("ArrowUp"), SNAME("EditorIcons"))); outgoing_bandwidth_text->set_right_icon(get_theme_icon(SNAME("ArrowUp"), SNAME("EditorIcons")));
// This needs to be done here to set the faded color when the profiler is first opened // This needs to be done here to set the faded color when the profiler is first opened
incoming_bandwidth_text->add_theme_color_override(SNAME("font_uneditable_color"), get_theme_color(SNAME("font_color"), SNAME("Editor")) * Color(1, 1, 1, 0.5)); incoming_bandwidth_text->add_theme_color_override("font_uneditable_color", get_theme_color(SNAME("font_color"), SNAME("Editor")) * Color(1, 1, 1, 0.5));
outgoing_bandwidth_text->add_theme_color_override(SNAME("font_uneditable_color"), get_theme_color(SNAME("font_color"), SNAME("Editor")) * Color(1, 1, 1, 0.5)); outgoing_bandwidth_text->add_theme_color_override("font_uneditable_color", get_theme_color(SNAME("font_color"), SNAME("Editor")) * Color(1, 1, 1, 0.5));
} }
} }
@ -126,7 +126,7 @@ bool EditorNetworkProfiler::is_profiling() {
EditorNetworkProfiler::EditorNetworkProfiler() { EditorNetworkProfiler::EditorNetworkProfiler() {
HBoxContainer *hb = memnew(HBoxContainer); HBoxContainer *hb = memnew(HBoxContainer);
hb->add_theme_constant_override(SNAME("separation"), 8 * EDSCALE); hb->add_theme_constant_override("separation", 8 * EDSCALE);
add_child(hb); add_child(hb);
activate = memnew(Button); activate = memnew(Button);

View File

@ -618,7 +618,7 @@ EditorProfiler::EditorProfiler() {
hb->add_child(cursor_metric_edit); hb->add_child(cursor_metric_edit);
cursor_metric_edit->connect("value_changed", callable_mp(this, &EditorProfiler::_cursor_metric_changed)); cursor_metric_edit->connect("value_changed", callable_mp(this, &EditorProfiler::_cursor_metric_changed));
hb->add_theme_constant_override(SNAME("separation"), 8 * EDSCALE); hb->add_theme_constant_override("separation", 8 * EDSCALE);
h_split = memnew(HSplitContainer); h_split = memnew(HSplitContainer);
add_child(h_split); add_child(h_split);

View File

@ -758,7 +758,7 @@ EditorVisualProfiler::EditorVisualProfiler() {
hb->add_child(cursor_metric_edit); hb->add_child(cursor_metric_edit);
cursor_metric_edit->connect("value_changed", callable_mp(this, &EditorVisualProfiler::_cursor_metric_changed)); cursor_metric_edit->connect("value_changed", callable_mp(this, &EditorVisualProfiler::_cursor_metric_changed));
hb->add_theme_constant_override(SNAME("separation"), 8 * EDSCALE); hb->add_theme_constant_override("separation", 8 * EDSCALE);
h_split = memnew(HSplitContainer); h_split = memnew(HSplitContainer);
add_child(h_split); add_child(h_split);

View File

@ -147,7 +147,7 @@ void ScriptEditorDebugger::update_tabs() {
} }
void ScriptEditorDebugger::clear_style() { void ScriptEditorDebugger::clear_style() {
tabs->remove_theme_style_override(SNAME("panel")); tabs->remove_theme_style_override("panel");
} }
void ScriptEditorDebugger::save_node(ObjectID p_id, const String &p_file) { void ScriptEditorDebugger::save_node(ObjectID p_id, const String &p_file) {
@ -762,13 +762,13 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
void ScriptEditorDebugger::_set_reason_text(const String &p_reason, MessageType p_type) { void ScriptEditorDebugger::_set_reason_text(const String &p_reason, MessageType p_type) {
switch (p_type) { switch (p_type) {
case MESSAGE_ERROR: case MESSAGE_ERROR:
reason->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); reason->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
break; break;
case MESSAGE_WARNING: case MESSAGE_WARNING:
reason->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("warning_color"), SNAME("Editor"))); reason->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
break; break;
default: default:
reason->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("success_color"), SNAME("Editor"))); reason->add_theme_color_override("font_color", get_theme_color(SNAME("success_color"), SNAME("Editor")));
} }
reason->set_text(p_reason); reason->set_text(p_reason);
reason->set_tooltip(p_reason.word_wrap(80)); reason->set_tooltip(p_reason.word_wrap(80));
@ -793,7 +793,7 @@ void ScriptEditorDebugger::_notification(int p_what) {
vmem_export->set_icon(get_theme_icon(SNAME("Save"), SNAME("EditorIcons"))); vmem_export->set_icon(get_theme_icon(SNAME("Save"), SNAME("EditorIcons")));
search->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); search->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
reason->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); reason->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
} break; } break;
case NOTIFICATION_PROCESS: { case NOTIFICATION_PROCESS: {
@ -855,8 +855,8 @@ void ScriptEditorDebugger::_notification(int p_what) {
}; };
} break; } break;
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
if (tabs->has_theme_stylebox_override(SNAME("panel"))) { if (tabs->has_theme_stylebox_override("panel")) {
tabs->add_theme_style_override(SNAME("panel"), editor->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles"))); tabs->add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles")));
} }
copy->set_icon(get_theme_icon(SNAME("ActionCopy"), SNAME("EditorIcons"))); copy->set_icon(get_theme_icon(SNAME("ActionCopy"), SNAME("EditorIcons")));
@ -1665,7 +1665,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) {
tabs = memnew(TabContainer); tabs = memnew(TabContainer);
tabs->set_tab_alignment(TabContainer::ALIGNMENT_LEFT); tabs->set_tab_alignment(TabContainer::ALIGNMENT_LEFT);
tabs->add_theme_style_override(SNAME("panel"), editor->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles"))); tabs->add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles")));
tabs->connect("tab_changed", callable_mp(this, &ScriptEditorDebugger::_tab_changed)); tabs->connect("tab_changed", callable_mp(this, &ScriptEditorDebugger::_tab_changed));
add_child(tabs); add_child(tabs);

View File

@ -43,12 +43,12 @@ static const String META_TEXT_TO_COPY = "text_to_copy";
void EditorAbout::_theme_changed() { void EditorAbout::_theme_changed() {
const Ref<Font> font = get_theme_font(SNAME("source"), SNAME("EditorFonts")); const Ref<Font> font = get_theme_font(SNAME("source"), SNAME("EditorFonts"));
const int font_size = get_theme_font_size(SNAME("source_size"), SNAME("EditorFonts")); const int font_size = get_theme_font_size(SNAME("source_size"), SNAME("EditorFonts"));
_tpl_text->add_theme_font_override(SNAME("normal_font"), font); _tpl_text->add_theme_font_override("normal_font", font);
_tpl_text->add_theme_font_size_override(SNAME("normal_font_size"), font_size); _tpl_text->add_theme_font_size_override("normal_font_size", font_size);
_tpl_text->add_theme_constant_override(SNAME("line_separation"), 6 * EDSCALE); _tpl_text->add_theme_constant_override("line_separation", 6 * EDSCALE);
_license_text->add_theme_font_override(SNAME("normal_font"), font); _license_text->add_theme_font_override("normal_font", font);
_license_text->add_theme_font_size_override(SNAME("normal_font_size"), font_size); _license_text->add_theme_font_size_override("normal_font_size", font_size);
_license_text->add_theme_constant_override(SNAME("line_separation"), 6 * EDSCALE); _license_text->add_theme_constant_override("line_separation", 6 * EDSCALE);
_logo->set_texture(get_theme_icon(SNAME("Logo"), SNAME("EditorIcons"))); _logo->set_texture(get_theme_icon(SNAME("Logo"), SNAME("EditorIcons")));
} }
@ -101,7 +101,7 @@ ScrollContainer *EditorAbout::_populate_list(const String &p_name, const List<St
il->set_same_column_width(true); il->set_same_column_width(true);
il->set_auto_height(true); il->set_auto_height(true);
il->set_mouse_filter(Control::MOUSE_FILTER_IGNORE); il->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
il->add_theme_constant_override(SNAME("hseparation"), 16 * EDSCALE); il->add_theme_constant_override("hseparation", 16 * EDSCALE);
while (*names_ptr) { while (*names_ptr) {
il->add_item(String::utf8(*names_ptr++), nullptr, false); il->add_item(String::utf8(*names_ptr++), nullptr, false);
} }
@ -126,7 +126,7 @@ EditorAbout::EditorAbout() {
HBoxContainer *hbc = memnew(HBoxContainer); HBoxContainer *hbc = memnew(HBoxContainer);
hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL); hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);
hbc->set_alignment(BoxContainer::ALIGNMENT_CENTER); hbc->set_alignment(BoxContainer::ALIGNMENT_CENTER);
hbc->add_theme_constant_override(SNAME("separation"), 30 * EDSCALE); hbc->add_theme_constant_override("separation", 30 * EDSCALE);
add_child(vbc); add_child(vbc);
vbc->add_child(hbc); vbc->add_child(hbc);

View File

@ -79,17 +79,17 @@ void EditorAudioBus::_notification(int p_what) {
Color bypass_color = EditorSettings::get_singleton()->is_dark_theme() ? Color(0.13, 0.8, 1.0) : Color(0.44, 0.87, 1.0); Color bypass_color = EditorSettings::get_singleton()->is_dark_theme() ? Color(0.13, 0.8, 1.0) : Color(0.44, 0.87, 1.0);
solo->set_icon(get_theme_icon(SNAME("AudioBusSolo"), SNAME("EditorIcons"))); solo->set_icon(get_theme_icon(SNAME("AudioBusSolo"), SNAME("EditorIcons")));
solo->add_theme_color_override(SNAME("icon_pressed_color"), solo_color); solo->add_theme_color_override("icon_pressed_color", solo_color);
mute->set_icon(get_theme_icon(SNAME("AudioBusMute"), SNAME("EditorIcons"))); mute->set_icon(get_theme_icon(SNAME("AudioBusMute"), SNAME("EditorIcons")));
mute->add_theme_color_override(SNAME("icon_pressed_color"), mute_color); mute->add_theme_color_override("icon_pressed_color", mute_color);
bypass->set_icon(get_theme_icon(SNAME("AudioBusBypass"), SNAME("EditorIcons"))); bypass->set_icon(get_theme_icon(SNAME("AudioBusBypass"), SNAME("EditorIcons")));
bypass->add_theme_color_override(SNAME("icon_pressed_color"), bypass_color); bypass->add_theme_color_override("icon_pressed_color", bypass_color);
bus_options->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons"))); bus_options->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons")));
audio_value_preview_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("font_color"), SNAME("TooltipLabel"))); audio_value_preview_label->add_theme_color_override("font_color", get_theme_color(SNAME("font_color"), SNAME("TooltipLabel")));
audio_value_preview_label->add_theme_color_override(SNAME("font_shadow_color"), get_theme_color(SNAME("font_shadow_color"), SNAME("TooltipLabel"))); audio_value_preview_label->add_theme_color_override("font_shadow_color", get_theme_color(SNAME("font_shadow_color"), SNAME("TooltipLabel")));
audio_value_preview_box->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("panel"), SNAME("TooltipPanel"))); audio_value_preview_box->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("TooltipPanel")));
} break; } break;
case NOTIFICATION_READY: { case NOTIFICATION_READY: {
@ -574,7 +574,7 @@ Variant EditorAudioBus::get_drag_data(const Point2 &p_point) {
Panel *p = memnew(Panel); Panel *p = memnew(Panel);
c->add_child(p); c->add_child(p);
p->set_modulate(Color(1, 1, 1, 0.7)); p->set_modulate(Color(1, 1, 1, 0.7));
p->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("focus"), SNAME("Button"))); p->add_theme_style_override("panel", get_theme_stylebox(SNAME("focus"), SNAME("Button")));
p->set_size(get_size()); p->set_size(get_size());
p->set_position(-p_point); p->set_position(-p_point);
set_drag_preview(c); set_drag_preview(c);
@ -804,10 +804,10 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
Ref<StyleBoxEmpty> sbempty = memnew(StyleBoxEmpty); Ref<StyleBoxEmpty> sbempty = memnew(StyleBoxEmpty);
for (int i = 0; i < hbc->get_child_count(); i++) { for (int i = 0; i < hbc->get_child_count(); i++) {
Control *child = Object::cast_to<Control>(hbc->get_child(i)); Control *child = Object::cast_to<Control>(hbc->get_child(i));
child->add_theme_style_override(SNAME("normal"), sbempty); child->add_theme_style_override("normal", sbempty);
child->add_theme_style_override(SNAME("hover"), sbempty); child->add_theme_style_override("hover", sbempty);
child->add_theme_style_override(SNAME("focus"), sbempty); child->add_theme_style_override("focus", sbempty);
child->add_theme_style_override(SNAME("pressed"), sbempty); child->add_theme_style_override("pressed", sbempty);
} }
HSeparator *separator = memnew(HSeparator); HSeparator *separator = memnew(HSeparator);
@ -1013,7 +1013,7 @@ void EditorAudioBuses::_notification(int p_what) {
switch (p_what) { switch (p_what) {
case NOTIFICATION_ENTER_TREE: case NOTIFICATION_ENTER_TREE:
case NOTIFICATION_THEME_CHANGED: { case NOTIFICATION_THEME_CHANGED: {
bus_scroll->add_theme_style_override(SNAME("bg"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); bus_scroll->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
} break; } break;
case NOTIFICATION_READY: { case NOTIFICATION_READY: {
_update_buses(); _update_buses();

View File

@ -839,7 +839,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
error_message = memnew(Label); error_message = memnew(Label);
error_message->hide(); error_message->hide();
error_message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); error_message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT);
error_message->add_theme_color_override(SNAME("font_color"), EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("error_color"), SNAME("Editor"))); error_message->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("error_color"), SNAME("Editor")));
add_child(error_message); add_child(error_message);
Label *l = memnew(Label); Label *l = memnew(Label);

View File

@ -955,7 +955,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() {
// Add some spacing above the help label. // Add some spacing above the help label.
Ref<StyleBoxEmpty> sb = memnew(StyleBoxEmpty); Ref<StyleBoxEmpty> sb = memnew(StyleBoxEmpty);
sb->set_default_margin(SIDE_TOP, 20 * EDSCALE); sb->set_default_margin(SIDE_TOP, 20 * EDSCALE);
no_profile_selected_help->add_theme_style_override(SNAME("normal"), sb); no_profile_selected_help->add_theme_style_override("normal", sb);
no_profile_selected_help->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); no_profile_selected_help->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
no_profile_selected_help->set_v_size_flags(Control::SIZE_EXPAND_FILL); no_profile_selected_help->set_v_size_flags(Control::SIZE_EXPAND_FILL);
h_split->add_child(no_profile_selected_help); h_split->add_child(no_profile_selected_help);

View File

@ -279,67 +279,67 @@ void editor_register_fonts(Ref<Theme> p_theme) {
p_theme->set_default_font(df); // Default theme font p_theme->set_default_font(df); // Default theme font
p_theme->set_default_font_size(default_font_size); p_theme->set_default_font_size(default_font_size);
p_theme->set_font_size(SNAME("main_size"), SNAME("EditorFonts"), default_font_size); p_theme->set_font_size("main_size", "EditorFonts", default_font_size);
p_theme->set_font(SNAME("main"), SNAME("EditorFonts"), df); p_theme->set_font("main", "EditorFonts", df);
// Bold font // Bold font
MAKE_BOLD_FONT(df_bold, String()); MAKE_BOLD_FONT(df_bold, String());
p_theme->set_font_size(SNAME("bold_size"), SNAME("EditorFonts"), default_font_size); p_theme->set_font_size("bold_size", "EditorFonts", default_font_size);
p_theme->set_font(SNAME("bold"), SNAME("EditorFonts"), df_bold); p_theme->set_font("bold", "EditorFonts", df_bold);
// Title font // Title font
p_theme->set_font_size(SNAME("title_size"), SNAME("EditorFonts"), default_font_size + 1 * EDSCALE); p_theme->set_font_size("title_size", "EditorFonts", default_font_size + 1 * EDSCALE);
p_theme->set_font(SNAME("title"), SNAME("EditorFonts"), df_bold); p_theme->set_font("title", "EditorFonts", df_bold);
p_theme->set_font_size(SNAME("main_button_font_size"), SNAME("EditorFonts"), default_font_size + 1 * EDSCALE); p_theme->set_font_size("main_button_font_size", "EditorFonts", default_font_size + 1 * EDSCALE);
p_theme->set_font(SNAME("main_button_font"), SNAME("EditorFonts"), df_bold); p_theme->set_font("main_button_font", "EditorFonts", df_bold);
p_theme->set_font(SNAME("font"), SNAME("Label"), df); p_theme->set_font("font", "Label", df);
p_theme->set_type_variation(SNAME("HeaderSmall"), SNAME("Label")); p_theme->set_type_variation("HeaderSmall", "Label");
p_theme->set_font(SNAME("font"), SNAME("HeaderSmall"), df_bold); p_theme->set_font("font", "HeaderSmall", df_bold);
p_theme->set_font_size(SNAME("font_size"), SNAME("HeaderSmall"), default_font_size); p_theme->set_font_size("font_size", "HeaderSmall", default_font_size);
p_theme->set_type_variation(SNAME("HeaderMedium"), SNAME("Label")); p_theme->set_type_variation("HeaderMedium", "Label");
p_theme->set_font(SNAME("font"), SNAME("HeaderMedium"), df_bold); p_theme->set_font("font", "HeaderMedium", df_bold);
p_theme->set_font_size(SNAME("font_size"), SNAME("HeaderMedium"), default_font_size + 1 * EDSCALE); p_theme->set_font_size("font_size", "HeaderMedium", default_font_size + 1 * EDSCALE);
p_theme->set_type_variation(SNAME("HeaderLarge"), SNAME("Label")); p_theme->set_type_variation("HeaderLarge", "Label");
p_theme->set_font(SNAME("font"), SNAME("HeaderLarge"), df_bold); p_theme->set_font("font", "HeaderLarge", df_bold);
p_theme->set_font_size(SNAME("font_size"), SNAME("HeaderLarge"), default_font_size + 3 * EDSCALE); p_theme->set_font_size("font_size", "HeaderLarge", default_font_size + 3 * EDSCALE);
// Documentation fonts // Documentation fonts
String code_font_custom_variations = EditorSettings::get_singleton()->get("interface/editor/code_font_custom_variations"); String code_font_custom_variations = EditorSettings::get_singleton()->get("interface/editor/code_font_custom_variations");
MAKE_SOURCE_FONT(df_code, code_font_custom_variations); MAKE_SOURCE_FONT(df_code, code_font_custom_variations);
p_theme->set_font_size(SNAME("doc_size"), SNAME("EditorFonts"), int(EDITOR_GET("text_editor/help/help_font_size")) * EDSCALE); p_theme->set_font_size("doc_size", "EditorFonts", int(EDITOR_GET("text_editor/help/help_font_size")) * EDSCALE);
p_theme->set_font(SNAME("doc"), SNAME("EditorFonts"), df); p_theme->set_font("doc", "EditorFonts", df);
p_theme->set_font_size(SNAME("doc_bold_size"), SNAME("EditorFonts"), int(EDITOR_GET("text_editor/help/help_font_size")) * EDSCALE); p_theme->set_font_size("doc_bold_size", "EditorFonts", int(EDITOR_GET("text_editor/help/help_font_size")) * EDSCALE);
p_theme->set_font(SNAME("doc_bold"), SNAME("EditorFonts"), df_bold); p_theme->set_font("doc_bold", "EditorFonts", df_bold);
p_theme->set_font_size(SNAME("doc_title_size"), SNAME("EditorFonts"), int(EDITOR_GET("text_editor/help/help_title_font_size")) * EDSCALE); p_theme->set_font_size("doc_title_size", "EditorFonts", int(EDITOR_GET("text_editor/help/help_title_font_size")) * EDSCALE);
p_theme->set_font(SNAME("doc_title"), SNAME("EditorFonts"), df_bold); p_theme->set_font("doc_title", "EditorFonts", df_bold);
p_theme->set_font_size(SNAME("doc_source_size"), SNAME("EditorFonts"), int(EDITOR_GET("text_editor/help/help_source_font_size")) * EDSCALE); p_theme->set_font_size("doc_source_size", "EditorFonts", int(EDITOR_GET("text_editor/help/help_source_font_size")) * EDSCALE);
p_theme->set_font(SNAME("doc_source"), SNAME("EditorFonts"), df_code); p_theme->set_font("doc_source", "EditorFonts", df_code);
p_theme->set_font_size(SNAME("doc_keyboard_size"), SNAME("EditorFonts"), (int(EDITOR_GET("text_editor/help/help_source_font_size")) - 1) * EDSCALE); p_theme->set_font_size("doc_keyboard_size", "EditorFonts", (int(EDITOR_GET("text_editor/help/help_source_font_size")) - 1) * EDSCALE);
p_theme->set_font(SNAME("doc_keyboard"), SNAME("EditorFonts"), df_code); p_theme->set_font("doc_keyboard", "EditorFonts", df_code);
// Ruler font // Ruler font
p_theme->set_font_size(SNAME("rulers_size"), SNAME("EditorFonts"), 8 * EDSCALE); p_theme->set_font_size("rulers_size", "EditorFonts", 8 * EDSCALE);
p_theme->set_font(SNAME("rulers"), SNAME("EditorFonts"), df); p_theme->set_font("rulers", "EditorFonts", df);
// Rotation widget font // Rotation widget font
p_theme->set_font_size(SNAME("rotation_control_size"), SNAME("EditorFonts"), 14 * EDSCALE); p_theme->set_font_size("rotation_control_size", "EditorFonts", 14 * EDSCALE);
p_theme->set_font(SNAME("rotation_control"), SNAME("EditorFonts"), df); p_theme->set_font("rotation_control", "EditorFonts", df);
// Code font // Code font
p_theme->set_font_size(SNAME("source_size"), SNAME("EditorFonts"), int(EDITOR_GET("interface/editor/code_font_size")) * EDSCALE); p_theme->set_font_size("source_size", "EditorFonts", int(EDITOR_GET("interface/editor/code_font_size")) * EDSCALE);
p_theme->set_font(SNAME("source"), SNAME("EditorFonts"), df_code); p_theme->set_font("source", "EditorFonts", df_code);
p_theme->set_font_size(SNAME("expression_size"), SNAME("EditorFonts"), (int(EDITOR_GET("interface/editor/code_font_size")) - 1) * EDSCALE); p_theme->set_font_size("expression_size", "EditorFonts", (int(EDITOR_GET("interface/editor/code_font_size")) - 1) * EDSCALE);
p_theme->set_font(SNAME("expression"), SNAME("EditorFonts"), df_code); p_theme->set_font("expression", "EditorFonts", df_code);
p_theme->set_font_size(SNAME("output_source_size"), SNAME("EditorFonts"), int(EDITOR_GET("run/output/font_size")) * EDSCALE); p_theme->set_font_size("output_source_size", "EditorFonts", int(EDITOR_GET("run/output/font_size")) * EDSCALE);
p_theme->set_font(SNAME("output_source"), SNAME("EditorFonts"), df_code); p_theme->set_font("output_source", "EditorFonts", df_code);
p_theme->set_font_size(SNAME("status_source_size"), SNAME("EditorFonts"), default_font_size); p_theme->set_font_size("status_source_size", "EditorFonts", default_font_size);
p_theme->set_font(SNAME("status_source"), SNAME("EditorFonts"), df_code); p_theme->set_font("status_source", "EditorFonts", df_code);
} }

View File

@ -54,10 +54,10 @@ void EditorHelp::_update_theme() {
qualifier_color = get_theme_color(SNAME("qualifier_color"), SNAME("EditorHelp")); qualifier_color = get_theme_color(SNAME("qualifier_color"), SNAME("EditorHelp"));
type_color = get_theme_color(SNAME("type_color"), SNAME("EditorHelp")); type_color = get_theme_color(SNAME("type_color"), SNAME("EditorHelp"));
class_desc->add_theme_color_override(SNAME("selection_color"), get_theme_color(SNAME("selection_color"), SNAME("EditorHelp"))); class_desc->add_theme_color_override("selection_color", get_theme_color(SNAME("selection_color"), SNAME("EditorHelp")));
class_desc->add_theme_constant_override(SNAME("line_separation"), get_theme_constant(SNAME("line_separation"), SNAME("EditorHelp"))); class_desc->add_theme_constant_override("line_separation", get_theme_constant(SNAME("line_separation"), SNAME("EditorHelp")));
class_desc->add_theme_constant_override(SNAME("table_hseparation"), get_theme_constant(SNAME("table_hseparation"), SNAME("EditorHelp"))); class_desc->add_theme_constant_override("table_hseparation", get_theme_constant(SNAME("table_hseparation"), SNAME("EditorHelp")));
class_desc->add_theme_constant_override(SNAME("table_vseparation"), get_theme_constant(SNAME("table_vseparation"), SNAME("EditorHelp"))); class_desc->add_theme_constant_override("table_vseparation", get_theme_constant(SNAME("table_vseparation"), SNAME("EditorHelp")));
doc_font = get_theme_font(SNAME("doc"), SNAME("EditorFonts")); doc_font = get_theme_font(SNAME("doc"), SNAME("EditorFonts"));
doc_bold_font = get_theme_font(SNAME("doc_bold"), SNAME("EditorFonts")); doc_bold_font = get_theme_font(SNAME("doc_bold"), SNAME("EditorFonts"));
@ -176,7 +176,7 @@ void EditorHelp::_class_desc_resized(bool p_force_update_theme) {
Ref<StyleBox> class_desc_stylebox = EditorNode::get_singleton()->get_theme_base()->get_theme_stylebox(SNAME("normal"), SNAME("RichTextLabel"))->duplicate(); Ref<StyleBox> class_desc_stylebox = EditorNode::get_singleton()->get_theme_base()->get_theme_stylebox(SNAME("normal"), SNAME("RichTextLabel"))->duplicate();
class_desc_stylebox->set_default_margin(SIDE_LEFT, display_margin); class_desc_stylebox->set_default_margin(SIDE_LEFT, display_margin);
class_desc_stylebox->set_default_margin(SIDE_RIGHT, display_margin); class_desc_stylebox->set_default_margin(SIDE_RIGHT, display_margin);
class_desc->add_theme_style_override(SNAME("normal"), class_desc_stylebox); class_desc->add_theme_style_override("normal", class_desc_stylebox);
} }
} }
@ -1872,7 +1872,7 @@ EditorHelp::EditorHelp() {
class_desc = memnew(RichTextLabel); class_desc = memnew(RichTextLabel);
add_child(class_desc); add_child(class_desc);
class_desc->set_v_size_flags(SIZE_EXPAND_FILL); class_desc->set_v_size_flags(SIZE_EXPAND_FILL);
class_desc->add_theme_color_override(SNAME("selection_color"), get_theme_color(SNAME("accent_color"), SNAME("Editor")) * Color(1, 1, 1, 0.4)); class_desc->add_theme_color_override("selection_color", get_theme_color(SNAME("accent_color"), SNAME("Editor")) * Color(1, 1, 1, 0.4));
class_desc->connect("meta_clicked", callable_mp(this, &EditorHelp::_class_desc_select)); class_desc->connect("meta_clicked", callable_mp(this, &EditorHelp::_class_desc_select));
class_desc->connect("gui_input", callable_mp(this, &EditorHelp::_class_desc_input)); class_desc->connect("gui_input", callable_mp(this, &EditorHelp::_class_desc_input));
@ -1951,7 +1951,7 @@ void EditorHelpBit::_notification(int p_what) {
switch (p_what) { switch (p_what) {
case NOTIFICATION_ENTER_TREE: case NOTIFICATION_ENTER_TREE:
case NOTIFICATION_THEME_CHANGED: { case NOTIFICATION_THEME_CHANGED: {
rich_text->add_theme_color_override(SNAME("selection_color"), get_theme_color(SNAME("selection_color"), SNAME("EditorHelp"))); rich_text->add_theme_color_override("selection_color", get_theme_color(SNAME("selection_color"), SNAME("EditorHelp")));
rich_text->clear(); rich_text->clear();
_add_text_to_rt(text, rich_text); _add_text_to_rt(text, rich_text);
rich_text->reset_size(); // Force recalculating size after parsing bbcode. rich_text->reset_size(); // Force recalculating size after parsing bbcode.
@ -2039,7 +2039,7 @@ void FindBar::_notification(int p_what) {
hide_button->set_hover_texture(get_theme_icon(SNAME("Close"), SNAME("EditorIcons"))); hide_button->set_hover_texture(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
hide_button->set_pressed_texture(get_theme_icon(SNAME("Close"), SNAME("EditorIcons"))); hide_button->set_pressed_texture(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size()); hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size());
matches_label->add_theme_color_override(SNAME("font_color"), results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor"))); matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor")));
} break; } break;
case NOTIFICATION_VISIBILITY_CHANGED: { case NOTIFICATION_VISIBILITY_CHANGED: {
set_process_unhandled_input(is_visible_in_tree()); set_process_unhandled_input(is_visible_in_tree());
@ -2110,7 +2110,7 @@ void FindBar::_update_matches_label() {
} else { } else {
matches_label->show(); matches_label->show();
matches_label->add_theme_color_override(SNAME("font_color"), results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor"))); matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor")));
matches_label->set_text(vformat(results_count == 1 ? TTR("%d match.") : TTR("%d matches."), results_count)); matches_label->set_text(vformat(results_count == 1 ? TTR("%d match.") : TTR("%d matches."), results_count));
} }
} }

View File

@ -38,7 +38,7 @@
void EditorHelpSearch::_update_icons() { void EditorHelpSearch::_update_icons() {
search_box->set_right_icon(results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); search_box->set_right_icon(results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
search_box->set_clear_button_enabled(true); search_box->set_clear_button_enabled(true);
search_box->add_theme_icon_override(SNAME("right_icon"), results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); search_box->add_theme_icon_override("right_icon", results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
case_sensitive_button->set_icon(results_tree->get_theme_icon(SNAME("MatchCase"), SNAME("EditorIcons"))); case_sensitive_button->set_icon(results_tree->get_theme_icon(SNAME("MatchCase"), SNAME("EditorIcons")));
hierarchy_button->set_icon(results_tree->get_theme_icon(SNAME("ClassList"), SNAME("EditorIcons"))); hierarchy_button->set_icon(results_tree->get_theme_icon(SNAME("ClassList"), SNAME("EditorIcons")));

View File

@ -1890,10 +1890,10 @@ void EditorInspectorArray::_setup() {
ae.margin->set_mouse_filter(MOUSE_FILTER_PASS); ae.margin->set_mouse_filter(MOUSE_FILTER_PASS);
if (is_inside_tree()) { if (is_inside_tree()) {
Size2 min_size = get_theme_stylebox(SNAME("Focus"), SNAME("EditorStyles"))->get_minimum_size(); Size2 min_size = get_theme_stylebox(SNAME("Focus"), SNAME("EditorStyles"))->get_minimum_size();
ae.margin->add_theme_constant_override(SNAME("margin_left"), min_size.x / 2); ae.margin->add_theme_constant_override("margin_left", min_size.x / 2);
ae.margin->add_theme_constant_override(SNAME("margin_top"), min_size.y / 2); ae.margin->add_theme_constant_override("margin_top", min_size.y / 2);
ae.margin->add_theme_constant_override(SNAME("margin_right"), min_size.x / 2); ae.margin->add_theme_constant_override("margin_right", min_size.x / 2);
ae.margin->add_theme_constant_override(SNAME("margin_bottom"), min_size.y / 2); ae.margin->add_theme_constant_override("margin_bottom", min_size.y / 2);
} }
ae.panel->add_child(ae.margin); ae.panel->add_child(ae.margin);
@ -1989,10 +1989,10 @@ void EditorInspectorArray::_notification(int p_what) {
ae.move_texture_rect->set_texture(get_theme_icon(SNAME("TripleBar"), SNAME("EditorIcons"))); ae.move_texture_rect->set_texture(get_theme_icon(SNAME("TripleBar"), SNAME("EditorIcons")));
Size2 min_size = get_theme_stylebox(SNAME("Focus"), SNAME("EditorStyles"))->get_minimum_size(); Size2 min_size = get_theme_stylebox(SNAME("Focus"), SNAME("EditorStyles"))->get_minimum_size();
ae.margin->add_theme_constant_override(SNAME("margin_left"), min_size.x / 2); ae.margin->add_theme_constant_override("margin_left", min_size.x / 2);
ae.margin->add_theme_constant_override(SNAME("margin_top"), min_size.y / 2); ae.margin->add_theme_constant_override("margin_top", min_size.y / 2);
ae.margin->add_theme_constant_override(SNAME("margin_right"), min_size.x / 2); ae.margin->add_theme_constant_override("margin_right", min_size.x / 2);
ae.margin->add_theme_constant_override(SNAME("margin_bottom"), min_size.y / 2); ae.margin->add_theme_constant_override("margin_bottom", min_size.y / 2);
} }
add_button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); add_button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
@ -2083,7 +2083,7 @@ EditorInspectorArray::EditorInspectorArray() {
add_child(rmb_popup); add_child(rmb_popup);
elements_vbox = memnew(VBoxContainer); elements_vbox = memnew(VBoxContainer);
elements_vbox->add_theme_constant_override(SNAME("separation"), 0); elements_vbox->add_theme_constant_override("separation", 0);
vbox->add_child(elements_vbox); vbox->add_child(elements_vbox);
add_button = memnew(Button); add_button = memnew(Button);
@ -2109,7 +2109,7 @@ EditorInspectorArray::EditorInspectorArray() {
page_line_edit = memnew(LineEdit); page_line_edit = memnew(LineEdit);
page_line_edit->connect("text_submitted", callable_mp(this, &EditorInspectorArray::_page_line_edit_text_submitted)); page_line_edit->connect("text_submitted", callable_mp(this, &EditorInspectorArray::_page_line_edit_text_submitted));
page_line_edit->add_theme_constant_override(SNAME("minimum_character_width"), 2); page_line_edit->add_theme_constant_override("minimum_character_width", 2);
hbox_pagination->add_child(page_line_edit); hbox_pagination->add_child(page_line_edit);
page_count_label = memnew(Label); page_count_label = memnew(Label);
@ -3020,9 +3020,9 @@ void EditorInspector::_update_inspector_bg() {
n = n->get_parent(); n = n->get_parent();
} }
count_subinspectors = MIN(15, count_subinspectors); count_subinspectors = MIN(15, count_subinspectors);
add_theme_style_override(SNAME("bg"), get_theme_stylebox("sub_inspector_bg" + itos(count_subinspectors), SNAME("Editor"))); add_theme_style_override("bg", get_theme_stylebox("sub_inspector_bg" + itos(count_subinspectors), SNAME("Editor")));
} else { } else {
add_theme_style_override(SNAME("bg"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
} }
} }
void EditorInspector::set_sub_inspector(bool p_enable) { void EditorInspector::set_sub_inspector(bool p_enable) {
@ -3551,7 +3551,7 @@ EditorInspector::EditorInspector() {
undo_redo = nullptr; undo_redo = nullptr;
main_vbox = memnew(VBoxContainer); main_vbox = memnew(VBoxContainer);
main_vbox->set_h_size_flags(SIZE_EXPAND_FILL); main_vbox->set_h_size_flags(SIZE_EXPAND_FILL);
main_vbox->add_theme_constant_override(SNAME("separation"), 0); main_vbox->add_theme_constant_override("separation", 0);
add_child(main_vbox); add_child(main_vbox);
set_horizontal_scroll_mode(SCROLL_MODE_DISABLED); set_horizontal_scroll_mode(SCROLL_MODE_DISABLED);

View File

@ -64,15 +64,15 @@ void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_f
void EditorLog::_update_theme() { void EditorLog::_update_theme() {
Ref<Font> normal_font = get_theme_font(SNAME("output_source"), SNAME("EditorFonts")); Ref<Font> normal_font = get_theme_font(SNAME("output_source"), SNAME("EditorFonts"));
if (normal_font.is_valid()) { if (normal_font.is_valid()) {
log->add_theme_font_override(SNAME("normal_font"), normal_font); log->add_theme_font_override("normal_font", normal_font);
} }
log->add_theme_font_size_override(SNAME("normal_font_size"), get_theme_font_size(SNAME("output_source_size"), SNAME("EditorFonts"))); log->add_theme_font_size_override("normal_font_size", get_theme_font_size(SNAME("output_source_size"), SNAME("EditorFonts")));
log->add_theme_color_override(SNAME("selection_color"), get_theme_color(SNAME("accent_color"), SNAME("Editor")) * Color(1, 1, 1, 0.4)); log->add_theme_color_override("selection_color", get_theme_color(SNAME("accent_color"), SNAME("Editor")) * Color(1, 1, 1, 0.4));
Ref<Font> bold_font = get_theme_font(SNAME("bold"), SNAME("EditorFonts")); Ref<Font> bold_font = get_theme_font(SNAME("bold"), SNAME("EditorFonts"));
if (bold_font.is_valid()) { if (bold_font.is_valid()) {
log->add_theme_font_override(SNAME("bold_font"), bold_font); log->add_theme_font_override("bold_font", bold_font);
} }
type_filter_map[MSG_TYPE_STD]->toggle_button->set_icon(get_theme_icon(SNAME("Popup"), SNAME("EditorIcons"))); type_filter_map[MSG_TYPE_STD]->toggle_button->set_icon(get_theme_icon(SNAME("Popup"), SNAME("EditorIcons")));

View File

@ -85,7 +85,7 @@ private:
toggle_button->set_text(itos(message_count)); toggle_button->set_text(itos(message_count));
toggle_button->set_tooltip(TTR(p_tooltip)); toggle_button->set_tooltip(TTR(p_tooltip));
// Don't tint the icon even when in "pressed" state. // Don't tint the icon even when in "pressed" state.
toggle_button->add_theme_color_override(SNAME("icon_color_pressed"), Color(1, 1, 1, 1)); toggle_button->add_theme_color_override("icon_color_pressed", Color(1, 1, 1, 1));
toggle_button->set_focus_mode(FOCUS_NONE); toggle_button->set_focus_mode(FOCUS_NONE);
// When toggled call the callback and pass the MessageType this button is for. // When toggled call the callback and pass the MessageType this button is for.
toggle_button->connect("toggled", p_toggled_callback, varray(type)); toggle_button->connect("toggled", p_toggled_callback, varray(type));

View File

@ -692,17 +692,17 @@ void EditorNode::_notification(int p_what) {
theme_base->set_theme(theme); theme_base->set_theme(theme);
gui_base->set_theme(theme); gui_base->set_theme(theme);
gui_base->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("Background"), SNAME("EditorStyles"))); gui_base->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("Background"), SNAME("EditorStyles")));
scene_root_parent->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("Content"), SNAME("EditorStyles"))); scene_root_parent->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("Content"), SNAME("EditorStyles")));
bottom_panel->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer"))); bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer")));
scene_tabs->add_theme_style_override(SNAME("tab_selected"), gui_base->get_theme_stylebox(SNAME("SceneTabFG"), SNAME("EditorStyles"))); scene_tabs->add_theme_style_override("tab_selected", gui_base->get_theme_stylebox(SNAME("SceneTabFG"), SNAME("EditorStyles")));
scene_tabs->add_theme_style_override(SNAME("tab_unselected"), gui_base->get_theme_stylebox(SNAME("SceneTabBG"), SNAME("EditorStyles"))); scene_tabs->add_theme_style_override("tab_unselected", gui_base->get_theme_stylebox(SNAME("SceneTabBG"), SNAME("EditorStyles")));
file_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); file_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
project_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); project_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
debug_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); debug_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
settings_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); settings_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
help_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); help_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
if (EDITOR_GET("interface/scene_tabs/resize_if_many_tabs")) { if (EDITOR_GET("interface/scene_tabs/resize_if_many_tabs")) {
scene_tabs->set_min_width(int(EDITOR_GET("interface/scene_tabs/minimum_width")) * EDSCALE); scene_tabs->set_min_width(int(EDITOR_GET("interface/scene_tabs/minimum_width")) * EDSCALE);
@ -715,7 +715,7 @@ void EditorNode::_notification(int p_what) {
// debugger area // debugger area
if (EditorDebuggerNode::get_singleton()->is_visible()) { if (EditorDebuggerNode::get_singleton()->is_visible()) {
bottom_panel->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))); bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles")));
} }
// update_icons // update_icons
@ -765,8 +765,8 @@ void EditorNode::_notification(int p_what) {
p->set_item_icon(p->get_item_index(HELP_SUPPORT_GODOT_DEVELOPMENT), gui_base->get_theme_icon(SNAME("Heart"), SNAME("EditorIcons"))); p->set_item_icon(p->get_item_index(HELP_SUPPORT_GODOT_DEVELOPMENT), gui_base->get_theme_icon(SNAME("Heart"), SNAME("EditorIcons")));
for (int i = 0; i < main_editor_buttons.size(); i++) { for (int i = 0; i < main_editor_buttons.size(); i++) {
main_editor_buttons.write[i]->add_theme_font_override(SNAME("font"), gui_base->get_theme_font(SNAME("main_button_font"), SNAME("EditorFonts"))); main_editor_buttons.write[i]->add_theme_font_override("font", gui_base->get_theme_font(SNAME("main_button_font"), SNAME("EditorFonts")));
main_editor_buttons.write[i]->add_theme_font_size_override(SNAME("font_size"), gui_base->get_theme_font_size(SNAME("main_button_font_size"), SNAME("EditorFonts"))); main_editor_buttons.write[i]->add_theme_font_size_override("font_size", gui_base->get_theme_font_size(SNAME("main_button_font_size"), SNAME("EditorFonts")));
} }
Set<String> updated_textfile_extensions; Set<String> updated_textfile_extensions;
@ -3183,8 +3183,8 @@ void EditorNode::add_editor_plugin(EditorPlugin *p_editor, bool p_config_changed
tb->set_icon(singleton->gui_base->get_theme_icon(p_editor->get_name(), SNAME("EditorIcons"))); tb->set_icon(singleton->gui_base->get_theme_icon(p_editor->get_name(), SNAME("EditorIcons")));
} }
tb->add_theme_font_override(SNAME("font"), singleton->gui_base->get_theme_font(SNAME("main_button_font"), SNAME("EditorFonts"))); tb->add_theme_font_override("font", singleton->gui_base->get_theme_font(SNAME("main_button_font"), SNAME("EditorFonts")));
tb->add_theme_font_size_override(SNAME("font_size"), singleton->gui_base->get_theme_font_size(SNAME("main_button_font_size"), SNAME("EditorFonts"))); tb->add_theme_font_size_override("font_size", singleton->gui_base->get_theme_font_size(SNAME("main_button_font_size"), SNAME("EditorFonts")));
singleton->main_editor_buttons.push_back(tb); singleton->main_editor_buttons.push_back(tb);
singleton->main_editor_button_vb->add_child(tb); singleton->main_editor_button_vb->add_child(tb);
@ -4250,10 +4250,10 @@ void EditorNode::_dock_make_float() {
window->add_child(p); window->add_child(p);
MarginContainer *margin = memnew(MarginContainer); MarginContainer *margin = memnew(MarginContainer);
margin->set_anchors_and_offsets_preset(Control::PRESET_WIDE); margin->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
margin->add_theme_constant_override(SNAME("margin_right"), borders.width); margin->add_theme_constant_override("margin_right", borders.width);
margin->add_theme_constant_override(SNAME("margin_top"), borders.height); margin->add_theme_constant_override("margin_top", borders.height);
margin->add_theme_constant_override(SNAME("margin_left"), borders.width); margin->add_theme_constant_override("margin_left", borders.width);
margin->add_theme_constant_override(SNAME("margin_bottom"), borders.height); margin->add_theme_constant_override("margin_bottom", borders.height);
window->add_child(margin); window->add_child(margin);
dock->set_anchors_and_offsets_preset(Control::PRESET_WIDE); dock->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
margin->add_child(dock); margin->add_child(dock);
@ -5198,9 +5198,9 @@ void EditorNode::_bottom_panel_switch(bool p_enable, int p_idx) {
bottom_panel_items[i].control->set_visible(i == p_idx); bottom_panel_items[i].control->set_visible(i == p_idx);
} }
if (EditorDebuggerNode::get_singleton() == bottom_panel_items[p_idx].control) { // this is the debug panel which uses tabs, so the top section should be smaller if (EditorDebuggerNode::get_singleton() == bottom_panel_items[p_idx].control) { // this is the debug panel which uses tabs, so the top section should be smaller
bottom_panel->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))); bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles")));
} else { } else {
bottom_panel->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer"))); bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer")));
} }
center_split->set_dragger_visibility(SplitContainer::DRAGGER_VISIBLE); center_split->set_dragger_visibility(SplitContainer::DRAGGER_VISIBLE);
center_split->set_collapsed(false); center_split->set_collapsed(false);
@ -5210,7 +5210,7 @@ void EditorNode::_bottom_panel_switch(bool p_enable, int p_idx) {
bottom_panel_raise->show(); bottom_panel_raise->show();
} else { } else {
bottom_panel->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer"))); bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer")));
bottom_panel_items[p_idx].button->set_pressed(false); bottom_panel_items[p_idx].button->set_pressed(false);
bottom_panel_items[p_idx].control->set_visible(false); bottom_panel_items[p_idx].control->set_visible(false);
center_split->set_dragger_visibility(SplitContainer::DRAGGER_HIDDEN); center_split->set_dragger_visibility(SplitContainer::DRAGGER_HIDDEN);
@ -5601,9 +5601,9 @@ void EditorNode::_bottom_panel_raise_toggled(bool p_pressed) {
void EditorNode::_update_rendering_driver_color() { void EditorNode::_update_rendering_driver_color() {
if (rendering_driver->get_text() == "opengl3") { if (rendering_driver->get_text() == "opengl3") {
rendering_driver->add_theme_color_override(SNAME("font_color"), Color::hex(0x5586a4ff)); rendering_driver->add_theme_color_override("font_color", Color::hex(0x5586a4ff));
} else if (rendering_driver->get_text() == "vulkan") { } else if (rendering_driver->get_text() == "vulkan") {
rendering_driver->add_theme_color_override(SNAME("font_color"), theme_base->get_theme_color(SNAME("vulkan_color"), SNAME("Editor"))); rendering_driver->add_theme_color_override("font_color", theme_base->get_theme_color(SNAME("vulkan_color"), SNAME("Editor")));
} }
} }
@ -6052,7 +6052,7 @@ EditorNode::EditorNode() {
theme_base->set_theme(theme); theme_base->set_theme(theme);
gui_base->set_theme(theme); gui_base->set_theme(theme);
gui_base->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("Background"), SNAME("EditorStyles"))); gui_base->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("Background"), SNAME("EditorStyles")));
resource_preview = memnew(EditorResourcePreview); resource_preview = memnew(EditorResourcePreview);
add_child(resource_preview); add_child(resource_preview);
@ -6067,7 +6067,7 @@ EditorNode::EditorNode() {
main_vbox = memnew(VBoxContainer); main_vbox = memnew(VBoxContainer);
gui_base->add_child(main_vbox); gui_base->add_child(main_vbox);
main_vbox->set_anchors_and_offsets_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 8); main_vbox->set_anchors_and_offsets_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 8);
main_vbox->add_theme_constant_override(SNAME("separation"), 8 * EDSCALE); main_vbox->add_theme_constant_override("separation", 8 * EDSCALE);
menu_hb = memnew(HBoxContainer); menu_hb = memnew(HBoxContainer);
main_vbox->add_child(menu_hb); main_vbox->add_child(menu_hb);
@ -6218,7 +6218,7 @@ EditorNode::EditorNode() {
VBoxContainer *srt = memnew(VBoxContainer); VBoxContainer *srt = memnew(VBoxContainer);
srt->set_v_size_flags(Control::SIZE_EXPAND_FILL); srt->set_v_size_flags(Control::SIZE_EXPAND_FILL);
top_split->add_child(srt); top_split->add_child(srt);
srt->add_theme_constant_override(SNAME("separation"), 0); srt->add_theme_constant_override("separation", 0);
tab_preview_panel = memnew(Panel); tab_preview_panel = memnew(Panel);
tab_preview_panel->set_size(Size2(100, 100) * EDSCALE); tab_preview_panel->set_size(Size2(100, 100) * EDSCALE);
@ -6236,8 +6236,8 @@ EditorNode::EditorNode() {
srt->add_child(tabbar_container); srt->add_child(tabbar_container);
scene_tabs = memnew(TabBar); scene_tabs = memnew(TabBar);
scene_tabs->add_theme_style_override(SNAME("tab_selected"), gui_base->get_theme_stylebox(SNAME("SceneTabFG"), SNAME("EditorStyles"))); scene_tabs->add_theme_style_override("tab_selected", gui_base->get_theme_stylebox(SNAME("SceneTabFG"), SNAME("EditorStyles")));
scene_tabs->add_theme_style_override(SNAME("tab_unselected"), gui_base->get_theme_stylebox(SNAME("SceneTabBG"), SNAME("EditorStyles"))); scene_tabs->add_theme_style_override("tab_unselected", gui_base->get_theme_stylebox(SNAME("SceneTabBG"), SNAME("EditorStyles")));
scene_tabs->set_select_with_rmb(true); scene_tabs->set_select_with_rmb(true);
scene_tabs->add_tab("unsaved"); scene_tabs->add_tab("unsaved");
scene_tabs->set_tab_alignment(TabBar::ALIGNMENT_LEFT); scene_tabs->set_tab_alignment(TabBar::ALIGNMENT_LEFT);
@ -6263,7 +6263,7 @@ EditorNode::EditorNode() {
scene_tab_add->set_flat(true); scene_tab_add->set_flat(true);
scene_tab_add->set_tooltip(TTR("Add a new scene.")); scene_tab_add->set_tooltip(TTR("Add a new scene."));
scene_tab_add->set_icon(gui_base->get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); scene_tab_add->set_icon(gui_base->get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
scene_tab_add->add_theme_color_override(SNAME("icon_normal_color"), Color(0.6f, 0.6f, 0.6f, 0.8f)); scene_tab_add->add_theme_color_override("icon_normal_color", Color(0.6f, 0.6f, 0.6f, 0.8f));
scene_tabs->add_child(scene_tab_add); scene_tabs->add_child(scene_tab_add);
scene_tab_add->connect("pressed", callable_mp(this, &EditorNode::_menu_option), make_binds(FILE_NEW_SCENE)); scene_tab_add->connect("pressed", callable_mp(this, &EditorNode::_menu_option), make_binds(FILE_NEW_SCENE));
@ -6285,7 +6285,7 @@ EditorNode::EditorNode() {
scene_root_parent = memnew(PanelContainer); scene_root_parent = memnew(PanelContainer);
scene_root_parent->set_custom_minimum_size(Size2(0, 80) * EDSCALE); scene_root_parent->set_custom_minimum_size(Size2(0, 80) * EDSCALE);
scene_root_parent->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("Content"), SNAME("EditorStyles"))); scene_root_parent->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("Content"), SNAME("EditorStyles")));
scene_root_parent->set_draw_behind_parent(true); scene_root_parent->set_draw_behind_parent(true);
srt->add_child(scene_root_parent); srt->add_child(scene_root_parent);
scene_root_parent->set_v_size_flags(Control::SIZE_EXPAND_FILL); scene_root_parent->set_v_size_flags(Control::SIZE_EXPAND_FILL);
@ -6299,7 +6299,7 @@ EditorNode::EditorNode() {
main_control = memnew(VBoxContainer); main_control = memnew(VBoxContainer);
main_control->set_v_size_flags(Control::SIZE_EXPAND_FILL); main_control->set_v_size_flags(Control::SIZE_EXPAND_FILL);
main_control->add_theme_constant_override(SNAME("separation"), 0); main_control->add_theme_constant_override("separation", 0);
scene_root_parent->add_child(main_control); scene_root_parent->add_child(main_control);
HBoxContainer *left_menu_hb = memnew(HBoxContainer); HBoxContainer *left_menu_hb = memnew(HBoxContainer);
@ -6309,7 +6309,7 @@ EditorNode::EditorNode() {
file_menu->set_flat(false); file_menu->set_flat(false);
file_menu->set_switch_on_hover(true); file_menu->set_switch_on_hover(true);
file_menu->set_text(TTR("Scene")); file_menu->set_text(TTR("Scene"));
file_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); file_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
left_menu_hb->add_child(file_menu); left_menu_hb->add_child(file_menu);
prev_scene = memnew(Button); prev_scene = memnew(Button);
@ -6425,7 +6425,7 @@ EditorNode::EditorNode() {
project_menu->set_switch_on_hover(true); project_menu->set_switch_on_hover(true);
project_menu->set_tooltip(TTR("Miscellaneous project or scene-wide tools.")); project_menu->set_tooltip(TTR("Miscellaneous project or scene-wide tools."));
project_menu->set_text(TTR("Project")); project_menu->set_text(TTR("Project"));
project_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); project_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
left_menu_hb->add_child(project_menu); left_menu_hb->add_child(project_menu);
p = project_menu->get_popup(); p = project_menu->get_popup();
@ -6475,7 +6475,7 @@ EditorNode::EditorNode() {
debug_menu->set_flat(false); debug_menu->set_flat(false);
debug_menu->set_switch_on_hover(true); debug_menu->set_switch_on_hover(true);
debug_menu->set_text(TTR("Debug")); debug_menu->set_text(TTR("Debug"));
debug_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); debug_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
left_menu_hb->add_child(debug_menu); left_menu_hb->add_child(debug_menu);
menu_hb->add_spacer(); menu_hb->add_spacer();
@ -6484,7 +6484,7 @@ EditorNode::EditorNode() {
settings_menu->set_flat(false); settings_menu->set_flat(false);
settings_menu->set_switch_on_hover(true); settings_menu->set_switch_on_hover(true);
settings_menu->set_text(TTR("Editor")); settings_menu->set_text(TTR("Editor"));
settings_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); settings_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
left_menu_hb->add_child(settings_menu); left_menu_hb->add_child(settings_menu);
p = settings_menu->get_popup(); p = settings_menu->get_popup();
@ -6532,7 +6532,7 @@ EditorNode::EditorNode() {
help_menu->set_flat(false); help_menu->set_flat(false);
help_menu->set_switch_on_hover(true); help_menu->set_switch_on_hover(true);
help_menu->set_text(TTR("Help")); help_menu->set_text(TTR("Help"));
help_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); help_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
left_menu_hb->add_child(help_menu); left_menu_hb->add_child(help_menu);
p = help_menu->get_popup(); p = help_menu->get_popup();
@ -6636,8 +6636,8 @@ EditorNode::EditorNode() {
rendering_driver->set_flat(true); rendering_driver->set_flat(true);
rendering_driver->set_focus_mode(Control::FOCUS_NONE); rendering_driver->set_focus_mode(Control::FOCUS_NONE);
rendering_driver->connect("item_selected", callable_mp(this, &EditorNode::_rendering_driver_selected)); rendering_driver->connect("item_selected", callable_mp(this, &EditorNode::_rendering_driver_selected));
rendering_driver->add_theme_font_override(SNAME("font"), gui_base->get_theme_font(SNAME("bold"), SNAME("EditorFonts"))); rendering_driver->add_theme_font_override("font", gui_base->get_theme_font(SNAME("bold"), SNAME("EditorFonts")));
rendering_driver->add_theme_font_size_override(SNAME("font_size"), gui_base->get_theme_font_size(SNAME("bold_size"), SNAME("EditorFonts"))); rendering_driver->add_theme_font_size_override("font_size", gui_base->get_theme_font_size(SNAME("bold_size"), SNAME("EditorFonts")));
right_menu_hb->add_child(rendering_driver); right_menu_hb->add_child(rendering_driver);
@ -6760,7 +6760,7 @@ EditorNode::EditorNode() {
// Bottom panels // Bottom panels
bottom_panel = memnew(PanelContainer); bottom_panel = memnew(PanelContainer);
bottom_panel->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer"))); bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer")));
center_split->add_child(bottom_panel); center_split->add_child(bottom_panel);
center_split->set_dragger_visibility(SplitContainer::DRAGGER_HIDDEN); center_split->set_dragger_visibility(SplitContainer::DRAGGER_HIDDEN);

View File

@ -181,7 +181,7 @@ void EditorPath::_notification(int p_what) {
update_path(); update_path();
sub_objects_icon->set_texture(get_theme_icon(SNAME("select_arrow"), SNAME("Tree"))); sub_objects_icon->set_texture(get_theme_icon(SNAME("select_arrow"), SNAME("Tree")));
current_object_label->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("main"), SNAME("EditorFonts"))); current_object_label->add_theme_font_override("font", get_theme_font(SNAME("main"), SNAME("EditorFonts")));
} break; } break;
case NOTIFICATION_READY: { case NOTIFICATION_READY: {
@ -198,8 +198,8 @@ EditorPath::EditorPath(EditorHistory *p_history) {
MarginContainer *main_mc = memnew(MarginContainer); MarginContainer *main_mc = memnew(MarginContainer);
main_mc->set_anchors_and_offsets_preset(PRESET_WIDE); main_mc->set_anchors_and_offsets_preset(PRESET_WIDE);
main_mc->add_theme_constant_override(SNAME("margin_left"), 4 * EDSCALE); main_mc->add_theme_constant_override("margin_left", 4 * EDSCALE);
main_mc->add_theme_constant_override(SNAME("margin_right"), 6 * EDSCALE); main_mc->add_theme_constant_override("margin_right", 6 * EDSCALE);
add_child(main_mc); add_child(main_mc);
HBoxContainer *main_hb = memnew(HBoxContainer); HBoxContainer *main_hb = memnew(HBoxContainer);

View File

@ -3087,18 +3087,18 @@ void EditorPropertyResource::_update_property_bg() {
} }
count_subinspectors = MIN(15, count_subinspectors); count_subinspectors = MIN(15, count_subinspectors);
add_theme_color_override(SNAME("property_color"), get_theme_color(SNAME("sub_inspector_property_color"), SNAME("Editor"))); add_theme_color_override("property_color", get_theme_color(SNAME("sub_inspector_property_color"), SNAME("Editor")));
add_theme_style_override(SNAME("bg_selected"), get_theme_stylebox("sub_inspector_property_bg_selected" + itos(count_subinspectors), SNAME("Editor"))); add_theme_style_override("bg_selected", get_theme_stylebox("sub_inspector_property_bg_selected" + itos(count_subinspectors), SNAME("Editor")));
add_theme_style_override(SNAME("bg"), get_theme_stylebox("sub_inspector_property_bg" + itos(count_subinspectors), SNAME("Editor"))); add_theme_style_override("bg", get_theme_stylebox("sub_inspector_property_bg" + itos(count_subinspectors), SNAME("Editor")));
add_theme_constant_override(SNAME("font_offset"), get_theme_constant(SNAME("sub_inspector_font_offset"), SNAME("Editor"))); add_theme_constant_override("font_offset", get_theme_constant(SNAME("sub_inspector_font_offset"), SNAME("Editor")));
add_theme_constant_override(SNAME("vseparation"), 0); add_theme_constant_override("vseparation", 0);
} else { } else {
add_theme_color_override(SNAME("property_color"), get_theme_color(SNAME("property_color"), SNAME("EditorProperty"))); add_theme_color_override("property_color", get_theme_color(SNAME("property_color"), SNAME("EditorProperty")));
add_theme_style_override(SNAME("bg_selected"), get_theme_stylebox(SNAME("bg_selected"), SNAME("EditorProperty"))); add_theme_style_override("bg_selected", get_theme_stylebox(SNAME("bg_selected"), SNAME("EditorProperty")));
add_theme_style_override(SNAME("bg"), get_theme_stylebox(SNAME("bg"), SNAME("EditorProperty"))); add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("EditorProperty")));
add_theme_constant_override(SNAME("vseparation"), get_theme_constant(SNAME("vseparation"), SNAME("EditorProperty"))); add_theme_constant_override("vseparation", get_theme_constant(SNAME("vseparation"), SNAME("EditorProperty")));
add_theme_constant_override(SNAME("font_offset"), get_theme_constant(SNAME("font_offset"), SNAME("EditorProperty"))); add_theme_constant_override("font_offset", get_theme_constant(SNAME("font_offset"), SNAME("EditorProperty")));
} }
updating_theme = false; updating_theme = false;

View File

@ -1082,7 +1082,7 @@ void EditorPropertyDictionary::update_property() {
} }
flat->set_bg_color(get_theme_color(SNAME("prop_subsection"), SNAME("Editor"))); flat->set_bg_color(get_theme_color(SNAME("prop_subsection"), SNAME("Editor")));
pc->add_theme_style_override(SNAME("panel"), flat); pc->add_theme_style_override("panel", flat);
add_vbox = memnew(VBoxContainer); add_vbox = memnew(VBoxContainer);
pc->add_child(add_vbox); pc->add_child(add_vbox);
} }

View File

@ -302,7 +302,7 @@ SectionedInspector::SectionedInspector() :
sections(memnew(Tree)), sections(memnew(Tree)),
filter(memnew(SectionedInspectorFilter)), filter(memnew(SectionedInspectorFilter)),
inspector(memnew(EditorInspector)) { inspector(memnew(EditorInspector)) {
add_theme_constant_override(SNAME("autohide"), 1); // Fixes the dragger always showing up add_theme_constant_override("autohide", 1); // Fixes the dragger always showing up
VBoxContainer *left_vb = memnew(VBoxContainer); VBoxContainer *left_vb = memnew(VBoxContainer);
left_vb->set_custom_minimum_size(Size2(190, 0) * EDSCALE); left_vb->set_custom_minimum_size(Size2(190, 0) * EDSCALE);

View File

@ -182,9 +182,9 @@ void EditorSettingsDialog::_update_icons() {
shortcut_search_box->set_clear_button_enabled(true); shortcut_search_box->set_clear_button_enabled(true);
restart_close_button->set_icon(shortcuts->get_theme_icon(SNAME("Close"), SNAME("EditorIcons"))); restart_close_button->set_icon(shortcuts->get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
restart_container->add_theme_style_override(SNAME("panel"), shortcuts->get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); restart_container->add_theme_style_override("panel", shortcuts->get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
restart_icon->set_texture(shortcuts->get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons"))); restart_icon->set_texture(shortcuts->get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons")));
restart_label->add_theme_color_override(SNAME("font_color"), shortcuts->get_theme_color(SNAME("warning_color"), SNAME("Editor"))); restart_label->add_theme_color_override("font_color", shortcuts->get_theme_color(SNAME("warning_color"), SNAME("Editor")));
} }
void EditorSettingsDialog::_event_config_confirmed() { void EditorSettingsDialog::_event_config_confirmed() {

View File

@ -268,7 +268,7 @@ void EditorSpinSlider::_update_value_input_stylebox() {
stylebox->set_default_margin(SIDE_RIGHT, 0); stylebox->set_default_margin(SIDE_RIGHT, 0);
} }
value_input->add_theme_style_override(SNAME("normal"), stylebox); value_input->add_theme_style_override("normal", stylebox);
} }
void EditorSpinSlider::_draw_spin_slider() { void EditorSpinSlider::_draw_spin_slider() {

File diff suppressed because it is too large Load Diff

View File

@ -333,13 +333,13 @@ Control *EditorToaster::popup(Control *p_control, Severity p_severity, double p_
panel->set_tooltip(p_tooltip); panel->set_tooltip(p_tooltip);
switch (p_severity) { switch (p_severity) {
case SEVERITY_INFO: case SEVERITY_INFO:
panel->add_theme_style_override(SNAME("panel"), info_panel_style_background); panel->add_theme_style_override("panel", info_panel_style_background);
break; break;
case SEVERITY_WARNING: case SEVERITY_WARNING:
panel->add_theme_style_override(SNAME("panel"), warning_panel_style_background); panel->add_theme_style_override("panel", warning_panel_style_background);
break; break;
case SEVERITY_ERROR: case SEVERITY_ERROR:
panel->add_theme_style_override(SNAME("panel"), error_panel_style_background); panel->add_theme_style_override("panel", error_panel_style_background);
break; break;
default: default:
break; break;
@ -508,7 +508,7 @@ EditorToaster::EditorToaster() {
// Disable notification button. // Disable notification button.
disable_notifications_panel = memnew(PanelContainer); disable_notifications_panel = memnew(PanelContainer);
disable_notifications_panel->set_as_top_level(true); disable_notifications_panel->set_as_top_level(true);
disable_notifications_panel->add_theme_style_override(SNAME("panel"), info_panel_style_background); disable_notifications_panel->add_theme_style_override("panel", info_panel_style_background);
add_child(disable_notifications_panel); add_child(disable_notifications_panel);
disable_notifications_button = memnew(Button); disable_notifications_button = memnew(Button);

View File

@ -176,9 +176,9 @@ EditorZoomWidget::EditorZoomWidget() {
zoom_reset = memnew(Button); zoom_reset = memnew(Button);
zoom_reset->set_flat(true); zoom_reset->set_flat(true);
add_child(zoom_reset); add_child(zoom_reset);
zoom_reset->add_theme_constant_override(SNAME("outline_size"), 1); zoom_reset->add_theme_constant_override("outline_size", 1);
zoom_reset->add_theme_color_override(SNAME("font_outline_color"), Color(0, 0, 0)); zoom_reset->add_theme_color_override("font_outline_color", Color(0, 0, 0));
zoom_reset->add_theme_color_override(SNAME("font_color"), Color(1, 1, 1)); zoom_reset->add_theme_color_override("font_color", Color(1, 1, 1));
zoom_reset->connect("pressed", callable_mp(this, &EditorZoomWidget::_button_zoom_reset)); zoom_reset->connect("pressed", callable_mp(this, &EditorZoomWidget::_button_zoom_reset));
zoom_reset->set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_reset", TTR("Zoom Reset"), KeyModifierMask::CMD | Key::KEY_0)); zoom_reset->set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_reset", TTR("Zoom Reset"), KeyModifierMask::CMD | Key::KEY_0));
zoom_reset->set_shortcut_context(this); zoom_reset->set_shortcut_context(this);
@ -197,5 +197,5 @@ EditorZoomWidget::EditorZoomWidget() {
_update_zoom_label(); _update_zoom_label();
add_theme_constant_override(SNAME("separation"), Math::round(-8 * EDSCALE)); add_theme_constant_override("separation", Math::round(-8 * EDSCALE));
} }

View File

@ -357,9 +357,9 @@ void ExportTemplateManager::_set_current_progress_status(const String &p_status,
download_progress_label->set_text(p_status); download_progress_label->set_text(p_status);
if (p_error) { if (p_error) {
download_progress_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); download_progress_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
} else { } else {
download_progress_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("font_color"), SNAME("Label"))); download_progress_label->add_theme_color_override("font_color", get_theme_color(SNAME("font_color"), SNAME("Label")));
} }
} }
@ -744,9 +744,9 @@ void ExportTemplateManager::_notification(int p_what) {
switch (p_what) { switch (p_what) {
case NOTIFICATION_ENTER_TREE: case NOTIFICATION_ENTER_TREE:
case NOTIFICATION_THEME_CHANGED: { case NOTIFICATION_THEME_CHANGED: {
current_value->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("main"), SNAME("EditorFonts"))); current_value->add_theme_font_override("font", get_theme_font(SNAME("main"), SNAME("EditorFonts")));
current_missing_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); current_missing_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
current_installed_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("disabled_font_color"), SNAME("Editor"))); current_installed_label->add_theme_color_override("font_color", get_theme_color(SNAME("disabled_font_color"), SNAME("Editor")));
mirror_options_button->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons"))); mirror_options_button->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons")));
} break; } break;

View File

@ -2829,7 +2829,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) {
add_child(top_vbc); add_child(top_vbc);
HBoxContainer *toolbar_hbc = memnew(HBoxContainer); HBoxContainer *toolbar_hbc = memnew(HBoxContainer);
toolbar_hbc->add_theme_constant_override(SNAME("separation"), 0); toolbar_hbc->add_theme_constant_override("separation", 0);
top_vbc->add_child(toolbar_hbc); top_vbc->add_child(toolbar_hbc);
button_hist_prev = memnew(Button); button_hist_prev = memnew(Button);
@ -2868,7 +2868,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) {
toolbar_hbc->add_child(button_toggle_display_mode); toolbar_hbc->add_child(button_toggle_display_mode);
toolbar2_hbc = memnew(HBoxContainer); toolbar2_hbc = memnew(HBoxContainer);
toolbar2_hbc->add_theme_constant_override(SNAME("separation"), 0); toolbar2_hbc->add_theme_constant_override("separation", 0);
top_vbc->add_child(toolbar2_hbc); top_vbc->add_child(toolbar2_hbc);
tree_search_box = memnew(LineEdit); tree_search_box = memnew(LineEdit);

View File

@ -567,8 +567,8 @@ FindInFilesPanel::FindInFilesPanel() {
hbc->add_child(find_label); hbc->add_child(find_label);
_search_text_label = memnew(Label); _search_text_label = memnew(Label);
_search_text_label->add_theme_font_override(SNAME("font"), EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("source"), SNAME("EditorFonts"))); _search_text_label->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("source"), SNAME("EditorFonts")));
_search_text_label->add_theme_font_size_override(SNAME("font_size"), EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("source_size"), SNAME("EditorFonts"))); _search_text_label->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("source_size"), SNAME("EditorFonts")));
hbc->add_child(_search_text_label); hbc->add_child(_search_text_label);
_progress_bar = memnew(ProgressBar); _progress_bar = memnew(ProgressBar);
@ -596,8 +596,8 @@ FindInFilesPanel::FindInFilesPanel() {
} }
_results_display = memnew(Tree); _results_display = memnew(Tree);
_results_display->add_theme_font_override(SNAME("font"), EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("source"), SNAME("EditorFonts"))); _results_display->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("source"), SNAME("EditorFonts")));
_results_display->add_theme_font_size_override(SNAME("font_size"), EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("source_size"), SNAME("EditorFonts"))); _results_display->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("source_size"), SNAME("EditorFonts")));
_results_display->set_v_size_flags(SIZE_EXPAND_FILL); _results_display->set_v_size_flags(SIZE_EXPAND_FILL);
_results_display->connect("item_selected", callable_mp(this, &FindInFilesPanel::_on_result_selected)); _results_display->connect("item_selected", callable_mp(this, &FindInFilesPanel::_on_result_selected));
_results_display->connect("item_edited", callable_mp(this, &FindInFilesPanel::_on_item_edited)); _results_display->connect("item_edited", callable_mp(this, &FindInFilesPanel::_on_item_edited));
@ -689,8 +689,8 @@ void FindInFilesPanel::_notification(int p_what) {
if (p_what == NOTIFICATION_PROCESS) { if (p_what == NOTIFICATION_PROCESS) {
_progress_bar->set_as_ratio(_finder->get_progress()); _progress_bar->set_as_ratio(_finder->get_progress());
} else if (p_what == NOTIFICATION_THEME_CHANGED) { } else if (p_what == NOTIFICATION_THEME_CHANGED) {
_search_text_label->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("source"), SNAME("EditorFonts"))); _search_text_label->add_theme_font_override("font", get_theme_font(SNAME("source"), SNAME("EditorFonts")));
_results_display->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("source"), SNAME("EditorFonts"))); _results_display->add_theme_font_override("font", get_theme_font(SNAME("source"), SNAME("EditorFonts")));
} }
} }

View File

@ -448,7 +448,7 @@ GroupDialog::GroupDialog() {
groups->set_allow_reselect(true); groups->set_allow_reselect(true);
groups->set_allow_rmb_select(true); groups->set_allow_rmb_select(true);
groups->set_v_size_flags(Control::SIZE_EXPAND_FILL); groups->set_v_size_flags(Control::SIZE_EXPAND_FILL);
groups->add_theme_constant_override(SNAME("draw_guides"), 1); groups->add_theme_constant_override("draw_guides", 1);
groups->connect("item_selected", callable_mp(this, &GroupDialog::_group_selected)); groups->connect("item_selected", callable_mp(this, &GroupDialog::_group_selected));
groups->connect("button_pressed", callable_mp(this, &GroupDialog::_modify_group_pressed)); groups->connect("button_pressed", callable_mp(this, &GroupDialog::_modify_group_pressed));
groups->connect("item_edited", callable_mp(this, &GroupDialog::_group_renamed)); groups->connect("item_edited", callable_mp(this, &GroupDialog::_group_renamed));
@ -484,10 +484,10 @@ GroupDialog::GroupDialog() {
nodes_to_add->set_hide_folding(true); nodes_to_add->set_hide_folding(true);
nodes_to_add->set_select_mode(Tree::SELECT_MULTI); nodes_to_add->set_select_mode(Tree::SELECT_MULTI);
nodes_to_add->set_v_size_flags(Control::SIZE_EXPAND_FILL); nodes_to_add->set_v_size_flags(Control::SIZE_EXPAND_FILL);
nodes_to_add->add_theme_constant_override(SNAME("draw_guides"), 1); nodes_to_add->add_theme_constant_override("draw_guides", 1);
HBoxContainer *add_filter_hbc = memnew(HBoxContainer); HBoxContainer *add_filter_hbc = memnew(HBoxContainer);
add_filter_hbc->add_theme_constant_override(SNAME("separate"), 0); add_filter_hbc->add_theme_constant_override("separate", 0);
vbc_add->add_child(add_filter_hbc); vbc_add->add_child(add_filter_hbc);
add_filter = memnew(LineEdit); add_filter = memnew(LineEdit);
@ -534,10 +534,10 @@ GroupDialog::GroupDialog() {
nodes_to_remove->set_hide_root(true); nodes_to_remove->set_hide_root(true);
nodes_to_remove->set_hide_folding(true); nodes_to_remove->set_hide_folding(true);
nodes_to_remove->set_select_mode(Tree::SELECT_MULTI); nodes_to_remove->set_select_mode(Tree::SELECT_MULTI);
nodes_to_remove->add_theme_constant_override(SNAME("draw_guides"), 1); nodes_to_remove->add_theme_constant_override("draw_guides", 1);
HBoxContainer *remove_filter_hbc = memnew(HBoxContainer); HBoxContainer *remove_filter_hbc = memnew(HBoxContainer);
remove_filter_hbc->add_theme_constant_override(SNAME("separate"), 0); remove_filter_hbc->add_theme_constant_override("separate", 0);
vbc_remove->add_child(remove_filter_hbc); vbc_remove->add_child(remove_filter_hbc);
remove_filter = memnew(LineEdit); remove_filter = memnew(LineEdit);
@ -733,8 +733,8 @@ GroupsEditor::GroupsEditor() {
tree->set_v_size_flags(Control::SIZE_EXPAND_FILL); tree->set_v_size_flags(Control::SIZE_EXPAND_FILL);
vbc->add_child(tree); vbc->add_child(tree);
tree->connect("button_pressed", callable_mp(this, &GroupsEditor::_modify_group)); tree->connect("button_pressed", callable_mp(this, &GroupsEditor::_modify_group));
tree->add_theme_constant_override(SNAME("draw_guides"), 1); tree->add_theme_constant_override("draw_guides", 1);
add_theme_constant_override(SNAME("separation"), 3 * EDSCALE); add_theme_constant_override("separation", 3 * EDSCALE);
_group_name_changed(""); _group_name_changed("");
} }

View File

@ -481,7 +481,7 @@ void DynamicFontImportSettings::_main_prop_changed(const String &p_edited_proper
font_preview->get_data(0)->set_oversampling(import_settings_data->get("oversampling")); font_preview->get_data(0)->set_oversampling(import_settings_data->get("oversampling"));
} }
} }
font_preview_label->add_theme_font_override(SNAME("font"), font_preview); font_preview_label->add_theme_font_override("font", font_preview);
font_preview_label->update(); font_preview_label->update();
} }
@ -1036,7 +1036,7 @@ void DynamicFontImportSettings::open_settings(const String &p_path) {
font_main.instantiate(); font_main.instantiate();
font_main->add_data(dfont_main); font_main->add_data(dfont_main);
text_edit->add_theme_font_override(SNAME("font"), font_main); text_edit->add_theme_font_override("font", font_main);
base_path = p_path; base_path = p_path;
@ -1263,7 +1263,7 @@ void DynamicFontImportSettings::open_settings(const String &p_path) {
font_preview->get_data(0)->set_hinting((TextServer::Hinting)import_settings_data->get("hinting").operator int()); font_preview->get_data(0)->set_hinting((TextServer::Hinting)import_settings_data->get("hinting").operator int());
font_preview->get_data(0)->set_oversampling(import_settings_data->get("oversampling")); font_preview->get_data(0)->set_oversampling(import_settings_data->get("oversampling"));
} }
font_preview_label->add_theme_font_override(SNAME("font"), font_preview); font_preview_label->add_theme_font_override("font", font_preview);
font_preview_label->update(); font_preview_label->update();
menu_ot->clear(); menu_ot->clear();
@ -1372,7 +1372,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() {
label_warn->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); label_warn->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
label_warn->set_text(""); label_warn->set_text("");
root_vb->add_child(label_warn); root_vb->add_child(label_warn);
label_warn->add_theme_color_override(SNAME("font_color"), warn_color); label_warn->add_theme_color_override("font_color", warn_color);
label_warn->hide(); label_warn->hide();
// Page 1 layout: Rendering Options // Page 1 layout: Rendering Options
@ -1392,7 +1392,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() {
page1_vb->add_child(page1_hb); page1_vb->add_child(page1_hb);
font_preview_label = memnew(Label); font_preview_label = memnew(Label);
font_preview_label->add_theme_font_size_override(SNAME("font_size"), 200 * EDSCALE); font_preview_label->add_theme_font_size_override("font_size", 200 * EDSCALE);
font_preview_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); font_preview_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
font_preview_label->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); font_preview_label->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER);
font_preview_label->set_autowrap_mode(Label::AUTOWRAP_ARBITRARY); font_preview_label->set_autowrap_mode(Label::AUTOWRAP_ARBITRARY);
@ -1545,9 +1545,9 @@ DynamicFontImportSettings::DynamicFontImportSettings() {
for (int i = 0; i < 16; i++) { for (int i = 0; i < 16; i++) {
glyph_table->set_column_title(i + 1, String::num_int64(i, 16)); glyph_table->set_column_title(i + 1, String::num_int64(i, 16));
} }
glyph_table->add_theme_style_override(SNAME("selected"), glyph_table->get_theme_stylebox(SNAME("bg"))); glyph_table->add_theme_style_override("selected", glyph_table->get_theme_stylebox(SNAME("bg")));
glyph_table->add_theme_style_override(SNAME("selected_focus"), glyph_table->get_theme_stylebox(SNAME("bg"))); glyph_table->add_theme_style_override("selected_focus", glyph_table->get_theme_stylebox(SNAME("bg")));
glyph_table->add_theme_constant_override(SNAME("hseparation"), 0); glyph_table->add_theme_constant_override("hseparation", 0);
glyph_table->set_h_size_flags(Control::SIZE_EXPAND_FILL); glyph_table->set_h_size_flags(Control::SIZE_EXPAND_FILL);
glyph_table->set_v_size_flags(Control::SIZE_EXPAND_FILL); glyph_table->set_v_size_flags(Control::SIZE_EXPAND_FILL);

View File

@ -561,12 +561,12 @@ void ImportDock::_reimport() {
void ImportDock::_notification(int p_what) { void ImportDock::_notification(int p_what) {
switch (p_what) { switch (p_what) {
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
imported->add_theme_style_override(SNAME("normal"), get_theme_stylebox(SNAME("normal"), SNAME("LineEdit"))); imported->add_theme_style_override("normal", get_theme_stylebox(SNAME("normal"), SNAME("LineEdit")));
} break; } break;
case NOTIFICATION_ENTER_TREE: { case NOTIFICATION_ENTER_TREE: {
import_opts->edit(params); import_opts->edit(params);
label_warning->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("warning_color"), SNAME("Editor"))); label_warning->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
} break; } break;
} }
} }
@ -579,12 +579,12 @@ void ImportDock::_set_dirty(bool p_dirty) {
if (p_dirty) { if (p_dirty) {
// Add a dirty marker to notify the user that they should reimport the selected resource to see changes. // Add a dirty marker to notify the user that they should reimport the selected resource to see changes.
import->set_text(TTR("Reimport") + " (*)"); import->set_text(TTR("Reimport") + " (*)");
import->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("warning_color"), SNAME("Editor"))); import->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
import->set_tooltip(TTR("You have pending changes that haven't been applied yet. Click Reimport to apply changes made to the import options.\nSelecting another resource in the FileSystem dock without clicking Reimport first will discard changes made in the Import dock.")); import->set_tooltip(TTR("You have pending changes that haven't been applied yet. Click Reimport to apply changes made to the import options.\nSelecting another resource in the FileSystem dock without clicking Reimport first will discard changes made in the Import dock."));
} else { } else {
// Remove the dirty marker on the Reimport button. // Remove the dirty marker on the Reimport button.
import->set_text(TTR("Reimport")); import->set_text(TTR("Reimport"));
import->remove_theme_color_override(SNAME("font_color")); import->remove_theme_color_override("font_color");
import->set_tooltip(""); import->set_tooltip("");
} }
} }
@ -617,7 +617,7 @@ ImportDock::ImportDock() {
content->hide(); content->hide();
imported = memnew(Label); imported = memnew(Label);
imported->add_theme_style_override(SNAME("normal"), EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("normal"), SNAME("LineEdit"))); imported->add_theme_style_override("normal", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("normal"), SNAME("LineEdit")));
imported->set_clip_text(true); imported->set_clip_text(true);
content->add_child(imported); content->add_child(imported);
HBoxContainer *hb = memnew(HBoxContainer); HBoxContainer *hb = memnew(HBoxContainer);

View File

@ -422,7 +422,7 @@ void InspectorDock::_notification(int p_what) {
object_menu->set_icon(get_theme_icon(SNAME("Tools"), SNAME("EditorIcons"))); object_menu->set_icon(get_theme_icon(SNAME("Tools"), SNAME("EditorIcons")));
search->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); search->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
warning->set_icon(get_theme_icon(SNAME("NodeWarning"), SNAME("EditorIcons"))); warning->set_icon(get_theme_icon(SNAME("NodeWarning"), SNAME("EditorIcons")));
warning->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("warning_color"), SNAME("Editor"))); warning->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
} break; } break;
} }
} }

View File

@ -530,9 +530,9 @@ void AnimationNodeBlendSpace1DEditor::_open_editor() {
void AnimationNodeBlendSpace1DEditor::_notification(int p_what) { void AnimationNodeBlendSpace1DEditor::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
error_panel->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
error_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
panel->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
tool_blend->set_icon(get_theme_icon(SNAME("EditPivot"), SNAME("EditorIcons"))); tool_blend->set_icon(get_theme_icon(SNAME("EditPivot"), SNAME("EditorIcons")));
tool_select->set_icon(get_theme_icon(SNAME("ToolSelect"), SNAME("EditorIcons"))); tool_select->set_icon(get_theme_icon(SNAME("ToolSelect"), SNAME("EditorIcons")));
tool_create->set_icon(get_theme_icon(SNAME("EditKey"), SNAME("EditorIcons"))); tool_create->set_icon(get_theme_icon(SNAME("EditKey"), SNAME("EditorIcons")));

View File

@ -730,9 +730,9 @@ void AnimationNodeBlendSpace2DEditor::_edit_point_pos(double) {
void AnimationNodeBlendSpace2DEditor::_notification(int p_what) { void AnimationNodeBlendSpace2DEditor::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
error_panel->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
error_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
panel->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
tool_blend->set_icon(get_theme_icon(SNAME("EditPivot"), SNAME("EditorIcons"))); tool_blend->set_icon(get_theme_icon(SNAME("EditPivot"), SNAME("EditorIcons")));
tool_select->set_icon(get_theme_icon(SNAME("ToolSelect"), SNAME("EditorIcons"))); tool_select->set_icon(get_theme_icon(SNAME("ToolSelect"), SNAME("EditorIcons")));
tool_create->set_icon(get_theme_icon(SNAME("EditKey"), SNAME("EditorIcons"))); tool_create->set_icon(get_theme_icon(SNAME("EditKey"), SNAME("EditorIcons")));

View File

@ -243,10 +243,10 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
mono_color.a = 0.85; mono_color.a = 0.85;
c = mono_color; c = mono_color;
node->add_theme_color_override(SNAME("title_color"), c); node->add_theme_color_override("title_color", c);
c.a = 0.7; c.a = 0.7;
node->add_theme_color_override(SNAME("close_color"), c); node->add_theme_color_override("close_color", c);
node->add_theme_color_override(SNAME("resizer_color"), c); node->add_theme_color_override("resizer_color", c);
} }
List<AnimationNodeBlendTree::NodeConnection> connections; List<AnimationNodeBlendTree::NodeConnection> connections;
@ -739,8 +739,8 @@ void AnimationNodeBlendTreeEditor::_notification(int p_what) {
} }
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
error_panel->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
error_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
if (p_what == NOTIFICATION_THEME_CHANGED && is_visible_in_tree()) { if (p_what == NOTIFICATION_THEME_CHANGED && is_visible_in_tree()) {
_update_graph(); _update_graph();

View File

@ -101,10 +101,10 @@ void AnimationPlayerEditor::_notification(int p_what) {
get_tree()->connect("node_removed", callable_mp(this, &AnimationPlayerEditor::_node_removed)); get_tree()->connect("node_removed", callable_mp(this, &AnimationPlayerEditor::_node_removed));
add_theme_style_override(SNAME("panel"), editor->get_gui_base()->get_theme_stylebox(SNAME("panel"), SNAME("Panel"))); add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox(SNAME("panel"), SNAME("Panel")));
} break; } break;
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
add_theme_style_override(SNAME("panel"), editor->get_gui_base()->get_theme_stylebox(SNAME("panel"), SNAME("Panel"))); add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox(SNAME("panel"), SNAME("Panel")));
} break; } break;
case NOTIFICATION_TRANSLATION_CHANGED: case NOTIFICATION_TRANSLATION_CHANGED:
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED: case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
@ -137,8 +137,8 @@ void AnimationPlayerEditor::_notification(int p_what) {
pin->set_icon(get_theme_icon(SNAME("Pin"), SNAME("EditorIcons"))); pin->set_icon(get_theme_icon(SNAME("Pin"), SNAME("EditorIcons")));
tool_anim->add_theme_style_override(SNAME("normal"), get_theme_stylebox(SNAME("normal"), SNAME("Button"))); tool_anim->add_theme_style_override("normal", get_theme_stylebox(SNAME("normal"), SNAME("Button")));
track_editor->get_edit_menu()->add_theme_style_override(SNAME("normal"), get_theme_stylebox(SNAME("normal"), SNAME("Button"))); track_editor->get_edit_menu()->add_theme_style_override("normal", get_theme_stylebox(SNAME("normal"), SNAME("Button")));
#define ITEM_ICON(m_item, m_icon) tool_anim->get_popup()->set_item_icon(tool_anim->get_popup()->get_item_index(m_item), get_theme_icon(SNAME(m_icon), SNAME("EditorIcons"))) #define ITEM_ICON(m_item, m_icon) tool_anim->get_popup()->set_item_icon(tool_anim->get_popup()->get_item_index(m_item), get_theme_icon(SNAME(m_icon), SNAME("EditorIcons")))

View File

@ -883,9 +883,9 @@ void AnimationNodeStateMachineEditor::_update_graph() {
void AnimationNodeStateMachineEditor::_notification(int p_what) { void AnimationNodeStateMachineEditor::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_LAYOUT_DIRECTION_CHANGED || p_what == NOTIFICATION_TRANSLATION_CHANGED) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_LAYOUT_DIRECTION_CHANGED || p_what == NOTIFICATION_TRANSLATION_CHANGED) {
error_panel->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
error_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
panel->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
tool_select->set_icon(get_theme_icon(SNAME("ToolSelect"), SNAME("EditorIcons"))); tool_select->set_icon(get_theme_icon(SNAME("ToolSelect"), SNAME("EditorIcons")));
tool_create->set_icon(get_theme_icon(SNAME("ToolAddNode"), SNAME("EditorIcons"))); tool_create->set_icon(get_theme_icon(SNAME("ToolAddNode"), SNAME("EditorIcons")));

View File

@ -68,9 +68,9 @@ void EditorAssetLibraryItem::set_image(int p_type, int p_index, const Ref<Textur
void EditorAssetLibraryItem::_notification(int p_what) { void EditorAssetLibraryItem::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) { if (p_what == NOTIFICATION_ENTER_TREE) {
icon->set_normal_texture(get_theme_icon(SNAME("ProjectIconLoading"), SNAME("EditorIcons"))); icon->set_normal_texture(get_theme_icon(SNAME("ProjectIconLoading"), SNAME("EditorIcons")));
category->add_theme_color_override(SNAME("font_color"), Color(0.5, 0.5, 0.5)); category->add_theme_color_override("font_color", Color(0.5, 0.5, 0.5));
author->add_theme_color_override(SNAME("font_color"), Color(0.5, 0.5, 0.5)); author->add_theme_color_override("font_color", Color(0.5, 0.5, 0.5));
price->add_theme_color_override(SNAME("font_color"), Color(0.5, 0.5, 0.5)); price->add_theme_color_override("font_color", Color(0.5, 0.5, 0.5));
} }
} }
@ -100,11 +100,11 @@ EditorAssetLibraryItem::EditorAssetLibraryItem() {
border->set_default_margin(SIDE_RIGHT, 5 * EDSCALE); border->set_default_margin(SIDE_RIGHT, 5 * EDSCALE);
border->set_default_margin(SIDE_BOTTOM, 5 * EDSCALE); border->set_default_margin(SIDE_BOTTOM, 5 * EDSCALE);
border->set_default_margin(SIDE_TOP, 5 * EDSCALE); border->set_default_margin(SIDE_TOP, 5 * EDSCALE);
add_theme_style_override(SNAME("panel"), border); add_theme_style_override("panel", border);
HBoxContainer *hb = memnew(HBoxContainer); HBoxContainer *hb = memnew(HBoxContainer);
// Add some spacing to visually separate the icon from the asset details. // Add some spacing to visually separate the icon from the asset details.
hb->add_theme_constant_override(SNAME("separation"), 15 * EDSCALE); hb->add_theme_constant_override("separation", 15 * EDSCALE);
add_child(hb); add_child(hb);
icon = memnew(TextureButton); icon = memnew(TextureButton);
@ -195,7 +195,7 @@ void EditorAssetLibraryItemDescription::_notification(int p_what) {
switch (p_what) { switch (p_what) {
case NOTIFICATION_ENTER_TREE: case NOTIFICATION_ENTER_TREE:
case NOTIFICATION_THEME_CHANGED: { case NOTIFICATION_THEME_CHANGED: {
previews_bg->add_theme_style_override(SNAME("panel"), previews->get_theme_stylebox(SNAME("normal"), SNAME("TextEdit"))); previews_bg->add_theme_style_override("panel", previews->get_theme_stylebox(SNAME("normal"), SNAME("TextEdit")));
} break; } break;
} }
} }
@ -269,7 +269,7 @@ EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() {
add_child(hbox); add_child(hbox);
VBoxContainer *desc_vbox = memnew(VBoxContainer); VBoxContainer *desc_vbox = memnew(VBoxContainer);
hbox->add_child(desc_vbox); hbox->add_child(desc_vbox);
hbox->add_theme_constant_override(SNAME("separation"), 15 * EDSCALE); hbox->add_theme_constant_override("separation", 15 * EDSCALE);
item = memnew(EditorAssetLibraryItem); item = memnew(EditorAssetLibraryItem);
@ -280,11 +280,11 @@ EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() {
desc_vbox->add_child(description); desc_vbox->add_child(description);
description->set_v_size_flags(Control::SIZE_EXPAND_FILL); description->set_v_size_flags(Control::SIZE_EXPAND_FILL);
description->connect("meta_clicked", callable_mp(this, &EditorAssetLibraryItemDescription::_link_click)); description->connect("meta_clicked", callable_mp(this, &EditorAssetLibraryItemDescription::_link_click));
description->add_theme_constant_override(SNAME("line_separation"), Math::round(5 * EDSCALE)); description->add_theme_constant_override("line_separation", Math::round(5 * EDSCALE));
VBoxContainer *previews_vbox = memnew(VBoxContainer); VBoxContainer *previews_vbox = memnew(VBoxContainer);
hbox->add_child(previews_vbox); hbox->add_child(previews_vbox);
previews_vbox->add_theme_constant_override(SNAME("separation"), 15 * EDSCALE); previews_vbox->add_theme_constant_override("separation", 15 * EDSCALE);
previews_vbox->set_v_size_flags(Control::SIZE_EXPAND_FILL); previews_vbox->set_v_size_flags(Control::SIZE_EXPAND_FILL);
preview = memnew(TextureRect); preview = memnew(TextureRect);
@ -400,8 +400,8 @@ void EditorAssetLibraryItemDownload::_notification(int p_what) {
switch (p_what) { switch (p_what) {
case NOTIFICATION_ENTER_TREE: case NOTIFICATION_ENTER_TREE:
case NOTIFICATION_THEME_CHANGED: { case NOTIFICATION_THEME_CHANGED: {
panel->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("panel"), SNAME("AssetLib"))); panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("AssetLib")));
status->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("status_color"), SNAME("AssetLib"))); status->add_theme_color_override("font_color", get_theme_color(SNAME("status_color"), SNAME("AssetLib")));
dismiss_button->set_normal_texture(get_theme_icon(SNAME("dismiss"), SNAME("AssetLib"))); dismiss_button->set_normal_texture(get_theme_icon(SNAME("dismiss"), SNAME("AssetLib")));
} break; } break;
case NOTIFICATION_PROCESS: { case NOTIFICATION_PROCESS: {
@ -578,9 +578,9 @@ void EditorAssetLibrary::_notification(int p_what) {
case NOTIFICATION_THEME_CHANGED: { case NOTIFICATION_THEME_CHANGED: {
error_tr->set_texture(get_theme_icon(SNAME("Error"), SNAME("EditorIcons"))); error_tr->set_texture(get_theme_icon(SNAME("Error"), SNAME("EditorIcons")));
filter->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); filter->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
library_scroll_bg->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); library_scroll_bg->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
downloads_scroll->add_theme_style_override(SNAME("bg"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); downloads_scroll->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
error_label->add_theme_color_override(SNAME("color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); error_label->add_theme_color_override("color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
} break; } break;
case NOTIFICATION_VISIBILITY_CHANGED: { case NOTIFICATION_VISIBILITY_CHANGED: {
if (is_visible()) { if (is_visible()) {
@ -984,7 +984,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int
} }
hbc->add_spacer(); hbc->add_spacer();
hbc->add_theme_constant_override(SNAME("separation"), 5 * EDSCALE); hbc->add_theme_constant_override("separation", 5 * EDSCALE);
Button *first = memnew(Button); Button *first = memnew(Button);
first->set_text(TTR("First")); first->set_text(TTR("First"));
@ -1191,8 +1191,8 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const
asset_items = memnew(GridContainer); asset_items = memnew(GridContainer);
asset_items->set_columns(2); asset_items->set_columns(2);
asset_items->add_theme_constant_override(SNAME("hseparation"), 10 * EDSCALE); asset_items->add_theme_constant_override("hseparation", 10 * EDSCALE);
asset_items->add_theme_constant_override(SNAME("vseparation"), 10 * EDSCALE); asset_items->add_theme_constant_override("vseparation", 10 * EDSCALE);
library_vb->add_child(asset_items); library_vb->add_child(asset_items);
@ -1374,7 +1374,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
HBoxContainer *search_hb = memnew(HBoxContainer); HBoxContainer *search_hb = memnew(HBoxContainer);
library_main->add_child(search_hb); library_main->add_child(search_hb);
library_main->add_theme_constant_override(SNAME("separation"), 10 * EDSCALE); library_main->add_theme_constant_override("separation", 10 * EDSCALE);
filter = memnew(LineEdit); filter = memnew(LineEdit);
if (templates_only) { if (templates_only) {
@ -1482,7 +1482,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
PanelContainer *library_vb_border = memnew(PanelContainer); PanelContainer *library_vb_border = memnew(PanelContainer);
library_scroll->add_child(library_vb_border); library_scroll->add_child(library_vb_border);
library_vb_border->add_theme_style_override(SNAME("panel"), border2); library_vb_border->add_theme_style_override("panel", border2);
library_vb_border->set_h_size_flags(Control::SIZE_EXPAND_FILL); library_vb_border->set_h_size_flags(Control::SIZE_EXPAND_FILL);
library_vb = memnew(VBoxContainer); library_vb = memnew(VBoxContainer);
@ -1504,8 +1504,8 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
asset_items = memnew(GridContainer); asset_items = memnew(GridContainer);
asset_items->set_columns(2); asset_items->set_columns(2);
asset_items->add_theme_constant_override(SNAME("hseparation"), 10 * EDSCALE); asset_items->add_theme_constant_override("hseparation", 10 * EDSCALE);
asset_items->add_theme_constant_override(SNAME("vseparation"), 10 * EDSCALE); asset_items->add_theme_constant_override("vseparation", 10 * EDSCALE);
library_vb->add_child(asset_items); library_vb->add_child(asset_items);
@ -1519,7 +1519,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
last_queue_id = 0; last_queue_id = 0;
library_vb->add_theme_constant_override(SNAME("separation"), 20 * EDSCALE); library_vb->add_theme_constant_override("separation", 20 * EDSCALE);
error_hb = memnew(HBoxContainer); error_hb = memnew(HBoxContainer);
library_main->add_child(error_hb); library_main->add_child(error_hb);

View File

@ -224,7 +224,7 @@ AudioStreamEditor::AudioStreamEditor() {
_preview->add_child(_indicator); _preview->add_child(_indicator);
HBoxContainer *hbox = memnew(HBoxContainer); HBoxContainer *hbox = memnew(HBoxContainer);
hbox->add_theme_constant_override(SNAME("separation"), 0); hbox->add_theme_constant_override("separation", 0);
vbox->add_child(hbox); vbox->add_child(hbox);
_play_button = memnew(Button); _play_button = memnew(Button);
@ -243,14 +243,14 @@ AudioStreamEditor::AudioStreamEditor() {
_current_label = memnew(Label); _current_label = memnew(Label);
_current_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); _current_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT);
_current_label->set_h_size_flags(SIZE_EXPAND_FILL); _current_label->set_h_size_flags(SIZE_EXPAND_FILL);
_current_label->add_theme_font_override(SNAME("font"), EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("status_source"), SNAME("EditorFonts"))); _current_label->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("status_source"), SNAME("EditorFonts")));
_current_label->add_theme_font_size_override(SNAME("font_size"), EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts"))); _current_label->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts")));
_current_label->set_modulate(Color(1, 1, 1, 0.5)); _current_label->set_modulate(Color(1, 1, 1, 0.5));
hbox->add_child(_current_label); hbox->add_child(_current_label);
_duration_label = memnew(Label); _duration_label = memnew(Label);
_duration_label->add_theme_font_override(SNAME("font"), EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("status_source"), SNAME("EditorFonts"))); _duration_label->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("status_source"), SNAME("EditorFonts")));
_duration_label->add_theme_font_size_override(SNAME("font_size"), EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts"))); _duration_label->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts")));
hbox->add_child(_duration_label); hbox->add_child(_duration_label);
} }

View File

@ -3847,7 +3847,7 @@ void CanvasItemEditor::_notification(int p_what) {
// the icon will be dark, so we need to lighten it before blending it // the icon will be dark, so we need to lighten it before blending it
// with the red color. // with the red color.
const Color key_auto_color = EditorSettings::get_singleton()->is_dark_theme() ? Color(1, 1, 1) : Color(4.25, 4.25, 4.25); const Color key_auto_color = EditorSettings::get_singleton()->is_dark_theme() ? Color(1, 1, 1) : Color(4.25, 4.25, 4.25);
key_auto_insert_button->add_theme_color_override(SNAME("icon_pressed_color"), key_auto_color.lerp(Color(1, 0, 0), 0.55)); key_auto_insert_button->add_theme_color_override("icon_pressed_color", key_auto_color.lerp(Color(1, 0, 0), 0.55));
animation_menu->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons"))); animation_menu->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons")));
_update_context_menu_stylebox(); _update_context_menu_stylebox();
@ -3967,7 +3967,7 @@ void CanvasItemEditor::_update_context_menu_stylebox() {
context_menu_stylebox->set_border_color(accent_color); context_menu_stylebox->set_border_color(accent_color);
context_menu_stylebox->set_border_width(SIDE_BOTTOM, Math::round(2 * EDSCALE)); context_menu_stylebox->set_border_width(SIDE_BOTTOM, Math::round(2 * EDSCALE));
context_menu_stylebox->set_default_margin(SIDE_BOTTOM, 0); context_menu_stylebox->set_default_margin(SIDE_BOTTOM, 0);
context_menu_container->add_theme_style_override(SNAME("panel"), context_menu_stylebox); context_menu_container->add_theme_style_override("panel", context_menu_stylebox);
} }
void CanvasItemEditor::_update_scrollbars() { void CanvasItemEditor::_update_scrollbars() {
@ -6076,7 +6076,7 @@ void CanvasItemEditorViewport::_notification(int p_what) {
check->set_icon(get_theme_icon(check->get_text(), SNAME("EditorIcons"))); check->set_icon(get_theme_icon(check->get_text(), SNAME("EditorIcons")));
} }
label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("warning_color"), SNAME("Editor"))); label->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
} }
switch (p_what) { switch (p_what) {
@ -6144,16 +6144,16 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte
} }
label = memnew(Label); label = memnew(Label);
label->add_theme_color_override(SNAME("font_shadow_color"), Color(0, 0, 0, 1)); label->add_theme_color_override("font_shadow_color", Color(0, 0, 0, 1));
label->add_theme_constant_override(SNAME("shadow_outline_size"), 1 * EDSCALE); label->add_theme_constant_override("shadow_outline_size", 1 * EDSCALE);
label->hide(); label->hide();
canvas_item_editor->get_controls_container()->add_child(label); canvas_item_editor->get_controls_container()->add_child(label);
label_desc = memnew(Label); label_desc = memnew(Label);
label_desc->add_theme_color_override(SNAME("font_color"), Color(0.6f, 0.6f, 0.6f, 1)); label_desc->add_theme_color_override("font_color", Color(0.6f, 0.6f, 0.6f, 1));
label_desc->add_theme_color_override(SNAME("font_shadow_color"), Color(0.2f, 0.2f, 0.2f, 1)); label_desc->add_theme_color_override("font_shadow_color", Color(0.2f, 0.2f, 0.2f, 1));
label_desc->add_theme_constant_override(SNAME("shadow_outline_size"), 1 * EDSCALE); label_desc->add_theme_constant_override("shadow_outline_size", 1 * EDSCALE);
label_desc->add_theme_constant_override(SNAME("line_spacing"), 0); label_desc->add_theme_constant_override("line_spacing", 0);
label_desc->hide(); label_desc->hide();
canvas_item_editor->get_controls_container()->add_child(label_desc); canvas_item_editor->get_controls_container()->add_child(label_desc);

View File

@ -54,7 +54,7 @@ DebuggerEditorPlugin::DebuggerEditorPlugin(EditorNode *p_editor, MenuButton *p_d
EditorDebuggerNode *debugger = memnew(EditorDebuggerNode); EditorDebuggerNode *debugger = memnew(EditorDebuggerNode);
Button *db = EditorNode::get_singleton()->add_bottom_panel_item(TTR("Debugger"), debugger); Button *db = EditorNode::get_singleton()->add_bottom_panel_item(TTR("Debugger"), debugger);
// Add separation for the warning/error icon that is displayed later. // Add separation for the warning/error icon that is displayed later.
db->add_theme_constant_override(SNAME("hseparation"), 6 * EDSCALE); db->add_theme_constant_override("hseparation", 6 * EDSCALE);
debugger->set_tool_button(db); debugger->set_tool_button(db);
// Main editor debug menu. // Main editor debug menu.

View File

@ -76,10 +76,10 @@ void InputEventConfigContainer::set_event(const Ref<InputEvent> &p_event) {
InputEventConfigContainer::InputEventConfigContainer() { InputEventConfigContainer::InputEventConfigContainer() {
MarginContainer *mc = memnew(MarginContainer); MarginContainer *mc = memnew(MarginContainer);
mc->add_theme_constant_override(SNAME("margin_left"), 10); mc->add_theme_constant_override("margin_left", 10);
mc->add_theme_constant_override(SNAME("margin_right"), 10); mc->add_theme_constant_override("margin_right", 10);
mc->add_theme_constant_override(SNAME("margin_top"), 10); mc->add_theme_constant_override("margin_top", 10);
mc->add_theme_constant_override(SNAME("margin_bottom"), 10); mc->add_theme_constant_override("margin_bottom", 10);
add_child(mc); add_child(mc);
HBoxContainer *hb = memnew(HBoxContainer); HBoxContainer *hb = memnew(HBoxContainer);

View File

@ -2946,28 +2946,28 @@ void Node3DEditorViewport::_notification(int p_what) {
view_menu->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons"))); view_menu->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons")));
preview_camera->set_icon(get_theme_icon(SNAME("Camera3D"), SNAME("EditorIcons"))); preview_camera->set_icon(get_theme_icon(SNAME("Camera3D"), SNAME("EditorIcons")));
view_menu->add_theme_style_override(SNAME("normal"), editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles"))); view_menu->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
view_menu->add_theme_style_override(SNAME("hover"), editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles"))); view_menu->add_theme_style_override("hover", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
view_menu->add_theme_style_override(SNAME("pressed"), editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles"))); view_menu->add_theme_style_override("pressed", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
view_menu->add_theme_style_override(SNAME("focus"), editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles"))); view_menu->add_theme_style_override("focus", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
view_menu->add_theme_style_override(SNAME("disabled"), editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles"))); view_menu->add_theme_style_override("disabled", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
preview_camera->add_theme_style_override(SNAME("normal"), editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles"))); preview_camera->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
preview_camera->add_theme_style_override(SNAME("hover"), editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles"))); preview_camera->add_theme_style_override("hover", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
preview_camera->add_theme_style_override(SNAME("pressed"), editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles"))); preview_camera->add_theme_style_override("pressed", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
preview_camera->add_theme_style_override(SNAME("focus"), editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles"))); preview_camera->add_theme_style_override("focus", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
preview_camera->add_theme_style_override(SNAME("disabled"), editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles"))); preview_camera->add_theme_style_override("disabled", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
frame_time_gradient->set_color(0, get_theme_color(SNAME("success_color"), SNAME("Editor"))); frame_time_gradient->set_color(0, get_theme_color(SNAME("success_color"), SNAME("Editor")));
frame_time_gradient->set_color(1, get_theme_color(SNAME("warning_color"), SNAME("Editor"))); frame_time_gradient->set_color(1, get_theme_color(SNAME("warning_color"), SNAME("Editor")));
frame_time_gradient->set_color(2, get_theme_color(SNAME("error_color"), SNAME("Editor"))); frame_time_gradient->set_color(2, get_theme_color(SNAME("error_color"), SNAME("Editor")));
info_label->add_theme_style_override(SNAME("normal"), editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles"))); info_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
cpu_time_label->add_theme_style_override(SNAME("normal"), editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles"))); cpu_time_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
gpu_time_label->add_theme_style_override(SNAME("normal"), editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles"))); gpu_time_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
fps_label->add_theme_style_override(SNAME("normal"), editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles"))); fps_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
cinema_label->add_theme_style_override(SNAME("normal"), editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles"))); cinema_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
locked_label->add_theme_style_override(SNAME("normal"), editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles"))); locked_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles")));
} }
} }
@ -4506,7 +4506,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, Edito
zoom_limit_label->set_offset(Side::SIDE_TOP, -28 * EDSCALE); zoom_limit_label->set_offset(Side::SIDE_TOP, -28 * EDSCALE);
zoom_limit_label->set_text(TTR("To zoom further, change the camera's clipping planes (View -> Settings...)")); zoom_limit_label->set_text(TTR("To zoom further, change the camera's clipping planes (View -> Settings...)"));
zoom_limit_label->set_name("ZoomLimitMessageLabel"); zoom_limit_label->set_name("ZoomLimitMessageLabel");
zoom_limit_label->add_theme_color_override(SNAME("font_color"), Color(1, 1, 1, 1)); zoom_limit_label->add_theme_color_override("font_color", Color(1, 1, 1, 1));
zoom_limit_label->hide(); zoom_limit_label->hide();
surface->add_child(zoom_limit_label); surface->add_child(zoom_limit_label);
@ -4520,7 +4520,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, Edito
// Make sure frame time labels don't touch the viewport's edge. // Make sure frame time labels don't touch the viewport's edge.
top_right_vbox->set_custom_minimum_size(Size2(100, 0) * EDSCALE); top_right_vbox->set_custom_minimum_size(Size2(100, 0) * EDSCALE);
// Prevent visible spacing between frame time labels. // Prevent visible spacing between frame time labels.
top_right_vbox->add_theme_constant_override(SNAME("separation"), 0); top_right_vbox->add_theme_constant_override("separation", 0);
rotation_control = memnew(ViewportRotationControl); rotation_control = memnew(ViewportRotationControl);
rotation_control->set_custom_minimum_size(Size2(80, 80) * EDSCALE); rotation_control->set_custom_minimum_size(Size2(80, 80) * EDSCALE);
@ -6184,7 +6184,7 @@ void Node3DEditor::_update_context_menu_stylebox() {
context_menu_stylebox->set_border_color(accent_color); context_menu_stylebox->set_border_color(accent_color);
context_menu_stylebox->set_border_width(SIDE_BOTTOM, Math::round(2 * EDSCALE)); context_menu_stylebox->set_border_width(SIDE_BOTTOM, Math::round(2 * EDSCALE));
context_menu_stylebox->set_default_margin(SIDE_BOTTOM, 0); context_menu_stylebox->set_default_margin(SIDE_BOTTOM, 0);
context_menu_container->add_theme_style_override(SNAME("panel"), context_menu_stylebox); context_menu_container->add_theme_style_override("panel", context_menu_stylebox);
} }
void Node3DEditor::_update_gizmos_menu() { void Node3DEditor::_update_gizmos_menu() {
@ -6771,8 +6771,8 @@ void Node3DEditor::_update_theme() {
environ_button->set_icon(get_theme_icon(SNAME("WorldEnvironment"), SNAME("EditorIcons"))); environ_button->set_icon(get_theme_icon(SNAME("WorldEnvironment"), SNAME("EditorIcons")));
sun_environ_settings->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons"))); sun_environ_settings->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons")));
sun_title->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("title_font"), SNAME("Window"))); sun_title->add_theme_font_override("font", get_theme_font(SNAME("title_font"), SNAME("Window")));
environ_title->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("title_font"), SNAME("Window"))); environ_title->add_theme_font_override("font", get_theme_font(SNAME("title_font"), SNAME("Window")));
} }
void Node3DEditor::_notification(int p_what) { void Node3DEditor::_notification(int p_what) {
@ -6809,8 +6809,8 @@ void Node3DEditor::_notification(int p_what) {
_update_theme(); _update_theme();
_update_gizmos_menu_theme(); _update_gizmos_menu_theme();
_update_context_menu_stylebox(); _update_context_menu_stylebox();
sun_title->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("title_font"), SNAME("Window"))); sun_title->add_theme_font_override("font", get_theme_font(SNAME("title_font"), SNAME("Window")));
environ_title->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("title_font"), SNAME("Window"))); environ_title->add_theme_font_override("font", get_theme_font(SNAME("title_font"), SNAME("Window")));
} break; } break;
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
// Update grid color by rebuilding grid. // Update grid color by rebuilding grid.
@ -7800,7 +7800,7 @@ void fragment() {
sun_angle_azimuth->connect("value_changed", callable_mp(this, &Node3DEditor::_sun_direction_angle_set).unbind(1)); sun_angle_azimuth->connect("value_changed", callable_mp(this, &Node3DEditor::_sun_direction_angle_set).unbind(1));
sun_angle_azimuth_vbox->add_child(sun_angle_azimuth); sun_angle_azimuth_vbox->add_child(sun_angle_azimuth);
sun_angle_hbox->add_child(sun_angle_azimuth_vbox); sun_angle_hbox->add_child(sun_angle_azimuth_vbox);
sun_angle_hbox->add_theme_constant_override(SNAME("separation"), 10); sun_angle_hbox->add_theme_constant_override("separation", 10);
sun_vb->add_child(sun_angle_hbox); sun_vb->add_child(sun_angle_hbox);
sun_color = memnew(ColorPickerButton); sun_color = memnew(ColorPickerButton);

View File

@ -92,8 +92,8 @@ void Polygon2DEditor::_notification(int p_what) {
[[fallthrough]]; [[fallthrough]];
} }
case NOTIFICATION_THEME_CHANGED: { case NOTIFICATION_THEME_CHANGED: {
uv_edit_draw->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); uv_edit_draw->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
bone_scroll->add_theme_style_override(SNAME("bg"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); bone_scroll->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
} break; } break;
case NOTIFICATION_VISIBILITY_CHANGED: { case NOTIFICATION_VISIBILITY_CHANGED: {
if (!is_visible()) { if (!is_visible()) {

View File

@ -95,7 +95,7 @@ void ReplicationEditor::_bind_methods() {
void ReplicationEditor::_notification(int p_what) { void ReplicationEditor::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE || p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
add_theme_style_override(SNAME("panel"), editor->get_gui_base()->get_theme_stylebox(SNAME("panel"), SNAME("Panel"))); add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox(SNAME("panel"), SNAME("Panel")));
} else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { } else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
update_keying(); update_keying();
} }
@ -257,10 +257,10 @@ void ReplicationEditor::edit(MultiplayerSynchronizer *p_sync) {
} }
Ref<Texture2D> ReplicationEditor::_get_class_icon(const Node *p_node) { Ref<Texture2D> ReplicationEditor::_get_class_icon(const Node *p_node) {
if (!p_node || !has_theme_icon(p_node->get_class(), SNAME("EditorIcons"))) { if (!p_node || !has_theme_icon(p_node->get_class(), "EditorIcons")) {
return get_theme_icon(SNAME("ImportFail"), SNAME("EditorIcons")); return get_theme_icon(SNAME("ImportFail"), SNAME("EditorIcons"));
} }
return get_theme_icon(p_node->get_class(), SNAME("EditorIcons")); return get_theme_icon(p_node->get_class(), "EditorIcons");
} }
void ReplicationEditor::_add_property(const NodePath &p_property, bool p_spawn, bool p_sync) { void ReplicationEditor::_add_property(const NodePath &p_property, bool p_spawn, bool p_sync) {

View File

@ -341,7 +341,7 @@ void ResourcePreloaderEditor::_bind_methods() {
} }
ResourcePreloaderEditor::ResourcePreloaderEditor() { ResourcePreloaderEditor::ResourcePreloaderEditor() {
//add_style_override(SNAME("panel"), EditorNode::get_singleton()->get_gui_base()->get_stylebox("panel","Panel")); //add_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_stylebox("panel","Panel"));
VBoxContainer *vbc = memnew(VBoxContainer); VBoxContainer *vbc = memnew(VBoxContainer);
add_child(vbc); add_child(vbc);

View File

@ -381,7 +381,7 @@ ScriptEditorQuickOpen::ScriptEditorQuickOpen() {
search_options->connect("item_activated", callable_mp(this, &ScriptEditorQuickOpen::_confirmed)); search_options->connect("item_activated", callable_mp(this, &ScriptEditorQuickOpen::_confirmed));
search_options->set_hide_root(true); search_options->set_hide_root(true);
search_options->set_hide_folding(true); search_options->set_hide_folding(true);
search_options->add_theme_constant_override(SNAME("draw_guides"), 1); search_options->add_theme_constant_override("draw_guides", 1);
} }
///////////////////////////////// /////////////////////////////////
@ -1630,7 +1630,7 @@ void ScriptEditor::_notification(int p_what) {
filter_scripts->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); filter_scripts->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
filter_methods->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); filter_methods->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
filename->add_theme_style_override(SNAME("normal"), editor->get_gui_base()->get_theme_stylebox(SNAME("normal"), SNAME("LineEdit"))); filename->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox(SNAME("normal"), SNAME("LineEdit")));
recent_scripts->set_as_minsize(); recent_scripts->set_as_minsize();
@ -3693,7 +3693,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
filename = memnew(Label); filename = memnew(Label);
filename->set_clip_text(true); filename->set_clip_text(true);
filename->set_h_size_flags(SIZE_EXPAND_FILL); filename->set_h_size_flags(SIZE_EXPAND_FILL);
filename->add_theme_style_override(SNAME("normal"), EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("normal"), SNAME("LineEdit"))); filename->add_theme_style_override("normal", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("normal"), SNAME("LineEdit")));
buttons_hbox->add_child(filename); buttons_hbox->add_child(filename);
members_overview_alphabeta_sort_button = memnew(Button); members_overview_alphabeta_sort_button = memnew(Button);
@ -3948,8 +3948,8 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
ScriptServer::edit_request_func = _open_script_request; ScriptServer::edit_request_func = _open_script_request;
add_theme_style_override(SNAME("panel"), editor->get_gui_base()->get_theme_stylebox(SNAME("ScriptEditorPanel"), SNAME("EditorStyles"))); add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox(SNAME("ScriptEditorPanel"), SNAME("EditorStyles")));
tab_container->add_theme_style_override(SNAME("panel"), editor->get_gui_base()->get_theme_stylebox(SNAME("ScriptEditor"), SNAME("EditorStyles"))); tab_container->add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox(SNAME("ScriptEditor"), SNAME("EditorStyles")));
} }
ScriptEditor::~ScriptEditor() { ScriptEditor::~ScriptEditor() {

View File

@ -1848,7 +1848,7 @@ void ScriptTextEditor::_enable_code_editor() {
ScriptTextEditor::ScriptTextEditor() { ScriptTextEditor::ScriptTextEditor() {
code_editor = memnew(CodeTextEditor); code_editor = memnew(CodeTextEditor);
code_editor->add_theme_constant_override(SNAME("separation"), 2); code_editor->add_theme_constant_override("separation", 2);
code_editor->set_anchors_and_offsets_preset(Control::PRESET_WIDE); code_editor->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
code_editor->set_code_complete_func(_code_complete_scripts, this); code_editor->set_code_complete_func(_code_complete_scripts, this);
code_editor->set_v_size_flags(SIZE_EXPAND_FILL); code_editor->set_v_size_flags(SIZE_EXPAND_FILL);

View File

@ -189,8 +189,8 @@ void ShaderTextEditor::_load_theme_settings() {
if (warnings_panel) { if (warnings_panel) {
// Warnings panel // Warnings panel
warnings_panel->add_theme_font_override(SNAME("normal_font"), EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("main"), SNAME("EditorFonts"))); warnings_panel->add_theme_font_override("normal_font", EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("main"), SNAME("EditorFonts")));
warnings_panel->add_theme_font_size_override(SNAME("normal_font_size"), EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("main_size"), SNAME("EditorFonts"))); warnings_panel->add_theme_font_size_override("normal_font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("main_size"), SNAME("EditorFonts")));
} }
} }
@ -443,7 +443,7 @@ void ShaderEditor::_notification(int p_what) {
void ShaderEditor::_editor_settings_changed() { void ShaderEditor::_editor_settings_changed() {
shader_editor->update_editor_settings(); shader_editor->update_editor_settings();
shader_editor->get_text_editor()->add_theme_constant_override(SNAME("line_spacing"), EditorSettings::get_singleton()->get("text_editor/appearance/whitespace/line_spacing")); shader_editor->get_text_editor()->add_theme_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/appearance/whitespace/line_spacing"));
shader_editor->get_text_editor()->set_draw_breakpoints_gutter(false); shader_editor->get_text_editor()->set_draw_breakpoints_gutter(false);
shader_editor->get_text_editor()->set_draw_executing_lines_gutter(false); shader_editor->get_text_editor()->set_draw_executing_lines_gutter(false);
} }
@ -701,7 +701,7 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) {
shader_editor = memnew(ShaderTextEditor); shader_editor = memnew(ShaderTextEditor);
shader_editor->set_v_size_flags(SIZE_EXPAND_FILL); shader_editor->set_v_size_flags(SIZE_EXPAND_FILL);
shader_editor->add_theme_constant_override(SNAME("separation"), 0); shader_editor->add_theme_constant_override("separation", 0);
shader_editor->set_anchors_and_offsets_preset(Control::PRESET_WIDE); shader_editor->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
shader_editor->connect("show_warnings_panel", callable_mp(this, &ShaderEditor::_show_warnings_panel)); shader_editor->connect("show_warnings_panel", callable_mp(this, &ShaderEditor::_show_warnings_panel));
@ -789,7 +789,7 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) {
hbc->add_child(edit_menu); hbc->add_child(edit_menu);
hbc->add_child(goto_menu); hbc->add_child(goto_menu);
hbc->add_child(help_menu); hbc->add_child(help_menu);
hbc->add_theme_style_override(SNAME("panel"), p_node->get_gui_base()->get_theme_stylebox(SNAME("ScriptEditorPanel"), SNAME("EditorStyles"))); hbc->add_theme_style_override("panel", p_node->get_gui_base()->get_theme_stylebox(SNAME("ScriptEditorPanel"), SNAME("EditorStyles")));
VSplitContainer *editor_box = memnew(VSplitContainer); VSplitContainer *editor_box = memnew(VSplitContainer);
main_container->add_child(editor_box); main_container->add_child(editor_box);

View File

@ -602,7 +602,7 @@ void Skeleton3DEditor::update_editors() {
void Skeleton3DEditor::create_editors() { void Skeleton3DEditor::create_editors() {
set_h_size_flags(SIZE_EXPAND_FILL); set_h_size_flags(SIZE_EXPAND_FILL);
add_theme_constant_override(SNAME("separation"), 0); add_theme_constant_override("separation", 0);
set_focus_mode(FOCUS_ALL); set_focus_mode(FOCUS_ALL);

View File

@ -328,10 +328,10 @@ void SpriteFramesEditor::_notification(int p_what) {
[[fallthrough]]; [[fallthrough]];
} }
case NOTIFICATION_THEME_CHANGED: { case NOTIFICATION_THEME_CHANGED: {
split_sheet_scroll->add_theme_style_override(SNAME("bg"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); split_sheet_scroll->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
} break; } break;
case NOTIFICATION_READY: { case NOTIFICATION_READY: {
add_theme_constant_override(SNAME("autohide"), 1); // Fixes the dragger always showing up. add_theme_constant_override("autohide", 1); // Fixes the dragger always showing up.
} break; } break;
} }
} }
@ -1247,8 +1247,8 @@ SpriteFramesEditor::SpriteFramesEditor() {
split_sheet_panel->add_child(split_sheet_zoom_margin); split_sheet_panel->add_child(split_sheet_zoom_margin);
split_sheet_zoom_margin->set_h_size_flags(0); split_sheet_zoom_margin->set_h_size_flags(0);
split_sheet_zoom_margin->set_v_size_flags(0); split_sheet_zoom_margin->set_v_size_flags(0);
split_sheet_zoom_margin->add_theme_constant_override(SNAME("margin_top"), 5); split_sheet_zoom_margin->add_theme_constant_override("margin_top", 5);
split_sheet_zoom_margin->add_theme_constant_override(SNAME("margin_left"), 5); split_sheet_zoom_margin->add_theme_constant_override("margin_left", 5);
HBoxContainer *split_sheet_zoom_hb = memnew(HBoxContainer); HBoxContainer *split_sheet_zoom_hb = memnew(HBoxContainer);
split_sheet_zoom_margin->add_child(split_sheet_zoom_hb); split_sheet_zoom_margin->add_child(split_sheet_zoom_hb);

View File

@ -50,7 +50,7 @@ void StyleBoxPreview::edit(const Ref<StyleBox> &p_stylebox) {
} }
stylebox = p_stylebox; stylebox = p_stylebox;
if (p_stylebox.is_valid()) { if (p_stylebox.is_valid()) {
preview->add_theme_style_override(SNAME("panel"), stylebox); preview->add_theme_style_override("panel", stylebox);
stylebox->connect("changed", callable_mp(this, &StyleBoxPreview::_sb_changed)); stylebox->connect("changed", callable_mp(this, &StyleBoxPreview::_sb_changed));
} }
_sb_changed(); _sb_changed();

View File

@ -392,7 +392,7 @@ void TextControlEditor::_outline_size_selected(double p_size) {
Control *edited_control = edited_controls[i]; Control *edited_control = edited_controls[i];
ur->add_do_method(edited_control, "add_theme_constant_override", "outline_size", p_size); ur->add_do_method(edited_control, "add_theme_constant_override", "outline_size", p_size);
if (edited_control->has_theme_constant_override(SNAME("outline_size"))) { if (edited_control->has_theme_constant_override("outline_size")) {
ur->add_undo_method(edited_control, "add_theme_constant_override", "outline_size", edited_control->get_theme_constant(SNAME("outline_size"))); ur->add_undo_method(edited_control, "add_theme_constant_override", "outline_size", edited_control->get_theme_constant(SNAME("outline_size")));
} else { } else {
ur->add_undo_method(edited_control, "remove_theme_constant_override", "outline_size"); ur->add_undo_method(edited_control, "remove_theme_constant_override", "outline_size");
@ -451,7 +451,7 @@ void TextControlEditor::_outline_color_changed(const Color &p_color) {
Control *edited_control = edited_controls[i]; Control *edited_control = edited_controls[i];
ur->add_do_method(edited_control, "add_theme_color_override", "font_outline_color", p_color); ur->add_do_method(edited_control, "add_theme_color_override", "font_outline_color", p_color);
if (edited_control->has_theme_color_override(SNAME("font_outline_color"))) { if (edited_control->has_theme_color_override("font_outline_color")) {
ur->add_undo_method(edited_control, "add_theme_color_override", "font_outline_color", edited_control->get_theme_color(SNAME("font_outline_color"))); ur->add_undo_method(edited_control, "add_theme_color_override", "font_outline_color", edited_control->get_theme_color(SNAME("font_outline_color")));
} else { } else {
ur->add_undo_method(edited_control, "remove_theme_color_override", "font_outline_color"); ur->add_undo_method(edited_control, "remove_theme_color_override", "font_outline_color");
@ -510,12 +510,12 @@ void TextControlEditor::_clear_formatting() {
} }
ur->add_do_method(edited_control, "remove_theme_color_override", "font_outline_color"); ur->add_do_method(edited_control, "remove_theme_color_override", "font_outline_color");
if (edited_control->has_theme_color_override(SNAME("font_outline_color"))) { if (edited_control->has_theme_color_override("font_outline_color")) {
ur->add_undo_method(edited_control, "add_theme_color_override", "font_outline_color", edited_control->get_theme_color(SNAME("font_outline_color"))); ur->add_undo_method(edited_control, "add_theme_color_override", "font_outline_color", edited_control->get_theme_color(SNAME("font_outline_color")));
} }
ur->add_do_method(edited_control, "remove_theme_constant_override", "outline_size"); ur->add_do_method(edited_control, "remove_theme_constant_override", "outline_size");
if (edited_control->has_theme_constant_override(SNAME("outline_size"))) { if (edited_control->has_theme_constant_override("outline_size")) {
ur->add_undo_method(edited_control, "add_theme_constant_override", "outline_size", edited_control->get_theme_constant(SNAME("outline_size"))); ur->add_undo_method(edited_control, "add_theme_constant_override", "outline_size", edited_control->get_theme_constant(SNAME("outline_size")));
} }
@ -600,7 +600,7 @@ TextControlEditor::TextControlEditor() {
font_size_list = memnew(SpinBox); font_size_list = memnew(SpinBox);
font_size_list->set_tooltip(TTR("Font Size")); font_size_list->set_tooltip(TTR("Font Size"));
font_size_list->get_line_edit()->add_theme_constant_override(SNAME("minimum_character_width"), 2); font_size_list->get_line_edit()->add_theme_constant_override("minimum_character_width", 2);
font_size_list->set_min(6); font_size_list->set_min(6);
font_size_list->set_step(1); font_size_list->set_step(1);
font_size_list->set_max(96); font_size_list->set_max(96);
@ -619,7 +619,7 @@ TextControlEditor::TextControlEditor() {
outline_size_list = memnew(SpinBox); outline_size_list = memnew(SpinBox);
outline_size_list->set_tooltip(TTR("Outline Size")); outline_size_list->set_tooltip(TTR("Outline Size"));
outline_size_list->get_line_edit()->add_theme_constant_override(SNAME("minimum_character_width"), 2); outline_size_list->get_line_edit()->add_theme_constant_override("minimum_character_width", 2);
outline_size_list->set_min(0); outline_size_list->set_min(0);
outline_size_list->set_step(1); outline_size_list->set_step(1);
outline_size_list->set_max(96); outline_size_list->set_max(96);

View File

@ -521,7 +521,7 @@ void TextEditor::update_toggle_scripts_button() {
TextEditor::TextEditor() { TextEditor::TextEditor() {
code_editor = memnew(CodeTextEditor); code_editor = memnew(CodeTextEditor);
add_child(code_editor); add_child(code_editor);
code_editor->add_theme_constant_override(SNAME("separation"), 0); code_editor->add_theme_constant_override("separation", 0);
code_editor->connect("load_theme_settings", callable_mp(this, &TextEditor::_load_theme_settings)); code_editor->connect("load_theme_settings", callable_mp(this, &TextEditor::_load_theme_settings));
code_editor->connect("validate_script", callable_mp(this, &TextEditor::_validate_script)); code_editor->connect("validate_script", callable_mp(this, &TextEditor::_validate_script));
code_editor->set_anchors_and_offsets_preset(Control::PRESET_WIDE); code_editor->set_anchors_and_offsets_preset(Control::PRESET_WIDE);

View File

@ -171,11 +171,11 @@ Texture3DEditor::Texture3DEditor() {
info->set_anchor(SIDE_TOP, 1); info->set_anchor(SIDE_TOP, 1);
info->set_h_grow_direction(GROW_DIRECTION_BEGIN); info->set_h_grow_direction(GROW_DIRECTION_BEGIN);
info->set_v_grow_direction(GROW_DIRECTION_BEGIN); info->set_v_grow_direction(GROW_DIRECTION_BEGIN);
info->add_theme_color_override(SNAME("font_color"), Color(1, 1, 1, 1)); info->add_theme_color_override("font_color", Color(1, 1, 1, 1));
info->add_theme_color_override(SNAME("font_shadow_color"), Color(0, 0, 0, 0.5)); info->add_theme_color_override("font_shadow_color", Color(0, 0, 0, 0.5));
info->add_theme_constant_override(SNAME("shadow_outline_size"), 1); info->add_theme_constant_override("shadow_outline_size", 1);
info->add_theme_constant_override(SNAME("shadow_offset_x"), 2); info->add_theme_constant_override("shadow_offset_x", 2);
info->add_theme_constant_override(SNAME("shadow_offset_y"), 2); info->add_theme_constant_override("shadow_offset_y", 2);
setting = false; setting = false;
layer->connect("value_changed", Callable(this, "_layer_changed")); layer->connect("value_changed", Callable(this, "_layer_changed"));

View File

@ -50,7 +50,7 @@ void TexturePreview::_notification(int p_what) {
if (metadata_label) { if (metadata_label) {
Ref<Font> metadata_label_font = get_theme_font(SNAME("expression"), SNAME("EditorFonts")); Ref<Font> metadata_label_font = get_theme_font(SNAME("expression"), SNAME("EditorFonts"));
metadata_label->add_theme_font_override(SNAME("font"), metadata_label_font); metadata_label->add_theme_font_override("font", metadata_label_font);
} }
checkerboard->set_texture(get_theme_icon(SNAME("Checkerboard"), SNAME("EditorIcons"))); checkerboard->set_texture(get_theme_icon(SNAME("Checkerboard"), SNAME("EditorIcons")));
@ -94,14 +94,14 @@ TexturePreview::TexturePreview(Ref<Texture2D> p_texture, bool p_show_metadata) {
p_texture->connect("changed", callable_mp(this, &TexturePreview::_update_metadata_label_text)); p_texture->connect("changed", callable_mp(this, &TexturePreview::_update_metadata_label_text));
// It's okay that these colors are static since the grid color is static too. // It's okay that these colors are static since the grid color is static too.
metadata_label->add_theme_color_override(SNAME("font_color"), Color::named("white")); metadata_label->add_theme_color_override("font_color", Color::named("white"));
metadata_label->add_theme_color_override(SNAME("font_color_shadow"), Color::named("black")); metadata_label->add_theme_color_override("font_color_shadow", Color::named("black"));
metadata_label->add_theme_font_size_override(SNAME("font_size"), 16 * EDSCALE); metadata_label->add_theme_font_size_override("font_size", 16 * EDSCALE);
metadata_label->add_theme_color_override(SNAME("font_outline_color"), Color::named("black")); metadata_label->add_theme_color_override("font_outline_color", Color::named("black"));
metadata_label->add_theme_constant_override(SNAME("outline_size"), 2 * EDSCALE); metadata_label->add_theme_constant_override("outline_size", 2 * EDSCALE);
metadata_label->add_theme_constant_override(SNAME("shadow_outline_size"), 1); metadata_label->add_theme_constant_override("shadow_outline_size", 1);
metadata_label->set_h_size_flags(Control::SIZE_SHRINK_END); metadata_label->set_h_size_flags(Control::SIZE_SHRINK_END);
metadata_label->set_v_size_flags(Control::SIZE_SHRINK_END); metadata_label->set_v_size_flags(Control::SIZE_SHRINK_END);

View File

@ -247,11 +247,11 @@ TextureLayeredEditor::TextureLayeredEditor() {
info->set_anchor(SIDE_TOP, 1); info->set_anchor(SIDE_TOP, 1);
info->set_h_grow_direction(GROW_DIRECTION_BEGIN); info->set_h_grow_direction(GROW_DIRECTION_BEGIN);
info->set_v_grow_direction(GROW_DIRECTION_BEGIN); info->set_v_grow_direction(GROW_DIRECTION_BEGIN);
info->add_theme_color_override(SNAME("font_color"), Color(1, 1, 1, 1)); info->add_theme_color_override("font_color", Color(1, 1, 1, 1));
info->add_theme_color_override(SNAME("font_shadow_color"), Color(0, 0, 0, 0.5)); info->add_theme_color_override("font_shadow_color", Color(0, 0, 0, 0.5));
info->add_theme_constant_override(SNAME("shadow_outline_size"), 1); info->add_theme_constant_override("shadow_outline_size", 1);
info->add_theme_constant_override(SNAME("shadow_offset_x"), 2); info->add_theme_constant_override("shadow_offset_x", 2);
info->add_theme_constant_override(SNAME("shadow_offset_y"), 2); info->add_theme_constant_override("shadow_offset_y", 2);
setting = false; setting = false;
layer->connect("value_changed", Callable(this, "_layer_changed")); layer->connect("value_changed", Callable(this, "_layer_changed"));

View File

@ -808,7 +808,7 @@ void TextureRegionEditor::_notification(int p_what) {
switch (p_what) { switch (p_what) {
case NOTIFICATION_ENTER_TREE: case NOTIFICATION_ENTER_TREE:
case NOTIFICATION_THEME_CHANGED: { case NOTIFICATION_THEME_CHANGED: {
edit_draw->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); edit_draw->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
} break; } break;
case NOTIFICATION_READY: { case NOTIFICATION_READY: {
zoom_out->set_icon(get_theme_icon(SNAME("ZoomLess"), SNAME("EditorIcons"))); zoom_out->set_icon(get_theme_icon(SNAME("ZoomLess"), SNAME("EditorIcons")));

View File

@ -830,7 +830,7 @@ void ThemeItemImportTree::_notification(int p_what) {
case NOTIFICATION_ENTER_TREE: case NOTIFICATION_ENTER_TREE:
case NOTIFICATION_THEME_CHANGED: { case NOTIFICATION_THEME_CHANGED: {
select_icons_warning_icon->set_texture(get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons"))); select_icons_warning_icon->set_texture(get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons")));
select_icons_warning->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("disabled_font_color"), SNAME("Editor"))); select_icons_warning->add_theme_color_override("font_color", get_theme_color(SNAME("disabled_font_color"), SNAME("Editor")));
// Bottom panel buttons. // Bottom panel buttons.
import_collapse_types_button->set_icon(get_theme_icon(SNAME("CollapseTree"), SNAME("EditorIcons"))); import_collapse_types_button->set_icon(get_theme_icon(SNAME("CollapseTree"), SNAME("EditorIcons")));
@ -1824,8 +1824,8 @@ void ThemeItemEditorDialog::_notification(int p_what) {
import_another_theme_button->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons"))); import_another_theme_button->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
tc->add_theme_style_override(SNAME("tab_selected"), get_theme_stylebox(SNAME("tab_selected_odd"), SNAME("TabContainer"))); tc->add_theme_style_override("tab_selected", get_theme_stylebox(SNAME("tab_selected_odd"), SNAME("TabContainer")));
tc->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("panel_odd"), SNAME("TabContainer"))); tc->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel_odd"), SNAME("TabContainer")));
} break; } break;
} }
} }
@ -2389,7 +2389,7 @@ HBoxContainer *ThemeTypeEditor::_create_property_control(Theme::DataType p_data_
item_rename_cancel_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_item_rename_canceled), varray(p_data_type, p_item_name, item_name_container)); item_rename_cancel_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_item_rename_canceled), varray(p_data_type, p_item_name, item_name_container));
item_rename_cancel_button->hide(); item_rename_cancel_button->hide();
} else { } else {
item_name->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("disabled_font_color"), SNAME("Editor"))); item_name->add_theme_color_override("font_color", get_theme_color(SNAME("disabled_font_color"), SNAME("Editor")));
Button *item_override_button = memnew(Button); Button *item_override_button = memnew(Button);
item_override_button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); item_override_button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
@ -3251,8 +3251,8 @@ void ThemeTypeEditor::_notification(int p_what) {
data_type_tabs->set_tab_icon(5, get_theme_icon(SNAME("StyleBoxFlat"), SNAME("EditorIcons"))); data_type_tabs->set_tab_icon(5, get_theme_icon(SNAME("StyleBoxFlat"), SNAME("EditorIcons")));
data_type_tabs->set_tab_icon(6, get_theme_icon(SNAME("Tools"), SNAME("EditorIcons"))); data_type_tabs->set_tab_icon(6, get_theme_icon(SNAME("Tools"), SNAME("EditorIcons")));
data_type_tabs->add_theme_style_override(SNAME("tab_selected"), get_theme_stylebox(SNAME("tab_selected_odd"), SNAME("TabContainer"))); data_type_tabs->add_theme_style_override("tab_selected", get_theme_stylebox(SNAME("tab_selected_odd"), SNAME("TabContainer")));
data_type_tabs->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("panel_odd"), SNAME("TabContainer"))); data_type_tabs->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel_odd"), SNAME("TabContainer")));
type_variation_button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); type_variation_button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
} break; } break;
@ -3532,9 +3532,9 @@ void ThemeEditor::_notification(int p_what) {
switch (p_what) { switch (p_what) {
case NOTIFICATION_ENTER_TREE: case NOTIFICATION_ENTER_TREE:
case NOTIFICATION_THEME_CHANGED: { case NOTIFICATION_THEME_CHANGED: {
preview_tabs->add_theme_style_override(SNAME("tab_selected"), get_theme_stylebox(SNAME("ThemeEditorPreviewFG"), SNAME("EditorStyles"))); preview_tabs->add_theme_style_override("tab_selected", get_theme_stylebox(SNAME("ThemeEditorPreviewFG"), SNAME("EditorStyles")));
preview_tabs->add_theme_style_override(SNAME("tab_unselected"), get_theme_stylebox(SNAME("ThemeEditorPreviewBG"), SNAME("EditorStyles"))); preview_tabs->add_theme_style_override("tab_unselected", get_theme_stylebox(SNAME("ThemeEditorPreviewBG"), SNAME("EditorStyles")));
preview_tabs_content->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("panel_odd"), SNAME("TabContainer"))); preview_tabs_content->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel_odd"), SNAME("TabContainer")));
add_preview_button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); add_preview_button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
} break; } break;
@ -3586,7 +3586,7 @@ ThemeEditor::ThemeEditor() {
VBoxContainer *preview_tabs_vb = memnew(VBoxContainer); VBoxContainer *preview_tabs_vb = memnew(VBoxContainer);
preview_tabs_vb->set_h_size_flags(SIZE_EXPAND_FILL); preview_tabs_vb->set_h_size_flags(SIZE_EXPAND_FILL);
preview_tabs_vb->set_custom_minimum_size(Size2(520, 0) * EDSCALE); preview_tabs_vb->set_custom_minimum_size(Size2(520, 0) * EDSCALE);
preview_tabs_vb->add_theme_constant_override(SNAME("separation"), 2 * EDSCALE); preview_tabs_vb->add_theme_constant_override("separation", 2 * EDSCALE);
main_hs->add_child(preview_tabs_vb); main_hs->add_child(preview_tabs_vb);
HBoxContainer *preview_tabbar_hb = memnew(HBoxContainer); HBoxContainer *preview_tabbar_hb = memnew(HBoxContainer);
preview_tabs_vb->add_child(preview_tabbar_hb); preview_tabs_vb->add_child(preview_tabbar_hb);

View File

@ -247,10 +247,10 @@ ThemeEditorPreview::ThemeEditorPreview() {
preview_content = memnew(MarginContainer); preview_content = memnew(MarginContainer);
preview_root->add_child(preview_content); preview_root->add_child(preview_content);
preview_content->add_theme_constant_override(SNAME("margin_right"), 4 * EDSCALE); preview_content->add_theme_constant_override("margin_right", 4 * EDSCALE);
preview_content->add_theme_constant_override(SNAME("margin_top"), 4 * EDSCALE); preview_content->add_theme_constant_override("margin_top", 4 * EDSCALE);
preview_content->add_theme_constant_override(SNAME("margin_left"), 4 * EDSCALE); preview_content->add_theme_constant_override("margin_left", 4 * EDSCALE);
preview_content->add_theme_constant_override(SNAME("margin_bottom"), 4 * EDSCALE); preview_content->add_theme_constant_override("margin_bottom", 4 * EDSCALE);
preview_overlay = memnew(MarginContainer); preview_overlay = memnew(MarginContainer);
preview_overlay->set_mouse_filter(MOUSE_FILTER_IGNORE); preview_overlay->set_mouse_filter(MOUSE_FILTER_IGNORE);
@ -269,20 +269,20 @@ DefaultThemeEditorPreview::DefaultThemeEditorPreview() {
preview_content->add_child(main_panel); preview_content->add_child(main_panel);
MarginContainer *main_mc = memnew(MarginContainer); MarginContainer *main_mc = memnew(MarginContainer);
main_mc->add_theme_constant_override(SNAME("margin_right"), 4 * EDSCALE); main_mc->add_theme_constant_override("margin_right", 4 * EDSCALE);
main_mc->add_theme_constant_override(SNAME("margin_top"), 4 * EDSCALE); main_mc->add_theme_constant_override("margin_top", 4 * EDSCALE);
main_mc->add_theme_constant_override(SNAME("margin_left"), 4 * EDSCALE); main_mc->add_theme_constant_override("margin_left", 4 * EDSCALE);
main_mc->add_theme_constant_override(SNAME("margin_bottom"), 4 * EDSCALE); main_mc->add_theme_constant_override("margin_bottom", 4 * EDSCALE);
preview_content->add_child(main_mc); preview_content->add_child(main_mc);
HBoxContainer *main_hb = memnew(HBoxContainer); HBoxContainer *main_hb = memnew(HBoxContainer);
main_mc->add_child(main_hb); main_mc->add_child(main_hb);
main_hb->add_theme_constant_override(SNAME("separation"), 20 * EDSCALE); main_hb->add_theme_constant_override("separation", 20 * EDSCALE);
VBoxContainer *first_vb = memnew(VBoxContainer); VBoxContainer *first_vb = memnew(VBoxContainer);
main_hb->add_child(first_vb); main_hb->add_child(first_vb);
first_vb->set_h_size_flags(SIZE_EXPAND_FILL); first_vb->set_h_size_flags(SIZE_EXPAND_FILL);
first_vb->add_theme_constant_override(SNAME("separation"), 10 * EDSCALE); first_vb->add_theme_constant_override("separation", 10 * EDSCALE);
first_vb->add_child(memnew(Label("Label"))); first_vb->add_child(memnew(Label("Label")));
@ -343,7 +343,7 @@ DefaultThemeEditorPreview::DefaultThemeEditorPreview() {
VBoxContainer *second_vb = memnew(VBoxContainer); VBoxContainer *second_vb = memnew(VBoxContainer);
second_vb->set_h_size_flags(SIZE_EXPAND_FILL); second_vb->set_h_size_flags(SIZE_EXPAND_FILL);
main_hb->add_child(second_vb); main_hb->add_child(second_vb);
second_vb->add_theme_constant_override(SNAME("separation"), 10 * EDSCALE); second_vb->add_theme_constant_override("separation", 10 * EDSCALE);
LineEdit *le = memnew(LineEdit); LineEdit *le = memnew(LineEdit);
le->set_text("LineEdit"); le->set_text("LineEdit");
second_vb->add_child(le); second_vb->add_child(le);
@ -383,7 +383,7 @@ DefaultThemeEditorPreview::DefaultThemeEditorPreview() {
VBoxContainer *third_vb = memnew(VBoxContainer); VBoxContainer *third_vb = memnew(VBoxContainer);
third_vb->set_h_size_flags(SIZE_EXPAND_FILL); third_vb->set_h_size_flags(SIZE_EXPAND_FILL);
third_vb->add_theme_constant_override(SNAME("separation"), 10 * EDSCALE); third_vb->add_theme_constant_override("separation", 10 * EDSCALE);
main_hb->add_child(third_vb); main_hb->add_child(third_vb);
TabContainer *tc = memnew(TabContainer); TabContainer *tc = memnew(TabContainer);

View File

@ -585,7 +585,7 @@ TileAtlasView::TileAtlasView() {
hbox = memnew(HBoxContainer); hbox = memnew(HBoxContainer);
hbox->set_mouse_filter(Control::MOUSE_FILTER_IGNORE); hbox->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
hbox->add_theme_constant_override(SNAME("separation"), 10); hbox->add_theme_constant_override("separation", 10);
hbox->hide(); hbox->hide();
margin_container->add_child(hbox); margin_container->add_child(hbox);

View File

@ -2095,7 +2095,7 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() {
scatter_spinbox->set_max(1000); scatter_spinbox->set_max(1000);
scatter_spinbox->set_step(0.001); scatter_spinbox->set_step(0.001);
scatter_spinbox->set_tooltip(TTR("Defines the probability of painting nothing instead of a randomly selected tile.")); scatter_spinbox->set_tooltip(TTR("Defines the probability of painting nothing instead of a randomly selected tile."));
scatter_spinbox->get_line_edit()->add_theme_constant_override(SNAME("minimum_character_width"), 4); scatter_spinbox->get_line_edit()->add_theme_constant_override("minimum_character_width", 4);
scatter_spinbox->connect("value_changed", callable_mp(this, &TileMapEditorTilesPlugin::_on_scattering_spinbox_changed)); scatter_spinbox->connect("value_changed", callable_mp(this, &TileMapEditorTilesPlugin::_on_scattering_spinbox_changed));
tools_settings->add_child(scatter_spinbox); tools_settings->add_child(scatter_spinbox);

View File

@ -609,8 +609,8 @@ void TileSetAtlasSourceEditor::_update_tile_data_editors() {
} }
// Theming. // Theming.
tile_data_editors_tree->add_theme_constant_override(SNAME("vseparation"), 1); tile_data_editors_tree->add_theme_constant_override("vseparation", 1);
tile_data_editors_tree->add_theme_constant_override(SNAME("hseparation"), 3); tile_data_editors_tree->add_theme_constant_override("hseparation", 3);
Color group_color = get_theme_color(SNAME("prop_category"), SNAME("Editor")); Color group_color = get_theme_color(SNAME("prop_category"), SNAME("Editor"));
@ -908,10 +908,10 @@ void TileSetAtlasSourceEditor::_update_atlas_view() {
alternative_tiles_control->add_child(button); alternative_tiles_control->add_child(button);
button->set_flat(true); button->set_flat(true);
button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
button->add_theme_style_override(SNAME("normal"), memnew(StyleBoxEmpty)); button->add_theme_style_override("normal", memnew(StyleBoxEmpty));
button->add_theme_style_override(SNAME("hover"), memnew(StyleBoxEmpty)); button->add_theme_style_override("hover", memnew(StyleBoxEmpty));
button->add_theme_style_override(SNAME("focus"), memnew(StyleBoxEmpty)); button->add_theme_style_override("focus", memnew(StyleBoxEmpty));
button->add_theme_style_override(SNAME("pressed"), memnew(StyleBoxEmpty)); button->add_theme_style_override("pressed", memnew(StyleBoxEmpty));
button->connect("pressed", callable_mp(tile_set_atlas_source, &TileSetAtlasSource::create_alternative_tile), varray(tile_id, TileSetSource::INVALID_TILE_ALTERNATIVE)); button->connect("pressed", callable_mp(tile_set_atlas_source, &TileSetAtlasSource::create_alternative_tile), varray(tile_id, TileSetSource::INVALID_TILE_ALTERNATIVE));
button->set_rect(Rect2(Vector2(pos.x, pos.y + (y_increment - texture_region_base_size.y) / 2.0), Vector2(texture_region_base_size_min, texture_region_base_size_min))); button->set_rect(Rect2(Vector2(pos.x, pos.y + (y_increment - texture_region_base_size.y) / 2.0), Vector2(texture_region_base_size_min, texture_region_base_size_min)));
button->set_expand_icon(true); button->set_expand_icon(true);

View File

@ -679,7 +679,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) {
} else { } else {
hb = memnew(HBoxContainer); hb = memnew(HBoxContainer);
} }
hb->add_theme_constant_override(SNAME("separation"), 7 * EDSCALE); hb->add_theme_constant_override("separation", 7 * EDSCALE);
Variant default_value; Variant default_value;
@ -732,14 +732,14 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) {
} else { } else {
Label *label = memnew(Label); Label *label = memnew(Label);
label->set_text(name_left); label->set_text(name_left);
label->add_theme_style_override(SNAME("normal"), label_style); //more compact label->add_theme_style_override("normal", label_style); //more compact
hb->add_child(label); hb->add_child(label);
if (vsnode->is_input_port_default(i, mode) && !port_left_used) { if (vsnode->is_input_port_default(i, mode) && !port_left_used) {
Label *hint_label = memnew(Label); Label *hint_label = memnew(Label);
hint_label->set_text(TTR("[default]")); hint_label->set_text(TTR("[default]"));
hint_label->add_theme_color_override(SNAME("font_color"), editor->get_theme_color(SNAME("font_readonly_color"), SNAME("TextEdit"))); hint_label->add_theme_color_override("font_color", editor->get_theme_color(SNAME("font_readonly_color"), SNAME("TextEdit")));
hint_label->add_theme_style_override(SNAME("normal"), label_style); hint_label->add_theme_style_override("normal", label_style);
hb->add_child(hint_label); hb->add_child(hint_label);
} }
} }
@ -779,7 +779,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) {
} else { } else {
Label *label = memnew(Label); Label *label = memnew(Label);
label->set_text(name_right); label->set_text(name_right);
label->add_theme_style_override(SNAME("normal"), label_style); //more compact label->add_theme_style_override("normal", label_style); //more compact
hb->add_child(label); hb->add_child(label);
} }
} }
@ -896,7 +896,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) {
String error = vsnode->get_warning(mode, p_type); String error = vsnode->get_warning(mode, p_type);
if (!error.is_empty()) { if (!error.is_empty()) {
Label *error_label = memnew(Label); Label *error_label = memnew(Label);
error_label->add_theme_color_override(SNAME("font_color"), editor->get_theme_color(SNAME("error_color"), SNAME("Editor"))); error_label->add_theme_color_override("font_color", editor->get_theme_color(SNAME("error_color"), SNAME("Editor")));
error_label->set_text(error); error_label->set_text(error);
node->add_child(error_label); node->add_child(error_label);
} }
@ -920,7 +920,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) {
Color members_color = EDITOR_GET("text_editor/theme/highlighting/member_variable_color"); Color members_color = EDITOR_GET("text_editor/theme/highlighting/member_variable_color");
expression_box->set_syntax_highlighter(expression_syntax_highlighter); expression_box->set_syntax_highlighter(expression_syntax_highlighter);
expression_box->add_theme_color_override(SNAME("background_color"), background_color); expression_box->add_theme_color_override("background_color", background_color);
for (const String &E : editor->keyword_list) { for (const String &E : editor->keyword_list) {
if (ShaderLanguage::is_control_flow_keyword(E)) { if (ShaderLanguage::is_control_flow_keyword(E)) {
@ -930,9 +930,9 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) {
} }
} }
expression_box->add_theme_font_override(SNAME("font"), editor->get_theme_font(SNAME("expression"), SNAME("EditorFonts"))); expression_box->add_theme_font_override("font", editor->get_theme_font(SNAME("expression"), SNAME("EditorFonts")));
expression_box->add_theme_font_size_override(SNAME("font_size"), editor->get_theme_font_size(SNAME("expression_size"), SNAME("EditorFonts"))); expression_box->add_theme_font_size_override("font_size", editor->get_theme_font_size(SNAME("expression_size"), SNAME("EditorFonts")));
expression_box->add_theme_color_override(SNAME("font_color"), text_color); expression_box->add_theme_color_override("font_color", text_color);
expression_syntax_highlighter->set_number_color(number_color); expression_syntax_highlighter->set_number_color(number_color);
expression_syntax_highlighter->set_symbol_color(symbol_color); expression_syntax_highlighter->set_symbol_color(symbol_color);
expression_syntax_highlighter->set_function_color(function_color); expression_syntax_highlighter->set_function_color(function_color);
@ -1512,10 +1512,10 @@ void VisualShaderEditor::_update_created_node(GraphNode *node) {
const Color mono_color = ((c.r + c.g + c.b) / 3) < 0.7 ? Color(1.0, 1.0, 1.0, 0.85) : Color(0.0, 0.0, 0.0, 0.85); const Color mono_color = ((c.r + c.g + c.b) / 3) < 0.7 ? Color(1.0, 1.0, 1.0, 0.85) : Color(0.0, 0.0, 0.0, 0.85);
c = mono_color; c = mono_color;
node->add_theme_color_override(SNAME("title_color"), c); node->add_theme_color_override("title_color", c);
c.a = 0.7; c.a = 0.7;
node->add_theme_color_override(SNAME("close_color"), c); node->add_theme_color_override("close_color", c);
node->add_theme_color_override(SNAME("resizer_color"), c); node->add_theme_color_override("resizer_color", c);
} }
void VisualShaderEditor::_update_uniforms(bool p_update_refs) { void VisualShaderEditor::_update_uniforms(bool p_update_refs) {
@ -3421,7 +3421,7 @@ void VisualShaderEditor::_notification(int p_what) {
Color number_color = EDITOR_GET("text_editor/theme/highlighting/number_color"); Color number_color = EDITOR_GET("text_editor/theme/highlighting/number_color");
Color members_color = EDITOR_GET("text_editor/theme/highlighting/member_variable_color"); Color members_color = EDITOR_GET("text_editor/theme/highlighting/member_variable_color");
preview_text->add_theme_color_override(SNAME("background_color"), background_color); preview_text->add_theme_color_override("background_color", background_color);
for (const String &E : keyword_list) { for (const String &E : keyword_list) {
if (ShaderLanguage::is_control_flow_keyword(E)) { if (ShaderLanguage::is_control_flow_keyword(E)) {
@ -3431,9 +3431,9 @@ void VisualShaderEditor::_notification(int p_what) {
} }
} }
preview_text->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("expression"), SNAME("EditorFonts"))); preview_text->add_theme_font_override("font", get_theme_font(SNAME("expression"), SNAME("EditorFonts")));
preview_text->add_theme_font_size_override(SNAME("font_size"), get_theme_font_size(SNAME("expression_size"), SNAME("EditorFonts"))); preview_text->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("expression_size"), SNAME("EditorFonts")));
preview_text->add_theme_color_override(SNAME("font_color"), text_color); preview_text->add_theme_color_override("font_color", text_color);
syntax_highlighter->set_number_color(number_color); syntax_highlighter->set_number_color(number_color);
syntax_highlighter->set_symbol_color(symbol_color); syntax_highlighter->set_symbol_color(symbol_color);
syntax_highlighter->set_function_color(function_color); syntax_highlighter->set_function_color(function_color);
@ -3446,10 +3446,10 @@ void VisualShaderEditor::_notification(int p_what) {
preview_text->add_comment_delimiter("/*", "*/", false); preview_text->add_comment_delimiter("/*", "*/", false);
preview_text->add_comment_delimiter("//", "", true); preview_text->add_comment_delimiter("//", "", true);
error_panel->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("panel"), SNAME("Panel"))); error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Panel")));
error_label->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("status_source"), SNAME("EditorFonts"))); error_label->add_theme_font_override("font", get_theme_font(SNAME("status_source"), SNAME("EditorFonts")));
error_label->add_theme_font_size_override(SNAME("font_size"), get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts"))); error_label->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts")));
error_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
} }
tools->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("Tools"), SNAME("EditorIcons"))); tools->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("Tools"), SNAME("EditorIcons")));
@ -4301,7 +4301,7 @@ VisualShaderEditor::VisualShaderEditor() {
preview_vbox = memnew(VBoxContainer); preview_vbox = memnew(VBoxContainer);
preview_window->add_child(preview_vbox); preview_window->add_child(preview_vbox);
preview_vbox->add_theme_constant_override(SNAME("separation"), 0); preview_vbox->add_theme_constant_override("separation", 0);
preview_text = memnew(CodeEdit); preview_text = memnew(CodeEdit);
syntax_highlighter.instantiate(); syntax_highlighter.instantiate();

View File

@ -1158,7 +1158,7 @@ ProjectExportDialog::ProjectExportDialog() {
script_key->connect("text_changed", callable_mp(this, &ProjectExportDialog::_script_encryption_key_changed)); script_key->connect("text_changed", callable_mp(this, &ProjectExportDialog::_script_encryption_key_changed));
script_key_error = memnew(Label); script_key_error = memnew(Label);
script_key_error->set_text(String::utf8("") + TTR("Invalid Encryption Key (must be 64 hexadecimal characters long)")); script_key_error->set_text(String::utf8("") + TTR("Invalid Encryption Key (must be 64 hexadecimal characters long)"));
script_key_error->add_theme_color_override(SNAME("font_color"), EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("error_color"), SNAME("Editor"))); script_key_error->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("error_color"), SNAME("Editor")));
sec_vb->add_margin_child(TTR("Encryption Key (256-bits as hexadecimal):"), script_key); sec_vb->add_margin_child(TTR("Encryption Key (256-bits as hexadecimal):"), script_key);
sec_vb->add_child(script_key_error); sec_vb->add_child(script_key_error);
sections->add_child(sec_vb); sections->add_child(sec_vb);
@ -1227,12 +1227,12 @@ ProjectExportDialog::ProjectExportDialog() {
export_error = memnew(Label); export_error = memnew(Label);
main_vb->add_child(export_error); main_vb->add_child(export_error);
export_error->hide(); export_error->hide();
export_error->add_theme_color_override(SNAME("font_color"), EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("error_color"), SNAME("Editor"))); export_error->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("error_color"), SNAME("Editor")));
export_warning = memnew(Label); export_warning = memnew(Label);
main_vb->add_child(export_warning); main_vb->add_child(export_warning);
export_warning->hide(); export_warning->hide();
export_warning->add_theme_color_override(SNAME("font_color"), EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("warning_color"), SNAME("Editor"))); export_warning->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("warning_color"), SNAME("Editor")));
export_templates_error = memnew(HBoxContainer); export_templates_error = memnew(HBoxContainer);
main_vb->add_child(export_templates_error); main_vb->add_child(export_templates_error);
@ -1240,7 +1240,7 @@ ProjectExportDialog::ProjectExportDialog() {
Label *export_error2 = memnew(Label); Label *export_error2 = memnew(Label);
export_templates_error->add_child(export_error2); export_templates_error->add_child(export_error2);
export_error2->add_theme_color_override(SNAME("font_color"), EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("error_color"), SNAME("Editor"))); export_error2->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("error_color"), SNAME("Editor")));
export_error2->set_text(String::utf8("") + TTR("Export templates for this platform are missing:") + " "); export_error2->set_text(String::utf8("") + TTR("Export templates for this platform are missing:") + " ");
error_dialog = memnew(AcceptDialog); error_dialog = memnew(AcceptDialog);

View File

@ -117,13 +117,13 @@ private:
switch (p_type) { switch (p_type) {
case MESSAGE_ERROR: { case MESSAGE_ERROR: {
msg->add_theme_color_override(SNAME("font_color"), msg->get_theme_color(SNAME("error_color"), SNAME("Editor"))); msg->add_theme_color_override("font_color", msg->get_theme_color(SNAME("error_color"), SNAME("Editor")));
msg->set_modulate(Color(1, 1, 1, 1)); msg->set_modulate(Color(1, 1, 1, 1));
new_icon = msg->get_theme_icon(SNAME("StatusError"), SNAME("EditorIcons")); new_icon = msg->get_theme_icon(SNAME("StatusError"), SNAME("EditorIcons"));
} break; } break;
case MESSAGE_WARNING: { case MESSAGE_WARNING: {
msg->add_theme_color_override(SNAME("font_color"), msg->get_theme_color(SNAME("warning_color"), SNAME("Editor"))); msg->add_theme_color_override("font_color", msg->get_theme_color(SNAME("warning_color"), SNAME("Editor")));
msg->set_modulate(Color(1, 1, 1, 1)); msg->set_modulate(Color(1, 1, 1, 1));
new_icon = msg->get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons")); new_icon = msg->get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons"));
@ -1349,7 +1349,7 @@ void ProjectList::create_project_item_control(int p_index) {
ProjectListItemControl *hb = memnew(ProjectListItemControl); ProjectListItemControl *hb = memnew(ProjectListItemControl);
hb->connect("draw", callable_mp(this, &ProjectList::_panel_draw), varray(hb)); hb->connect("draw", callable_mp(this, &ProjectList::_panel_draw), varray(hb));
hb->connect("gui_input", callable_mp(this, &ProjectList::_panel_input), varray(hb)); hb->connect("gui_input", callable_mp(this, &ProjectList::_panel_input), varray(hb));
hb->add_theme_constant_override(SNAME("separation"), 10 * EDSCALE); hb->add_theme_constant_override("separation", 10 * EDSCALE);
hb->set_tooltip(item.description); hb->set_tooltip(item.description);
VBoxContainer *favorite_box = memnew(VBoxContainer); VBoxContainer *favorite_box = memnew(VBoxContainer);
@ -1394,9 +1394,9 @@ void ProjectList::create_project_item_control(int p_index) {
Label *title = memnew(Label(!item.missing ? item.project_name : TTR("Missing Project"))); Label *title = memnew(Label(!item.missing ? item.project_name : TTR("Missing Project")));
title->set_h_size_flags(Control::SIZE_EXPAND_FILL); title->set_h_size_flags(Control::SIZE_EXPAND_FILL);
title->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("title"), SNAME("EditorFonts"))); title->add_theme_font_override("font", get_theme_font(SNAME("title"), SNAME("EditorFonts")));
title->add_theme_font_size_override(SNAME("font_size"), get_theme_font_size(SNAME("title_size"), SNAME("EditorFonts"))); title->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("title_size"), SNAME("EditorFonts")));
title->add_theme_color_override(SNAME("font_color"), font_color); title->add_theme_color_override("font_color", font_color);
title->set_clip_text(true); title->set_clip_text(true);
title_hb->add_child(title); title_hb->add_child(title);
@ -1405,8 +1405,8 @@ void ProjectList::create_project_item_control(int p_index) {
if (length > 0) { if (length > 0) {
Label *unsupported_label = memnew(Label(unsupported_features_str)); Label *unsupported_label = memnew(Label(unsupported_features_str));
unsupported_label->set_custom_minimum_size(Size2(length * 15, 10) * EDSCALE); unsupported_label->set_custom_minimum_size(Size2(length * 15, 10) * EDSCALE);
unsupported_label->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("title"), SNAME("EditorFonts"))); unsupported_label->add_theme_font_override("font", get_theme_font(SNAME("title"), SNAME("EditorFonts")));
unsupported_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("warning_color"), SNAME("Editor"))); unsupported_label->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
unsupported_label->set_clip_text(true); unsupported_label->set_clip_text(true);
unsupported_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); unsupported_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT);
title_hb->add_child(unsupported_label); title_hb->add_child(unsupported_label);
@ -1443,7 +1443,7 @@ void ProjectList::create_project_item_control(int p_index) {
path_hb->add_child(fpath); path_hb->add_child(fpath);
fpath->set_h_size_flags(Control::SIZE_EXPAND_FILL); fpath->set_h_size_flags(Control::SIZE_EXPAND_FILL);
fpath->set_modulate(Color(1, 1, 1, 0.5)); fpath->set_modulate(Color(1, 1, 1, 0.5));
fpath->add_theme_color_override(SNAME("font_color"), font_color); fpath->add_theme_color_override("font_color", font_color);
fpath->set_clip_text(true); fpath->set_clip_text(true);
} }
@ -2524,7 +2524,7 @@ ProjectManager::ProjectManager() {
Panel *panel = memnew(Panel); Panel *panel = memnew(Panel);
add_child(panel); add_child(panel);
panel->set_anchors_and_offsets_preset(Control::PRESET_WIDE); panel->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
panel->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("Background"), SNAME("EditorStyles"))); panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("Background"), SNAME("EditorStyles")));
VBoxContainer *vb = memnew(VBoxContainer); VBoxContainer *vb = memnew(VBoxContainer);
panel->add_child(vb); panel->add_child(vb);
@ -2562,7 +2562,7 @@ ProjectManager::ProjectManager() {
hb->add_child(search_box); hb->add_child(search_box);
loading_label = memnew(Label(TTR("Loading, please wait..."))); loading_label = memnew(Label(TTR("Loading, please wait...")));
loading_label->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("bold"), SNAME("EditorFonts"))); loading_label->add_theme_font_override("font", get_theme_font(SNAME("bold"), SNAME("EditorFonts")));
loading_label->set_h_size_flags(Control::SIZE_EXPAND_FILL); loading_label->set_h_size_flags(Control::SIZE_EXPAND_FILL);
hb->add_child(loading_label); hb->add_child(loading_label);
// Hide the label but make it still take up space. This prevents reflows when showing the label. // Hide the label but make it still take up space. This prevents reflows when showing the label.
@ -2588,7 +2588,7 @@ ProjectManager::ProjectManager() {
} }
PanelContainer *pc = memnew(PanelContainer); PanelContainer *pc = memnew(PanelContainer);
pc->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); pc->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
pc->set_v_size_flags(Control::SIZE_EXPAND_FILL); pc->set_v_size_flags(Control::SIZE_EXPAND_FILL);
search_tree_vb->add_child(pc); search_tree_vb->add_child(pc);

View File

@ -509,9 +509,9 @@ void ProjectSettingsEditor::_update_action_map_editor() {
void ProjectSettingsEditor::_update_theme() { void ProjectSettingsEditor::_update_theme() {
search_box->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); search_box->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
restart_close_button->set_icon(get_theme_icon(SNAME("Close"), SNAME("EditorIcons"))); restart_close_button->set_icon(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
restart_container->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); restart_container->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
restart_icon->set_texture(get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons"))); restart_icon->set_texture(get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons")));
restart_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("warning_color"), SNAME("Editor"))); restart_label->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
type_box->clear(); type_box->clear();
for (int i = 0; i < Variant::VARIANT_MAX; i++) { for (int i = 0; i < Variant::VARIANT_MAX; i++) {

View File

@ -261,7 +261,7 @@ EditorQuickOpen::EditorQuickOpen() {
search_options->create_item(); search_options->create_item();
search_options->set_hide_root(true); search_options->set_hide_root(true);
search_options->set_hide_folding(true); search_options->set_hide_folding(true);
search_options->add_theme_constant_override(SNAME("draw_guides"), 1); search_options->add_theme_constant_override("draw_guides", 1);
vbc->add_margin_child(TTR("Matches:"), search_options, true); vbc->add_margin_child(TTR("Matches:"), search_options, true);
get_ok_button()->set_text(TTR("Open")); get_ok_button()->set_text(TTR("Open"));

View File

@ -391,9 +391,9 @@ void RenameDialog::_update_preview(String new_text) {
// New name is identical to the old one. Don't color it as much to avoid distracting the user. // New name is identical to the old one. Don't color it as much to avoid distracting the user.
const Color accent_color = EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("accent_color"), SNAME("Editor")); const Color accent_color = EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("accent_color"), SNAME("Editor"));
const Color text_color = EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("default_color"), SNAME("RichTextLabel")); const Color text_color = EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("default_color"), SNAME("RichTextLabel"));
lbl_preview->add_theme_color_override(SNAME("font_color"), accent_color.lerp(text_color, 0.5)); lbl_preview->add_theme_color_override("font_color", accent_color.lerp(text_color, 0.5));
} else { } else {
lbl_preview->add_theme_color_override(SNAME("font_color"), EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("success_color"), SNAME("Editor"))); lbl_preview->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("success_color"), SNAME("Editor")));
} }
} }
@ -479,7 +479,7 @@ void RenameDialog::_error_handler(void *p_self, const char *p_func, const char *
self->has_errors = true; self->has_errors = true;
self->lbl_preview_title->set_text(TTR("Regular Expression Error:")); self->lbl_preview_title->set_text(TTR("Regular Expression Error:"));
self->lbl_preview->add_theme_color_override(SNAME("font_color"), EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("error_color"), SNAME("Editor"))); self->lbl_preview->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("error_color"), SNAME("Editor")));
self->lbl_preview->set_text(vformat(TTR("At character %s"), err_str)); self->lbl_preview->set_text(vformat(TTR("At character %s"), err_str));
} }

View File

@ -3301,7 +3301,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel
VBoxContainer *vbc = this; VBoxContainer *vbc = this;
HBoxContainer *filter_hbc = memnew(HBoxContainer); HBoxContainer *filter_hbc = memnew(HBoxContainer);
filter_hbc->add_theme_constant_override(SNAME("separate"), 0); filter_hbc->add_theme_constant_override("separate", 0);
ED_SHORTCUT("scene_tree/rename", TTR("Rename"), Key::F2); ED_SHORTCUT("scene_tree/rename", TTR("Rename"), Key::F2);
ED_SHORTCUT_OVERRIDE("scene_tree/rename", "macos", Key::ENTER); ED_SHORTCUT_OVERRIDE("scene_tree/rename", "macos", Key::ENTER);
@ -3349,7 +3349,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel
filter->set_h_size_flags(SIZE_EXPAND_FILL); filter->set_h_size_flags(SIZE_EXPAND_FILL);
filter->set_placeholder(TTR("Filter nodes")); filter->set_placeholder(TTR("Filter nodes"));
filter_hbc->add_child(filter); filter_hbc->add_child(filter);
filter->add_theme_constant_override(SNAME("minimum_character_width"), 0); filter->add_theme_constant_override("minimum_character_width", 0);
filter->connect("text_changed", callable_mp(this, &SceneTreeDock::_filter_changed)); filter->connect("text_changed", callable_mp(this, &SceneTreeDock::_filter_changed));
button_create_script = memnew(Button); button_create_script = memnew(Button);

View File

@ -1219,7 +1219,7 @@ SceneTreeEditor::SceneTreeEditor(bool p_label, bool p_can_rename, bool p_can_ope
tree->set_begin(Point2(0, p_label ? 18 : 0)); tree->set_begin(Point2(0, p_label ? 18 : 0));
tree->set_end(Point2(0, 0)); tree->set_end(Point2(0, 0));
tree->set_allow_reselect(true); tree->set_allow_reselect(true);
tree->add_theme_constant_override(SNAME("button_margin"), 0); tree->add_theme_constant_override("button_margin", 0);
add_child(tree); add_child(tree);
@ -1324,7 +1324,7 @@ SceneTreeDialog::SceneTreeDialog() {
filter->set_h_size_flags(Control::SIZE_EXPAND_FILL); filter->set_h_size_flags(Control::SIZE_EXPAND_FILL);
filter->set_placeholder(TTR("Filter nodes")); filter->set_placeholder(TTR("Filter nodes"));
filter->set_clear_button_enabled(true); filter->set_clear_button_enabled(true);
filter->add_theme_constant_override(SNAME("minimum_character_width"), 0); filter->add_theme_constant_override("minimum_character_width", 0);
filter->connect("text_changed", callable_mp(this, &SceneTreeDialog::_filter_changed)); filter->connect("text_changed", callable_mp(this, &SceneTreeDialog::_filter_changed));
vbc->add_child(filter); vbc->add_child(filter);

View File

@ -70,7 +70,7 @@ void ScriptCreateDialog::_notification(int p_what) {
path_button->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons"))); path_button->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
parent_browse_button->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons"))); parent_browse_button->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
parent_search_button->set_icon(get_theme_icon(SNAME("ClassList"), SNAME("EditorIcons"))); parent_search_button->set_icon(get_theme_icon(SNAME("ClassList"), SNAME("EditorIcons")));
status_panel->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); status_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
} break; } break;
} }
} }
@ -291,7 +291,7 @@ void ScriptCreateDialog::_template_changed(int p_template) {
template_info += " - " + sinfo.description; template_info += " - " + sinfo.description;
} }
template_info_label->set_text(template_info); template_info_label->set_text(template_info);
template_info_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("success_color"), SNAME("Editor"))); template_info_label->add_theme_color_override("font_color", get_theme_color(SNAME("success_color"), SNAME("Editor")));
} }
void ScriptCreateDialog::ok_pressed() { void ScriptCreateDialog::ok_pressed() {
@ -522,18 +522,18 @@ void ScriptCreateDialog::_path_submitted(const String &p_path) {
void ScriptCreateDialog::_msg_script_valid(bool valid, const String &p_msg) { void ScriptCreateDialog::_msg_script_valid(bool valid, const String &p_msg) {
error_label->set_text(String::utf8("") + p_msg); error_label->set_text(String::utf8("") + p_msg);
if (valid) { if (valid) {
error_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("success_color"), SNAME("Editor"))); error_label->add_theme_color_override("font_color", get_theme_color(SNAME("success_color"), SNAME("Editor")));
} else { } else {
error_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
} }
} }
void ScriptCreateDialog::_msg_path_valid(bool valid, const String &p_msg) { void ScriptCreateDialog::_msg_path_valid(bool valid, const String &p_msg) {
path_error_label->set_text(String::utf8("") + p_msg); path_error_label->set_text(String::utf8("") + p_msg);
if (valid) { if (valid) {
path_error_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("success_color"), SNAME("Editor"))); path_error_label->add_theme_color_override("font_color", get_theme_color(SNAME("success_color"), SNAME("Editor")));
} else { } else {
path_error_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); path_error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
} }
} }
@ -658,7 +658,7 @@ void ScriptCreateDialog::_update_dialog() {
class_name->set_placeholder(TTR("Allowed: a-z, A-Z, 0-9, _ and .")); class_name->set_placeholder(TTR("Allowed: a-z, A-Z, 0-9, _ and ."));
Color placeholder_color = class_name->get_theme_color(SNAME("font_placeholder_color")); Color placeholder_color = class_name->get_theme_color(SNAME("font_placeholder_color"));
placeholder_color.a = 0.3; placeholder_color.a = 0.3;
class_name->add_theme_color_override(SNAME("font_placeholder_color"), placeholder_color); class_name->add_theme_color_override("font_placeholder_color", placeholder_color);
} else { } else {
class_name->set_editable(false); class_name->set_editable(false);
} }
@ -667,7 +667,7 @@ void ScriptCreateDialog::_update_dialog() {
class_name->set_placeholder(TTR("N/A")); class_name->set_placeholder(TTR("N/A"));
Color placeholder_color = class_name->get_theme_color(SNAME("font_placeholder_color")); Color placeholder_color = class_name->get_theme_color(SNAME("font_placeholder_color"));
placeholder_color.a = 1; placeholder_color.a = 1;
class_name->add_theme_color_override(SNAME("font_placeholder_color"), placeholder_color); class_name->add_theme_color_override("font_placeholder_color", placeholder_color);
class_name->set_text(""); class_name->set_text("");
} }
@ -911,7 +911,7 @@ ScriptCreateDialog::ScriptCreateDialog() {
script_name_warning_label->set_text( script_name_warning_label->set_text(
TTR("Warning: Having the script name be the same as a built-in type is usually not desired.")); TTR("Warning: Having the script name be the same as a built-in type is usually not desired."));
vb->add_child(script_name_warning_label); vb->add_child(script_name_warning_label);
script_name_warning_label->add_theme_color_override(SNAME("font_color"), Color(1, 0.85, 0.4)); script_name_warning_label->add_theme_color_override("font_color", Color(1, 0.85, 0.4));
script_name_warning_label->set_autowrap_mode(Label::AUTOWRAP_WORD_SMART); script_name_warning_label->set_autowrap_mode(Label::AUTOWRAP_WORD_SMART);
script_name_warning_label->hide(); script_name_warning_label->hide();

View File

@ -72,7 +72,7 @@ void ShaderCreateDialog::_update_theme() {
} }
path_button->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons"))); path_button->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
status_panel->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); status_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
} }
void ShaderCreateDialog::_update_language_info() { void ShaderCreateDialog::_update_language_info() {
@ -419,18 +419,18 @@ String ShaderCreateDialog::_validate_path(const String &p_path) {
void ShaderCreateDialog::_msg_script_valid(bool valid, const String &p_msg) { void ShaderCreateDialog::_msg_script_valid(bool valid, const String &p_msg) {
error_label->set_text("- " + p_msg); error_label->set_text("- " + p_msg);
if (valid) { if (valid) {
error_label->add_theme_color_override(SNAME("font_color"), gc->get_theme_color(SNAME("success_color"), SNAME("Editor"))); error_label->add_theme_color_override("font_color", gc->get_theme_color(SNAME("success_color"), SNAME("Editor")));
} else { } else {
error_label->add_theme_color_override(SNAME("font_color"), gc->get_theme_color(SNAME("error_color"), SNAME("Editor"))); error_label->add_theme_color_override("font_color", gc->get_theme_color(SNAME("error_color"), SNAME("Editor")));
} }
} }
void ShaderCreateDialog::_msg_path_valid(bool valid, const String &p_msg) { void ShaderCreateDialog::_msg_path_valid(bool valid, const String &p_msg) {
path_error_label->set_text("- " + p_msg); path_error_label->set_text("- " + p_msg);
if (valid) { if (valid) {
path_error_label->add_theme_color_override(SNAME("font_color"), gc->get_theme_color(SNAME("success_color"), SNAME("Editor"))); path_error_label->add_theme_color_override("font_color", gc->get_theme_color(SNAME("success_color"), SNAME("Editor")));
} else { } else {
path_error_label->add_theme_color_override(SNAME("font_color"), gc->get_theme_color(SNAME("error_color"), SNAME("Editor"))); path_error_label->add_theme_color_override("font_color", gc->get_theme_color(SNAME("error_color"), SNAME("Editor")));
} }
} }

View File

@ -1181,7 +1181,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) {
floor->set_min(-32767); floor->set_min(-32767);
floor->set_max(32767); floor->set_max(32767);
floor->set_step(1); floor->set_step(1);
floor->get_line_edit()->add_theme_constant_override(SNAME("minimum_character_width"), 16); floor->get_line_edit()->add_theme_constant_override("minimum_character_width", 16);
spatial_editor_hb->add_child(floor); spatial_editor_hb->add_child(floor);
floor->connect("value_changed", callable_mp(this, &GridMapEditor::_floor_changed)); floor->connect("value_changed", callable_mp(this, &GridMapEditor::_floor_changed));

View File

@ -712,7 +712,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
LineEdit *line_edit = memnew(LineEdit); LineEdit *line_edit = memnew(LineEdit);
line_edit->set_text(node->get_text()); line_edit->set_text(node->get_text());
line_edit->set_expand_to_text_length_enabled(true); line_edit->set_expand_to_text_length_enabled(true);
line_edit->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("source"), SNAME("EditorFonts"))); line_edit->add_theme_font_override("font", get_theme_font(SNAME("source"), SNAME("EditorFonts")));
gnode->add_child(line_edit); gnode->add_child(line_edit);
line_edit->connect("text_changed", callable_mp(this, &VisualScriptEditor::_expression_text_changed), varray(E)); line_edit->connect("text_changed", callable_mp(this, &VisualScriptEditor::_expression_text_changed), varray(E));
} else { } else {
@ -742,11 +742,11 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
Color c = sbf->get_border_color(); Color c = sbf->get_border_color();
c = ((c.r + c.g + c.b) / 3) < 0.7 ? Color(1.0, 1.0, 1.0, 0.85) : Color(0.0, 0.0, 0.0, 0.85); c = ((c.r + c.g + c.b) / 3) < 0.7 ? Color(1.0, 1.0, 1.0, 0.85) : Color(0.0, 0.0, 0.0, 0.85);
Color ic = c; Color ic = c;
gnode->add_theme_color_override(SNAME("title_color"), c); gnode->add_theme_color_override("title_color", c);
c.a = 1; c.a = 1;
gnode->add_theme_color_override(SNAME("close_color"), c); gnode->add_theme_color_override("close_color", c);
gnode->add_theme_color_override(SNAME("resizer_color"), ic); gnode->add_theme_color_override("resizer_color", ic);
gnode->add_theme_style_override(SNAME("frame"), sbf); gnode->add_theme_style_override("frame", sbf);
} }
const Color mono_color = get_theme_color(SNAME("mono_color"), SNAME("Editor")); const Color mono_color = get_theme_color(SNAME("mono_color"), SNAME("Editor"));
@ -2660,7 +2660,7 @@ Ref<Texture2D> VisualScriptEditor::get_theme_icon() {
icon_name += "Internal"; icon_name += "Internal";
} }
if (Control::has_theme_icon(icon_name, SNAME("EditorIcons"))) { if (Control::has_theme_icon(icon_name, "EditorIcons")) {
return Control::get_theme_icon(icon_name, SNAME("EditorIcons")); return Control::get_theme_icon(icon_name, SNAME("EditorIcons"));
} }
@ -3930,13 +3930,13 @@ void VisualScriptEditor::_notification(int p_what) {
update_toggle_scripts_button(); update_toggle_scripts_button();
edit_variable_edit->add_theme_style_override(SNAME("bg"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); edit_variable_edit->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
edit_signal_edit->add_theme_style_override(SNAME("bg"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); edit_signal_edit->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
func_input_scroll->add_theme_style_override(SNAME("bg"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); func_input_scroll->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
Ref<Theme> tm = EditorNode::get_singleton()->get_theme_base()->get_theme(); Ref<Theme> tm = EditorNode::get_singleton()->get_theme_base()->get_theme();
bool dark_theme = tm->get_constant(SNAME("dark_theme"), SNAME("Editor")); bool dark_theme = tm->get_constant("dark_theme", "Editor");
if (dark_theme) { if (dark_theme) {
node_colors["flow_control"] = Color(0.96, 0.96, 0.96); node_colors["flow_control"] = Color(0.96, 0.96, 0.96);

View File

@ -46,7 +46,7 @@
void VisualScriptPropertySelector::_update_icons() { void VisualScriptPropertySelector::_update_icons() {
search_box->set_right_icon(results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); search_box->set_right_icon(results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
search_box->set_clear_button_enabled(true); search_box->set_clear_button_enabled(true);
search_box->add_theme_icon_override(SNAME("right_icon"), results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); search_box->add_theme_icon_override("right_icon", results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
search_visual_script_nodes->set_icon(results_tree->get_theme_icon(SNAME("VisualScript"), SNAME("EditorIcons"))); search_visual_script_nodes->set_icon(results_tree->get_theme_icon(SNAME("VisualScript"), SNAME("EditorIcons")));
search_classes->set_icon(results_tree->get_theme_icon(SNAME("Object"), SNAME("EditorIcons"))); search_classes->set_icon(results_tree->get_theme_icon(SNAME("Object"), SNAME("EditorIcons")));
@ -1142,11 +1142,11 @@ TreeItem *VisualScriptPropertySelector::SearchRunner::_create_class_item(TreeIte
} else { } else {
if (p_doc->name.is_quoted()) { if (p_doc->name.is_quoted()) {
text_0 = p_doc->name.unquote().get_file(); text_0 = p_doc->name.unquote().get_file();
if (ui_service->has_theme_icon(p_doc->inherits, SNAME("EditorIcons"))) { if (ui_service->has_theme_icon(p_doc->inherits, "EditorIcons")) {
icon = ui_service->get_theme_icon(p_doc->inherits, SNAME("EditorIcons")); icon = ui_service->get_theme_icon(p_doc->inherits, "EditorIcons");
} }
} else if (ui_service->has_theme_icon(p_doc->name, SNAME("EditorIcons"))) { } else if (ui_service->has_theme_icon(p_doc->name, "EditorIcons")) {
icon = ui_service->get_theme_icon(p_doc->name, SNAME("EditorIcons")); icon = ui_service->get_theme_icon(p_doc->name, "EditorIcons");
} else if (ClassDB::class_exists(p_doc->name) && ClassDB::is_parent_class(p_doc->name, "Object")) { } else if (ClassDB::class_exists(p_doc->name) && ClassDB::is_parent_class(p_doc->name, "Object")) {
icon = ui_service->get_theme_icon(SNAME("Object"), SNAME("EditorIcons")); icon = ui_service->get_theme_icon(SNAME("Object"), SNAME("EditorIcons"));
} }

View File

@ -353,7 +353,7 @@ MarginContainer *VBoxContainer::add_margin_child(const String &p_label, Control
l->set_text(p_label); l->set_text(p_label);
add_child(l); add_child(l);
MarginContainer *mc = memnew(MarginContainer); MarginContainer *mc = memnew(MarginContainer);
mc->add_theme_constant_override(SNAME("margin_left"), 0); mc->add_theme_constant_override("margin_left", 0);
mc->add_child(p_control, true); mc->add_child(p_control, true);
add_child(mc); add_child(mc);
if (p_expand) { if (p_expand) {

View File

@ -127,7 +127,7 @@ void Button::_notification(int p_what) {
} break; } break;
case DRAW_HOVER_PRESSED: { case DRAW_HOVER_PRESSED: {
// Edge case for CheckButton and CheckBox. // Edge case for CheckButton and CheckBox.
if (has_theme_stylebox(SNAME("hover_pressed"))) { if (has_theme_stylebox("hover_pressed")) {
if (rtl && has_theme_stylebox(SNAME("hover_pressed_mirrored"))) { if (rtl && has_theme_stylebox(SNAME("hover_pressed_mirrored"))) {
style = get_theme_stylebox(SNAME("hover_pressed_mirrored")); style = get_theme_stylebox(SNAME("hover_pressed_mirrored"));
} else { } else {

View File

@ -70,7 +70,7 @@ void ColorPicker::_notification(int p_what) {
w_edit->set_custom_minimum_size(Size2(get_theme_constant(SNAME("h_width")), 0)); w_edit->set_custom_minimum_size(Size2(get_theme_constant(SNAME("h_width")), 0));
wheel_edit->set_custom_minimum_size(Size2(get_theme_constant(SNAME("sv_width")), get_theme_constant(SNAME("sv_height")))); wheel_edit->set_custom_minimum_size(Size2(get_theme_constant(SNAME("sv_width")), get_theme_constant(SNAME("sv_height"))));
wheel_margin->add_theme_constant_override(SNAME("margin_bottom"), 8 * get_theme_default_base_scale()); wheel_margin->add_theme_constant_override("margin_bottom", 8 * get_theme_default_base_scale());
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
labels[i]->set_custom_minimum_size(Size2(get_theme_constant(SNAME("label_width")), 0)); labels[i]->set_custom_minimum_size(Size2(get_theme_constant(SNAME("label_width")), 0));
@ -191,22 +191,22 @@ void ColorPicker::_update_controls() {
if (raw_mode_enabled) { if (raw_mode_enabled) {
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
scroll[i]->remove_theme_icon_override(SNAME("grabber")); scroll[i]->remove_theme_icon_override("grabber");
scroll[i]->remove_theme_icon_override(SNAME("grabber_highlight")); scroll[i]->remove_theme_icon_override("grabber_highlight");
scroll[i]->remove_theme_style_override(SNAME("slider")); scroll[i]->remove_theme_style_override("slider");
scroll[i]->remove_theme_style_override(SNAME("grabber_area")); scroll[i]->remove_theme_style_override("grabber_area");
scroll[i]->remove_theme_style_override(SNAME("grabber_area_highlight")); scroll[i]->remove_theme_style_override("grabber_area_highlight");
} }
} else { } else {
Ref<StyleBoxEmpty> style_box_empty(memnew(StyleBoxEmpty)); Ref<StyleBoxEmpty> style_box_empty(memnew(StyleBoxEmpty));
Ref<Texture2D> bar_arrow = get_theme_icon(SNAME("bar_arrow")); Ref<Texture2D> bar_arrow = get_theme_icon(SNAME("bar_arrow"));
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
scroll[i]->add_theme_icon_override(SNAME("grabber"), bar_arrow); scroll[i]->add_theme_icon_override("grabber", bar_arrow);
scroll[i]->add_theme_icon_override(SNAME("grabber_highlight"), bar_arrow); scroll[i]->add_theme_icon_override("grabber_highlight", bar_arrow);
scroll[i]->add_theme_style_override(SNAME("slider"), style_box_empty); scroll[i]->add_theme_style_override("slider", style_box_empty);
scroll[i]->add_theme_style_override(SNAME("grabber_area"), style_box_empty); scroll[i]->add_theme_style_override("grabber_area", style_box_empty);
scroll[i]->add_theme_style_override(SNAME("grabber_area_highlight"), style_box_empty); scroll[i]->add_theme_style_override("grabber_area_highlight", style_box_empty);
} }
} }
@ -1245,7 +1245,7 @@ ColorPicker::ColorPicker() :
circle_mat.instantiate(); circle_mat.instantiate();
circle_mat->set_shader(circle_shader); circle_mat->set_shader(circle_shader);
wheel_margin->add_theme_constant_override(SNAME("margin_bottom"), 8); wheel_margin->add_theme_constant_override("margin_bottom", 8);
wheel_edit->add_child(wheel_margin); wheel_edit->add_child(wheel_margin);
wheel_margin->add_child(wheel); wheel_margin->add_child(wheel);

View File

@ -73,7 +73,7 @@ void AcceptDialog::_notification(int p_what) {
} }
} break; } break;
case NOTIFICATION_THEME_CHANGED: { case NOTIFICATION_THEME_CHANGED: {
bg->add_theme_style_override(SNAME("panel"), bg->get_theme_stylebox(SNAME("panel"), SNAME("AcceptDialog"))); bg->add_theme_style_override("panel", bg->get_theme_stylebox(SNAME("panel"), SNAME("AcceptDialog")));
} break; } break;
case NOTIFICATION_EXIT_TREE: { case NOTIFICATION_EXIT_TREE: {
if (parent_visible) { if (parent_visible) {

View File

@ -65,30 +65,30 @@ void FileDialog::_theme_changed() {
Color font_focus_color = vbox->get_theme_color(SNAME("font_focus_color"), SNAME("Button")); Color font_focus_color = vbox->get_theme_color(SNAME("font_focus_color"), SNAME("Button"));
Color font_pressed_color = vbox->get_theme_color(SNAME("font_pressed_color"), SNAME("Button")); Color font_pressed_color = vbox->get_theme_color(SNAME("font_pressed_color"), SNAME("Button"));
dir_up->add_theme_color_override(SNAME("icon_normal_color"), font_color); dir_up->add_theme_color_override("icon_normal_color", font_color);
dir_up->add_theme_color_override(SNAME("icon_hover_color"), font_hover_color); dir_up->add_theme_color_override("icon_hover_color", font_hover_color);
dir_up->add_theme_color_override(SNAME("icon_focus_color"), font_focus_color); dir_up->add_theme_color_override("icon_focus_color", font_focus_color);
dir_up->add_theme_color_override(SNAME("icon_pressed_color"), font_pressed_color); dir_up->add_theme_color_override("icon_pressed_color", font_pressed_color);
dir_prev->add_theme_color_override(SNAME("icon_color_normal"), font_color); dir_prev->add_theme_color_override("icon_color_normal", font_color);
dir_prev->add_theme_color_override(SNAME("icon_color_hover"), font_hover_color); dir_prev->add_theme_color_override("icon_color_hover", font_hover_color);
dir_prev->add_theme_color_override(SNAME("icon_focus_color"), font_focus_color); dir_prev->add_theme_color_override("icon_focus_color", font_focus_color);
dir_prev->add_theme_color_override(SNAME("icon_color_pressed"), font_pressed_color); dir_prev->add_theme_color_override("icon_color_pressed", font_pressed_color);
dir_next->add_theme_color_override(SNAME("icon_color_normal"), font_color); dir_next->add_theme_color_override("icon_color_normal", font_color);
dir_next->add_theme_color_override(SNAME("icon_color_hover"), font_hover_color); dir_next->add_theme_color_override("icon_color_hover", font_hover_color);
dir_next->add_theme_color_override(SNAME("icon_focus_color"), font_focus_color); dir_next->add_theme_color_override("icon_focus_color", font_focus_color);
dir_next->add_theme_color_override(SNAME("icon_color_pressed"), font_pressed_color); dir_next->add_theme_color_override("icon_color_pressed", font_pressed_color);
refresh->add_theme_color_override(SNAME("icon_normal_color"), font_color); refresh->add_theme_color_override("icon_normal_color", font_color);
refresh->add_theme_color_override(SNAME("icon_hover_color"), font_hover_color); refresh->add_theme_color_override("icon_hover_color", font_hover_color);
refresh->add_theme_color_override(SNAME("icon_focus_color"), font_focus_color); refresh->add_theme_color_override("icon_focus_color", font_focus_color);
refresh->add_theme_color_override(SNAME("icon_pressed_color"), font_pressed_color); refresh->add_theme_color_override("icon_pressed_color", font_pressed_color);
show_hidden->add_theme_color_override(SNAME("icon_normal_color"), font_color); show_hidden->add_theme_color_override("icon_normal_color", font_color);
show_hidden->add_theme_color_override(SNAME("icon_hover_color"), font_hover_color); show_hidden->add_theme_color_override("icon_hover_color", font_hover_color);
show_hidden->add_theme_color_override(SNAME("icon_focus_color"), font_focus_color); show_hidden->add_theme_color_override("icon_focus_color", font_focus_color);
show_hidden->add_theme_color_override(SNAME("icon_pressed_color"), font_pressed_color); show_hidden->add_theme_color_override("icon_pressed_color", font_pressed_color);
} }
void FileDialog::_notification(int p_what) { void FileDialog::_notification(int p_what) {

View File

@ -242,9 +242,9 @@ void PopupPanel::_update_child_rects() {
void PopupPanel::_notification(int p_what) { void PopupPanel::_notification(int p_what) {
if (p_what == NOTIFICATION_THEME_CHANGED) { if (p_what == NOTIFICATION_THEME_CHANGED) {
panel->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("panel"), get_class_name())); panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), get_class_name()));
} else if (p_what == NOTIFICATION_READY || p_what == NOTIFICATION_ENTER_TREE) { } else if (p_what == NOTIFICATION_READY || p_what == NOTIFICATION_ENTER_TREE) {
panel->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("panel"), get_class_name())); panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), get_class_name()));
_update_child_rects(); _update_child_rects();
} else if (p_what == NOTIFICATION_WM_SIZE_CHANGED) { } else if (p_what == NOTIFICATION_WM_SIZE_CHANGED) {
_update_child_rects(); _update_child_rects();

View File

@ -846,10 +846,10 @@ void PopupMenu::_notification(int p_what) {
// Set margin on the margin container // Set margin on the margin container
Ref<StyleBox> panel_style = get_theme_stylebox(SNAME("panel")); Ref<StyleBox> panel_style = get_theme_stylebox(SNAME("panel"));
margin_container->add_theme_constant_override(SNAME("margin_top"), panel_style->get_margin(Side::SIDE_TOP)); margin_container->add_theme_constant_override("margin_top", panel_style->get_margin(Side::SIDE_TOP));
margin_container->add_theme_constant_override(SNAME("margin_bottom"), panel_style->get_margin(Side::SIDE_BOTTOM)); margin_container->add_theme_constant_override("margin_bottom", panel_style->get_margin(Side::SIDE_BOTTOM));
margin_container->add_theme_constant_override(SNAME("margin_left"), panel_style->get_margin(Side::SIDE_LEFT)); margin_container->add_theme_constant_override("margin_left", panel_style->get_margin(Side::SIDE_LEFT));
margin_container->add_theme_constant_override(SNAME("margin_right"), panel_style->get_margin(Side::SIDE_RIGHT)); margin_container->add_theme_constant_override("margin_right", panel_style->get_margin(Side::SIDE_RIGHT));
} }
} break; } break;
} }

View File

@ -4941,7 +4941,7 @@ Tree::Tree() {
add_child(popup_editor, false, INTERNAL_MODE_FRONT); add_child(popup_editor, false, INTERNAL_MODE_FRONT);
popup_editor_vb = memnew(VBoxContainer); popup_editor_vb = memnew(VBoxContainer);
popup_editor->add_child(popup_editor_vb); popup_editor->add_child(popup_editor_vb);
popup_editor_vb->add_theme_constant_override(SNAME("separation"), 0); popup_editor_vb->add_theme_constant_override("separation", 0);
popup_editor_vb->set_anchors_and_offsets_preset(PRESET_WIDE); popup_editor_vb->set_anchors_and_offsets_preset(PRESET_WIDE);
text_editor = memnew(LineEdit); text_editor = memnew(LineEdit);
popup_editor_vb->add_child(text_editor); popup_editor_vb->add_child(text_editor);

File diff suppressed because it is too large Load Diff

View File

@ -103,7 +103,7 @@ public:
item->set_editable(0, true); item->set_editable(0, true);
item->set_range_config(0, 0, 20, 0.1); item->set_range_config(0, 0, 20, 0.1);
item->set_range(0, 2); item->set_range(0, 2);
item->add_button(0, Theme::get_default()->get_icon(SNAME("folder"), SNAME("FileDialog"))); item->add_button(0, Theme::get_default()->get_icon("folder", "FileDialog"));
item->set_cell_mode(1, TreeItem::CELL_MODE_RANGE); item->set_cell_mode(1, TreeItem::CELL_MODE_RANGE);
item->set_editable(1, true); item->set_editable(1, true);
item->set_range_config(1, 0, 20, 0.1); item->set_range_config(1, 0, 20, 0.1);