Merge pull request #62846 from AaronRecord/remove_redundant_theme_updates_in_enter_tree
Remove `NOTIFICATION_ENTER_TREE` when paired with `NOTIFICATION_THEME_CHANGED`
This commit is contained in:
commit
d3db8bbebd
|
@ -577,7 +577,6 @@ String InputEventConfigurationDialog::_get_device_string(int p_device) const {
|
|||
|
||||
void InputEventConfigurationDialog::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
input_list_search->set_right_icon(input_list_search->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
|
||||
|
@ -1058,7 +1057,6 @@ void ActionMapEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data,
|
|||
|
||||
void ActionMapEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
action_list_search->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
if (!actions_cache.is_empty()) {
|
||||
|
|
|
@ -216,8 +216,8 @@ void AnimationBezierTrackEdit::_notification(int p_what) {
|
|||
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning")));
|
||||
[[fallthrough]];
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
bezier_icon = get_theme_icon(SNAME("KeyBezierPoint"), SNAME("EditorIcons"));
|
||||
bezier_handle_icon = get_theme_icon(SNAME("KeyBezierHandle"), SNAME("EditorIcons"));
|
||||
|
|
|
@ -1489,7 +1489,6 @@ int AnimationTimelineEdit::get_name_limit() const {
|
|||
|
||||
void AnimationTimelineEdit::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning")));
|
||||
add_track->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
|
@ -4759,8 +4758,8 @@ void AnimationTrackEditor::_notification(int p_what) {
|
|||
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning")));
|
||||
[[fallthrough]];
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
zoom_icon->set_texture(get_theme_icon(SNAME("Zoom"), SNAME("EditorIcons")));
|
||||
bezier_edit_icon->set_icon(get_theme_icon(SNAME("EditBezier"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -1740,10 +1740,6 @@ void CodeTextEditor::_update_status_bar_theme() {
|
|||
|
||||
void CodeTextEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
_update_status_bar_theme();
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_update_status_bar_theme();
|
||||
if (toggle_scripts_button->is_visible()) {
|
||||
|
|
|
@ -230,9 +230,8 @@ void ConnectDialog::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
bind_editor->edit(cdbinds);
|
||||
} break;
|
||||
|
||||
[[fallthrough]];
|
||||
}
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
for (int i = 0; i < type_list->get_item_count(); i++) {
|
||||
String type_name = Variant::get_type_name((Variant::Type)type_list->get_item_id(i));
|
||||
|
@ -913,7 +912,6 @@ void ConnectionsDock::_connect_pressed() {
|
|||
|
||||
void ConnectionsDock::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
search_box->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
|
|
|
@ -423,16 +423,10 @@ void CreateDialog::_sbox_input(const Ref<InputEvent> &p_ie) {
|
|||
}
|
||||
}
|
||||
|
||||
void CreateDialog::_update_theme() {
|
||||
search_box->set_right_icon(search_options->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
favorite->set_icon(search_options->get_theme_icon(SNAME("Favorites"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
void CreateDialog::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
connect("confirmed", callable_mp(this, &CreateDialog::_confirmed));
|
||||
_update_theme();
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_EXIT_TREE: {
|
||||
|
@ -449,7 +443,8 @@ void CreateDialog::_notification(int p_what) {
|
|||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_update_theme();
|
||||
search_box->set_right_icon(search_options->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
favorite->set_icon(search_options->get_theme_icon(SNAME("Favorites"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,8 +101,6 @@ class CreateDialog : public ConfirmationDialog {
|
|||
bool _is_class_disabled_by_feature_profile(const StringName &p_class) const;
|
||||
void _load_favorites_and_history();
|
||||
|
||||
void _update_theme();
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
static void _bind_methods();
|
||||
|
|
|
@ -40,7 +40,6 @@ void EditorNetworkProfiler::_bind_methods() {
|
|||
|
||||
void EditorNetworkProfiler::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
activate->set_icon(get_theme_icon(SNAME("Play"), SNAME("EditorIcons")));
|
||||
clear_button->set_icon(get_theme_icon(SNAME("Clear"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -394,10 +394,9 @@ void EditorProfiler::_clear_pressed() {
|
|||
|
||||
void EditorProfiler::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
|
||||
case NOTIFICATION_THEME_CHANGED:
|
||||
case NOTIFICATION_TRANSLATION_CHANGED: {
|
||||
case NOTIFICATION_TRANSLATION_CHANGED:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
activate->set_icon(get_theme_icon(SNAME("Play"), SNAME("EditorIcons")));
|
||||
clear_button->set_icon(get_theme_icon(SNAME("Clear"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
|
|
|
@ -424,10 +424,9 @@ void EditorVisualProfiler::_clear_pressed() {
|
|||
|
||||
void EditorVisualProfiler::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
|
||||
case NOTIFICATION_THEME_CHANGED:
|
||||
case NOTIFICATION_TRANSLATION_CHANGED: {
|
||||
case NOTIFICATION_TRANSLATION_CHANGED:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
if (is_layout_rtl()) {
|
||||
activate->set_icon(get_theme_icon(SNAME("PlayBackwards"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
|
|
|
@ -787,8 +787,8 @@ void ScriptEditorDebugger::_notification(int p_what) {
|
|||
error_tree->connect("item_selected", callable_mp(this, &ScriptEditorDebugger::_error_selected));
|
||||
error_tree->connect("item_activated", callable_mp(this, &ScriptEditorDebugger::_error_activated));
|
||||
breakpoints_tree->connect("item_activated", callable_mp(this, &ScriptEditorDebugger::_breakpoint_tree_clicked));
|
||||
[[fallthrough]];
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
skip_breakpoints->set_icon(get_theme_icon(skip_breakpoints_value ? SNAME("DebugSkipBreakpointsOn") : SNAME("DebugSkipBreakpointsOff"), SNAME("EditorIcons")));
|
||||
copy->set_icon(get_theme_icon(SNAME("ActionCopy"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -38,22 +38,18 @@
|
|||
// The metadata key used to store and retrieve the version text to copy to the clipboard.
|
||||
static const String META_TEXT_TO_COPY = "text_to_copy";
|
||||
|
||||
void EditorAbout::_theme_changed() {
|
||||
const Ref<Font> font = get_theme_font(SNAME("source"), SNAME("EditorFonts"));
|
||||
const int font_size = get_theme_font_size(SNAME("source_size"), SNAME("EditorFonts"));
|
||||
_tpl_text->add_theme_font_override("normal_font", font);
|
||||
_tpl_text->add_theme_font_size_override("normal_font_size", font_size);
|
||||
_tpl_text->add_theme_constant_override("line_separation", 4 * EDSCALE);
|
||||
_license_text->add_theme_font_override("normal_font", font);
|
||||
_license_text->add_theme_font_size_override("normal_font_size", font_size);
|
||||
_license_text->add_theme_constant_override("line_separation", 4 * EDSCALE);
|
||||
_logo->set_texture(get_theme_icon(SNAME("Logo"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
void EditorAbout::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
_theme_changed();
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
const Ref<Font> font = get_theme_font(SNAME("source"), SNAME("EditorFonts"));
|
||||
const int font_size = get_theme_font_size(SNAME("source_size"), SNAME("EditorFonts"));
|
||||
_tpl_text->add_theme_font_override("normal_font", font);
|
||||
_tpl_text->add_theme_font_size_override("normal_font_size", font_size);
|
||||
_tpl_text->add_theme_constant_override("line_separation", 4 * EDSCALE);
|
||||
_license_text->add_theme_font_override("normal_font", font);
|
||||
_license_text->add_theme_font_size_override("normal_font_size", font_size);
|
||||
_license_text->add_theme_constant_override("line_separation", 4 * EDSCALE);
|
||||
_logo->set_texture(get_theme_icon(SNAME("Logo"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
@ -120,7 +116,6 @@ EditorAbout::EditorAbout() {
|
|||
set_hide_on_ok(true);
|
||||
|
||||
VBoxContainer *vbc = memnew(VBoxContainer);
|
||||
vbc->connect("theme_changed", callable_mp(this, &EditorAbout::_theme_changed));
|
||||
HBoxContainer *hbc = memnew(HBoxContainer);
|
||||
hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
hbc->set_alignment(BoxContainer::ALIGNMENT_CENTER);
|
||||
|
|
|
@ -62,8 +62,6 @@ private:
|
|||
RichTextLabel *_tpl_text = nullptr;
|
||||
TextureRect *_logo = nullptr;
|
||||
|
||||
void _theme_changed();
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
static void _bind_methods();
|
||||
|
|
|
@ -66,7 +66,6 @@ void EditorAudioBus::_update_visible_channels() {
|
|||
|
||||
void EditorAudioBus::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
for (int i = 0; i < CHANNELS_MAX; i++) {
|
||||
channel[i].vu_l->set_under_texture(get_theme_icon(SNAME("BusVuEmpty"), SNAME("EditorIcons")));
|
||||
|
@ -1025,7 +1024,6 @@ EditorAudioBuses *EditorAudioBuses::register_editor() {
|
|||
|
||||
void EditorAudioBuses::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
bus_scroll->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
} break;
|
||||
|
|
|
@ -59,7 +59,6 @@ void EditorAutoloadSettings::_notification(int p_what) {
|
|||
get_tree()->get_root()->call_deferred(SNAME("add_child"), info.node);
|
||||
}
|
||||
}
|
||||
browse_button->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
|
|
|
@ -70,7 +70,6 @@ VBoxContainer *EditorFileDialog::get_vbox() {
|
|||
|
||||
void EditorFileDialog::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_READY:
|
||||
case NOTIFICATION_THEME_CHANGED:
|
||||
case Control::NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
|
||||
case NOTIFICATION_TRANSLATION_CHANGED: {
|
||||
|
|
|
@ -44,29 +44,6 @@
|
|||
|
||||
DocTools *EditorHelp::doc = nullptr;
|
||||
|
||||
void EditorHelp::_update_theme() {
|
||||
text_color = get_theme_color(SNAME("text_color"), SNAME("EditorHelp"));
|
||||
title_color = get_theme_color(SNAME("title_color"), SNAME("EditorHelp"));
|
||||
headline_color = get_theme_color(SNAME("headline_color"), SNAME("EditorHelp"));
|
||||
comment_color = get_theme_color(SNAME("comment_color"), SNAME("EditorHelp"));
|
||||
symbol_color = get_theme_color(SNAME("symbol_color"), SNAME("EditorHelp"));
|
||||
value_color = get_theme_color(SNAME("value_color"), SNAME("EditorHelp"));
|
||||
qualifier_color = get_theme_color(SNAME("qualifier_color"), SNAME("EditorHelp"));
|
||||
type_color = get_theme_color(SNAME("type_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("line_separation", get_theme_constant(SNAME("line_separation"), SNAME("EditorHelp")));
|
||||
class_desc->add_theme_constant_override("table_h_separation", get_theme_constant(SNAME("table_h_separation"), SNAME("EditorHelp")));
|
||||
class_desc->add_theme_constant_override("table_v_separation", get_theme_constant(SNAME("table_v_separation"), SNAME("EditorHelp")));
|
||||
|
||||
doc_font = get_theme_font(SNAME("doc"), SNAME("EditorFonts"));
|
||||
doc_bold_font = get_theme_font(SNAME("doc_bold"), SNAME("EditorFonts"));
|
||||
doc_title_font = get_theme_font(SNAME("doc_title"), SNAME("EditorFonts"));
|
||||
doc_code_font = get_theme_font(SNAME("doc_source"), SNAME("EditorFonts"));
|
||||
|
||||
doc_title_font_size = get_theme_font_size(SNAME("doc_title_size"), SNAME("EditorFonts"));
|
||||
}
|
||||
|
||||
void EditorHelp::_search(bool p_search_previous) {
|
||||
if (p_search_previous) {
|
||||
find_bar->search_prev();
|
||||
|
@ -525,7 +502,6 @@ void EditorHelp::_update_doc() {
|
|||
method_line.clear();
|
||||
section_line.clear();
|
||||
|
||||
_update_theme();
|
||||
String link_color_text = title_color.to_html(false);
|
||||
|
||||
DocData::ClassDoc cd = doc->class_list[edited_class]; // Make a copy, so we can sort without worrying.
|
||||
|
@ -1994,10 +1970,29 @@ void EditorHelp::_notification(int p_what) {
|
|||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
if (is_inside_tree()) {
|
||||
_class_desc_resized(true);
|
||||
}
|
||||
_class_desc_resized(true);
|
||||
update_toggle_scripts_button();
|
||||
|
||||
text_color = get_theme_color(SNAME("text_color"), SNAME("EditorHelp"));
|
||||
title_color = get_theme_color(SNAME("title_color"), SNAME("EditorHelp"));
|
||||
headline_color = get_theme_color(SNAME("headline_color"), SNAME("EditorHelp"));
|
||||
comment_color = get_theme_color(SNAME("comment_color"), SNAME("EditorHelp"));
|
||||
symbol_color = get_theme_color(SNAME("symbol_color"), SNAME("EditorHelp"));
|
||||
value_color = get_theme_color(SNAME("value_color"), SNAME("EditorHelp"));
|
||||
qualifier_color = get_theme_color(SNAME("qualifier_color"), SNAME("EditorHelp"));
|
||||
type_color = get_theme_color(SNAME("type_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("line_separation", get_theme_constant(SNAME("line_separation"), SNAME("EditorHelp")));
|
||||
class_desc->add_theme_constant_override("table_h_separation", get_theme_constant(SNAME("table_h_separation"), SNAME("EditorHelp")));
|
||||
class_desc->add_theme_constant_override("table_v_separation", get_theme_constant(SNAME("table_v_separation"), SNAME("EditorHelp")));
|
||||
|
||||
doc_font = get_theme_font(SNAME("doc"), SNAME("EditorFonts"));
|
||||
doc_bold_font = get_theme_font(SNAME("doc_bold"), SNAME("EditorFonts"));
|
||||
doc_title_font = get_theme_font(SNAME("doc_title"), SNAME("EditorFonts"));
|
||||
doc_code_font = get_theme_font(SNAME("doc_source"), SNAME("EditorFonts"));
|
||||
|
||||
doc_title_font_size = get_theme_font_size(SNAME("doc_title_size"), SNAME("EditorFonts"));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_VISIBILITY_CHANGED: {
|
||||
|
@ -2175,7 +2170,6 @@ void EditorHelpBit::_bind_methods() {
|
|||
|
||||
void EditorHelpBit::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
rich_text->add_theme_color_override("selection_color", get_theme_color(SNAME("selection_color"), SNAME("EditorHelp")));
|
||||
rich_text->clear();
|
||||
|
@ -2257,7 +2251,6 @@ void FindBar::popup_search() {
|
|||
|
||||
void FindBar::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
find_prev->set_icon(get_theme_icon(SNAME("MoveUp"), SNAME("EditorIcons")));
|
||||
find_next->set_icon(get_theme_icon(SNAME("MoveDown"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -145,7 +145,6 @@ class EditorHelp : public VBoxContainer {
|
|||
|
||||
int scroll_to = -1;
|
||||
|
||||
void _update_theme();
|
||||
void _help_callback(const String &p_topic);
|
||||
|
||||
void _add_text(const String &p_bbcode);
|
||||
|
|
|
@ -2175,7 +2175,6 @@ bool EditorInspectorArray::can_drop_data_fw(const Point2 &p_point, const Variant
|
|||
|
||||
void EditorInspectorArray::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
Color color = get_theme_color(SNAME("dark_color_1"), SNAME("Editor"));
|
||||
odd_style->set_bg_color(color.darkened(-0.08));
|
||||
|
@ -2369,7 +2368,6 @@ void EditorPaginator::update(int p_page, int p_max_page) {
|
|||
|
||||
void EditorPaginator::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
first_page_button->set_icon(get_theme_icon(SNAME("PageFirst"), SNAME("EditorIcons")));
|
||||
prev_page_button->set_icon(get_theme_icon(SNAME("PagePrevious"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -64,52 +64,48 @@ void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_f
|
|||
}
|
||||
}
|
||||
|
||||
void EditorLog::_update_theme() {
|
||||
Ref<Font> normal_font = get_theme_font(SNAME("output_source"), SNAME("EditorFonts"));
|
||||
if (normal_font.is_valid()) {
|
||||
log->add_theme_font_override("normal_font", normal_font);
|
||||
}
|
||||
|
||||
log->add_theme_font_size_override("normal_font_size", get_theme_font_size(SNAME("output_source_size"), SNAME("EditorFonts")));
|
||||
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"));
|
||||
if (bold_font.is_valid()) {
|
||||
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_ERROR]->toggle_button->set_icon(get_theme_icon(SNAME("StatusError"), SNAME("EditorIcons")));
|
||||
type_filter_map[MSG_TYPE_WARNING]->toggle_button->set_icon(get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons")));
|
||||
type_filter_map[MSG_TYPE_EDITOR]->toggle_button->set_icon(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")));
|
||||
|
||||
type_filter_map[MSG_TYPE_STD]->toggle_button->set_theme_type_variation("EditorLogFilterButton");
|
||||
type_filter_map[MSG_TYPE_ERROR]->toggle_button->set_theme_type_variation("EditorLogFilterButton");
|
||||
type_filter_map[MSG_TYPE_WARNING]->toggle_button->set_theme_type_variation("EditorLogFilterButton");
|
||||
type_filter_map[MSG_TYPE_EDITOR]->toggle_button->set_theme_type_variation("EditorLogFilterButton");
|
||||
|
||||
clear_button->set_icon(get_theme_icon(SNAME("Clear"), SNAME("EditorIcons")));
|
||||
copy_button->set_icon(get_theme_icon(SNAME("ActionCopy"), SNAME("EditorIcons")));
|
||||
collapse_button->set_icon(get_theme_icon(SNAME("CombineLines"), SNAME("EditorIcons")));
|
||||
show_search_button->set_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
search_box->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
|
||||
theme_cache.error_color = get_theme_color(SNAME("error_color"), SNAME("Editor"));
|
||||
theme_cache.error_icon = get_theme_icon(SNAME("Error"), SNAME("EditorIcons"));
|
||||
theme_cache.warning_color = get_theme_color(SNAME("warning_color"), SNAME("Editor"));
|
||||
theme_cache.warning_icon = get_theme_icon(SNAME("Warning"), SNAME("EditorIcons"));
|
||||
theme_cache.message_color = get_theme_color(SNAME("font_color"), SNAME("Editor")) * Color(1, 1, 1, 0.6);
|
||||
}
|
||||
|
||||
void EditorLog::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
_update_theme();
|
||||
_load_state();
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_update_theme();
|
||||
Ref<Font> normal_font = get_theme_font(SNAME("output_source"), SNAME("EditorFonts"));
|
||||
if (normal_font.is_valid()) {
|
||||
log->add_theme_font_override("normal_font", normal_font);
|
||||
}
|
||||
|
||||
log->add_theme_font_size_override("normal_font_size", get_theme_font_size(SNAME("output_source_size"), SNAME("EditorFonts")));
|
||||
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"));
|
||||
if (bold_font.is_valid()) {
|
||||
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_ERROR]->toggle_button->set_icon(get_theme_icon(SNAME("StatusError"), SNAME("EditorIcons")));
|
||||
type_filter_map[MSG_TYPE_WARNING]->toggle_button->set_icon(get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons")));
|
||||
type_filter_map[MSG_TYPE_EDITOR]->toggle_button->set_icon(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")));
|
||||
|
||||
type_filter_map[MSG_TYPE_STD]->toggle_button->set_theme_type_variation("EditorLogFilterButton");
|
||||
type_filter_map[MSG_TYPE_ERROR]->toggle_button->set_theme_type_variation("EditorLogFilterButton");
|
||||
type_filter_map[MSG_TYPE_WARNING]->toggle_button->set_theme_type_variation("EditorLogFilterButton");
|
||||
type_filter_map[MSG_TYPE_EDITOR]->toggle_button->set_theme_type_variation("EditorLogFilterButton");
|
||||
|
||||
clear_button->set_icon(get_theme_icon(SNAME("Clear"), SNAME("EditorIcons")));
|
||||
copy_button->set_icon(get_theme_icon(SNAME("ActionCopy"), SNAME("EditorIcons")));
|
||||
collapse_button->set_icon(get_theme_icon(SNAME("CombineLines"), SNAME("EditorIcons")));
|
||||
show_search_button->set_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
search_box->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
|
||||
theme_cache.error_color = get_theme_color(SNAME("error_color"), SNAME("Editor"));
|
||||
theme_cache.error_icon = get_theme_icon(SNAME("Error"), SNAME("EditorIcons"));
|
||||
theme_cache.warning_color = get_theme_color(SNAME("warning_color"), SNAME("Editor"));
|
||||
theme_cache.warning_icon = get_theme_icon(SNAME("Warning"), SNAME("EditorIcons"));
|
||||
theme_cache.message_color = get_theme_color(SNAME("font_color"), SNAME("Editor")) * Color(1, 1, 1, 0.6);
|
||||
|
||||
_rebuild_log();
|
||||
} break;
|
||||
}
|
||||
|
|
|
@ -175,8 +175,6 @@ private:
|
|||
void _save_state();
|
||||
void _load_state();
|
||||
|
||||
void _update_theme();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
void _notification(int p_what);
|
||||
|
|
|
@ -182,7 +182,6 @@ void EditorPath::_id_pressed(int p_idx) {
|
|||
|
||||
void EditorPath::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
update_path();
|
||||
|
||||
|
|
|
@ -167,8 +167,7 @@ void EditorPropertyMultilineText::update_property() {
|
|||
|
||||
void EditorPropertyMultilineText::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_THEME_CHANGED:
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
Ref<Texture2D> df = get_theme_icon(SNAME("DistractionFree"), SNAME("EditorIcons"));
|
||||
open_big_text->set_icon(df);
|
||||
|
||||
|
@ -322,7 +321,6 @@ void EditorPropertyTextEnum::_bind_methods() {
|
|||
|
||||
void EditorPropertyTextEnum::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
edit_button->set_icon(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")));
|
||||
accept_button->set_icon(get_theme_icon(SNAME("ImportCheck"), SNAME("EditorIcons")));
|
||||
|
@ -404,7 +402,6 @@ void EditorPropertyLocale::setup(const String &p_hint_text) {
|
|||
|
||||
void EditorPropertyLocale::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
locale_edit->set_icon(get_theme_icon(SNAME("Translation"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
|
@ -500,7 +497,6 @@ void EditorPropertyPath::set_save_mode() {
|
|||
|
||||
void EditorPropertyPath::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
path_edit->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
|
@ -1153,7 +1149,6 @@ void EditorPropertyLayersGrid::_bind_methods() {
|
|||
|
||||
void EditorPropertyLayers::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
button->set_normal_texture(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons")));
|
||||
button->set_pressed_texture(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons")));
|
||||
|
@ -1677,8 +1672,7 @@ void EditorPropertyEasing::setup(bool p_positive_only, bool p_flip) {
|
|||
|
||||
void EditorPropertyEasing::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_THEME_CHANGED:
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
preset->clear();
|
||||
preset->add_icon_item(get_theme_icon(SNAME("CurveLinear"), SNAME("EditorIcons")), "Linear", EASING_LINEAR);
|
||||
preset->add_icon_item(get_theme_icon(SNAME("CurveIn"), SNAME("EditorIcons")), "Ease In", EASING_IN);
|
||||
|
@ -1775,7 +1769,6 @@ void EditorPropertyVector2::_update_ratio() {
|
|||
|
||||
void EditorPropertyVector2::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
linked->set_normal_texture(get_theme_icon(SNAME("Unlinked"), SNAME("EditorIcons")));
|
||||
linked->set_pressed_texture(get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")));
|
||||
|
@ -1885,7 +1878,6 @@ void EditorPropertyRect2::update_property() {
|
|||
|
||||
void EditorPropertyRect2::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
const Color *colors = _get_property_colors();
|
||||
for (int i = 0; i < 4; i++) {
|
||||
|
@ -2053,7 +2045,6 @@ Vector3 EditorPropertyVector3::get_vector() {
|
|||
|
||||
void EditorPropertyVector3::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
linked->set_normal_texture(get_theme_icon(SNAME("Unlinked"), SNAME("EditorIcons")));
|
||||
linked->set_pressed_texture(get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")));
|
||||
|
@ -2188,7 +2179,6 @@ void EditorPropertyVector2i::_update_ratio() {
|
|||
|
||||
void EditorPropertyVector2i::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
linked->set_normal_texture(get_theme_icon(SNAME("Unlinked"), SNAME("EditorIcons")));
|
||||
linked->set_pressed_texture(get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")));
|
||||
|
@ -2298,7 +2288,6 @@ void EditorPropertyRect2i::update_property() {
|
|||
|
||||
void EditorPropertyRect2i::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
const Color *colors = _get_property_colors();
|
||||
for (int i = 0; i < 4; i++) {
|
||||
|
@ -2439,7 +2428,6 @@ void EditorPropertyVector3i::_update_ratio() {
|
|||
|
||||
void EditorPropertyVector3i::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
linked->set_normal_texture(get_theme_icon(SNAME("Unlinked"), SNAME("EditorIcons")));
|
||||
linked->set_pressed_texture(get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")));
|
||||
|
@ -2551,7 +2539,6 @@ void EditorPropertyPlane::update_property() {
|
|||
|
||||
void EditorPropertyPlane::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
const Color *colors = _get_property_colors();
|
||||
for (int i = 0; i < 4; i++) {
|
||||
|
@ -2705,7 +2692,6 @@ void EditorPropertyQuaternion::_warning_pressed() {
|
|||
|
||||
void EditorPropertyQuaternion::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
const Color *colors = _get_property_colors();
|
||||
for (int i = 0; i < 4; i++) {
|
||||
|
@ -2860,7 +2846,6 @@ void EditorPropertyVector4::update_property() {
|
|||
|
||||
void EditorPropertyVector4::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
const Color *colors = _get_property_colors();
|
||||
for (int i = 0; i < 4; i++) {
|
||||
|
@ -2952,7 +2937,6 @@ void EditorPropertyVector4i::update_property() {
|
|||
|
||||
void EditorPropertyVector4i::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
const Color *colors = _get_property_colors();
|
||||
for (int i = 0; i < 4; i++) {
|
||||
|
@ -3047,7 +3031,6 @@ void EditorPropertyAABB::update_property() {
|
|||
|
||||
void EditorPropertyAABB::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
const Color *colors = _get_property_colors();
|
||||
for (int i = 0; i < 6; i++) {
|
||||
|
@ -3130,7 +3113,6 @@ void EditorPropertyTransform2D::update_property() {
|
|||
|
||||
void EditorPropertyTransform2D::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
const Color *colors = _get_property_colors();
|
||||
for (int i = 0; i < 6; i++) {
|
||||
|
@ -3227,7 +3209,6 @@ void EditorPropertyBasis::update_property() {
|
|||
|
||||
void EditorPropertyBasis::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
const Color *colors = _get_property_colors();
|
||||
for (int i = 0; i < 9; i++) {
|
||||
|
@ -3325,7 +3306,6 @@ void EditorPropertyTransform3D::update_using_transform(Transform3D p_transform)
|
|||
|
||||
void EditorPropertyTransform3D::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
const Color *colors = _get_property_colors();
|
||||
for (int i = 0; i < 12; i++) {
|
||||
|
@ -3431,7 +3411,6 @@ void EditorPropertyProjection::update_using_transform(Projection p_transform) {
|
|||
|
||||
void EditorPropertyProjection::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
const Color *colors = _get_property_colors();
|
||||
for (int i = 0; i < 16; i++) {
|
||||
|
@ -3502,7 +3481,6 @@ void EditorPropertyColor::_picker_opening() {
|
|||
|
||||
void EditorPropertyColor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
picker->set_custom_minimum_size(Size2(0, get_theme_constant(SNAME("color_picker_button_height"), SNAME("Editor"))));
|
||||
} break;
|
||||
|
@ -3726,7 +3704,6 @@ void EditorPropertyNodePath::setup(const NodePath &p_base_hint, Vector<StringNam
|
|||
|
||||
void EditorPropertyNodePath::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
Ref<Texture2D> t = get_theme_icon(SNAME("Clear"), SNAME("EditorIcons"));
|
||||
clear->set_icon(t);
|
||||
|
@ -4138,7 +4115,6 @@ void EditorPropertyResource::set_use_sub_inspector(bool p_enable) {
|
|||
|
||||
void EditorPropertyResource::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
if (!updating_theme) {
|
||||
_update_property_bg();
|
||||
|
|
|
@ -485,8 +485,7 @@ void EditorPropertyArray::drop_data_fw(const Point2 &p_point, const Variant &p_d
|
|||
|
||||
void EditorPropertyArray::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_THEME_CHANGED:
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
change_type->clear();
|
||||
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
|
||||
if (i == Variant::CALLABLE || i == Variant::SIGNAL || i == Variant::RID) {
|
||||
|
@ -1166,8 +1165,7 @@ void EditorPropertyDictionary::_object_id_selected(const StringName &p_property,
|
|||
|
||||
void EditorPropertyDictionary::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_THEME_CHANGED:
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
change_type->clear();
|
||||
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
|
||||
if (i == Variant::CALLABLE || i == Variant::SIGNAL || i == Variant::RID) {
|
||||
|
@ -1405,8 +1403,7 @@ void EditorPropertyLocalizableString::_object_id_selected(const StringName &p_pr
|
|||
|
||||
void EditorPropertyLocalizableString::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_THEME_CHANGED:
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
if (Object::cast_to<Button>(button_add_item)) {
|
||||
button_add_item->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
|
|
@ -762,8 +762,8 @@ void EditorResourcePicker::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
_update_resource();
|
||||
[[fallthrough]];
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
edit_button->set_icon(get_theme_icon(SNAME("select_arrow"), SNAME("Tree")));
|
||||
} break;
|
||||
|
@ -1038,7 +1038,6 @@ EditorShaderPicker::EditorShaderPicker() {
|
|||
|
||||
void EditorAudioStreamPicker::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_READY:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_update_resource();
|
||||
} break;
|
||||
|
|
|
@ -431,7 +431,6 @@ void EditorSpinSlider::_draw_spin_slider() {
|
|||
|
||||
void EditorSpinSlider::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_update_value_input_stylebox();
|
||||
} break;
|
||||
|
|
|
@ -105,7 +105,6 @@ void EditorToaster::_notification(int p_what) {
|
|||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
if (vbox_container->is_visible()) {
|
||||
main_button->set_icon(get_theme_icon(SNAME("Notification"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -143,7 +143,6 @@ void EditorZoomWidget::set_zoom_by_increments(int p_increment_count, bool p_inte
|
|||
|
||||
void EditorZoomWidget::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
zoom_minus->set_icon(get_theme_icon(SNAME("ZoomLess"), SNAME("EditorIcons")));
|
||||
zoom_plus->set_icon(get_theme_icon(SNAME("ZoomMore"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -754,7 +754,6 @@ Error ExportTemplateManager::install_android_template_from_file(const String &p_
|
|||
|
||||
void ExportTemplateManager::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
current_value->add_theme_font_override("font", get_theme_font(SNAME("main"), SNAME("EditorFonts")));
|
||||
current_missing_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
|
|
|
@ -380,7 +380,6 @@ void GroupDialog::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_TRANSLATION_CHANGED:
|
||||
case Control::NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
if (is_layout_rtl()) {
|
||||
add_button->set_icon(groups->get_theme_icon(SNAME("Back"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -42,8 +42,7 @@ void AudioStreamImportSettings::_notification(int p_what) {
|
|||
connect("confirmed", callable_mp(this, &AudioStreamImportSettings::_reimport));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED:
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_play_button->set_icon(get_theme_icon(SNAME("MainPlay"), SNAME("EditorIcons")));
|
||||
_stop_button->set_icon(get_theme_icon(SNAME("Stop"), SNAME("EditorIcons")));
|
||||
_preview->set_color(get_theme_color(SNAME("dark_color_2"), SNAME("Editor")));
|
||||
|
|
|
@ -876,7 +876,6 @@ void DynamicFontImportSettings::_notification(int p_what) {
|
|||
connect("confirmed", callable_mp(this, &DynamicFontImportSettings::_re_import));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
add_var->set_icon(add_var->get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
|
|
|
@ -53,7 +53,6 @@ void NodeDock::_bind_methods() {
|
|||
|
||||
void NodeDock::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
connections_button->set_icon(get_theme_icon(SNAME("Signals"), SNAME("EditorIcons")));
|
||||
groups_button->set_icon(get_theme_icon(SNAME("Groups"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -151,7 +151,6 @@ void AbstractPolygon2DEditor::_menu_option(int p_option) {
|
|||
|
||||
void AbstractPolygon2DEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
button_create->set_icon(get_theme_icon(SNAME("CurveCreate"), SNAME("EditorIcons")));
|
||||
button_edit->set_icon(get_theme_icon(SNAME("CurveEdit"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -550,7 +550,6 @@ void AnimationNodeBlendSpace1DEditor::_open_editor() {
|
|||
|
||||
void AnimationNodeBlendSpace1DEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
|
|
|
@ -772,7 +772,6 @@ void AnimationNodeBlendSpace2DEditor::_edit_point_pos(double) {
|
|||
|
||||
void AnimationNodeBlendSpace2DEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
|
|
|
@ -799,16 +799,10 @@ void AnimationNodeBlendTreeEditor::_update_editor_settings() {
|
|||
graph->set_warped_panning(bool(EditorSettings::get_singleton()->get("editors/panning/warped_mouse_panning")));
|
||||
}
|
||||
|
||||
void AnimationNodeBlendTreeEditor::_update_theme() {
|
||||
error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
}
|
||||
|
||||
void AnimationNodeBlendTreeEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
_update_editor_settings();
|
||||
_update_theme();
|
||||
} break;
|
||||
|
||||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
||||
|
@ -816,7 +810,8 @@ void AnimationNodeBlendTreeEditor::_notification(int p_what) {
|
|||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_update_theme();
|
||||
error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
|
||||
if (is_visible_in_tree()) {
|
||||
_update_graph();
|
||||
|
|
|
@ -123,7 +123,6 @@ class AnimationNodeBlendTreeEditor : public AnimationTreeNodeEditorPlugin {
|
|||
void _removed_from_graph();
|
||||
|
||||
void _update_editor_settings();
|
||||
void _update_theme();
|
||||
|
||||
EditorFileDialog *open_file = nullptr;
|
||||
Ref<AnimationNode> file_loaded;
|
||||
|
|
|
@ -1544,10 +1544,9 @@ void AnimationNodeStateMachineEditor::_update_graph() {
|
|||
|
||||
void AnimationNodeStateMachineEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED:
|
||||
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
|
||||
case NOTIFICATION_TRANSLATION_CHANGED: {
|
||||
case NOTIFICATION_TRANSLATION_CHANGED:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor")));
|
||||
panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
|
|
|
@ -193,7 +193,6 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const
|
|||
|
||||
void EditorAssetLibraryItemDescription::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
previews_bg->add_theme_style_override("panel", previews->get_theme_stylebox(SNAME("normal"), SNAME("TextEdit")));
|
||||
} break;
|
||||
|
@ -401,7 +400,6 @@ void EditorAssetLibraryItemDownload::configure(const String &p_title, int p_asse
|
|||
|
||||
void EditorAssetLibraryItemDownload::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("AssetLib")));
|
||||
status->add_theme_color_override("font_color", get_theme_color(SNAME("status_color"), SNAME("AssetLib")));
|
||||
|
@ -580,7 +578,6 @@ void EditorAssetLibrary::_notification(int p_what) {
|
|||
error_label->raise();
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
error_tr->set_texture(get_theme_icon(SNAME("Error"), SNAME("EditorIcons")));
|
||||
filter->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -5856,26 +5856,21 @@ Node *CanvasItemEditorViewport::_make_texture_node_type(String texture_node_type
|
|||
return node;
|
||||
}
|
||||
|
||||
void CanvasItemEditorViewport::_update_theme() {
|
||||
List<BaseButton *> btn_list;
|
||||
button_group->get_buttons(&btn_list);
|
||||
|
||||
for (int i = 0; i < btn_list.size(); i++) {
|
||||
CheckBox *check = Object::cast_to<CheckBox>(btn_list[i]);
|
||||
check->set_icon(get_theme_icon(check->get_text(), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
label->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
}
|
||||
|
||||
void CanvasItemEditorViewport::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_update_theme();
|
||||
List<BaseButton *> btn_list;
|
||||
button_group->get_buttons(&btn_list);
|
||||
|
||||
for (int i = 0; i < btn_list.size(); i++) {
|
||||
CheckBox *check = Object::cast_to<CheckBox>(btn_list[i]);
|
||||
check->set_icon(get_theme_icon(check->get_text(), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
label->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
_update_theme();
|
||||
connect("mouse_exited", callable_mp(this, &CanvasItemEditorViewport::_on_mouse_exit));
|
||||
} break;
|
||||
|
||||
|
|
|
@ -616,7 +616,6 @@ class CanvasItemEditorViewport : public Control {
|
|||
bool _create_instance(Node *parent, String &path, const Point2 &p_point);
|
||||
void _perform_drop_data();
|
||||
void _show_resource_type_selector();
|
||||
void _update_theme();
|
||||
|
||||
static void _bind_methods();
|
||||
|
||||
|
|
|
@ -102,7 +102,6 @@ void ControlPositioningWarning::gui_input(const Ref<InputEvent> &p_event) {
|
|||
|
||||
void ControlPositioningWarning::_notification(int p_notification) {
|
||||
switch (p_notification) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED:
|
||||
_update_warning();
|
||||
_update_toggler();
|
||||
|
@ -492,7 +491,6 @@ void ControlEditorPopupButton::_popup_visibility_changed(bool p_visible) {
|
|||
|
||||
void ControlEditorPopupButton::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
arrow_icon = get_theme_icon("select_arrow", "Tree");
|
||||
} break;
|
||||
|
@ -558,7 +556,6 @@ void AnchorPresetPicker::_preset_button_pressed(const int p_preset) {
|
|||
|
||||
void AnchorPresetPicker::_notification(int p_notification) {
|
||||
switch (p_notification) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
preset_buttons[PRESET_TOP_LEFT]->set_icon(get_theme_icon(SNAME("ControlAlignTopLeft"), SNAME("EditorIcons")));
|
||||
preset_buttons[PRESET_CENTER_TOP]->set_icon(get_theme_icon(SNAME("ControlAlignCenterTop"), SNAME("EditorIcons")));
|
||||
|
@ -667,7 +664,6 @@ void SizeFlagPresetPicker::set_allowed_flags(Vector<SizeFlags> &p_flags) {
|
|||
|
||||
void SizeFlagPresetPicker::_notification(int p_notification) {
|
||||
switch (p_notification) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
if (vertical) {
|
||||
preset_buttons[SIZE_SHRINK_BEGIN]->set_icon(get_theme_icon(SNAME("ControlAlignCenterTop"), SNAME("EditorIcons")));
|
||||
|
@ -974,7 +970,6 @@ void ControlEditorToolbar::_selection_changed() {
|
|||
|
||||
void ControlEditorToolbar::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
anchors_button->set_icon(get_theme_icon(SNAME("ControlLayout"), SNAME("EditorIcons")));
|
||||
anchor_mode_button->set_icon(get_theme_icon(SNAME("Anchor"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -152,7 +152,6 @@ bool EditorPropertyFontOTObject::_property_get_revert(const StringName &p_name,
|
|||
|
||||
void EditorPropertyFontMetaOverride::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
if (Object::cast_to<Button>(button_add)) {
|
||||
button_add->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
|
@ -380,14 +379,6 @@ EditorPropertyFontMetaOverride::EditorPropertyFontMetaOverride(bool p_script) {
|
|||
/* EditorPropertyOTVariation */
|
||||
/*************************************************************************/
|
||||
|
||||
void EditorPropertyOTVariation::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
void EditorPropertyOTVariation::_property_changed(const String &p_property, Variant p_value, const String &p_name, bool p_changing) {
|
||||
if (p_property.begins_with("keys")) {
|
||||
Dictionary dict = object->get_dict();
|
||||
|
@ -547,7 +538,6 @@ EditorPropertyOTVariation::EditorPropertyOTVariation() {
|
|||
|
||||
void EditorPropertyOTFeatures::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
if (Object::cast_to<Button>(button_add)) {
|
||||
button_add->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -139,7 +139,6 @@ class EditorPropertyOTVariation : public EditorProperty {
|
|||
EditorPaginator *paginator = nullptr;
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
static void _bind_methods(){};
|
||||
|
||||
void _edit_pressed();
|
||||
|
|
|
@ -104,7 +104,6 @@ void GradientTexture2DEditorRect::set_snap_size(float p_snap_size) {
|
|||
|
||||
void GradientTexture2DEditorRect::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
checkerboard->set_texture(get_theme_icon(SNAME("GuiMiniCheckerboard"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
|
@ -214,7 +213,6 @@ void GradientTexture2DEditor::set_texture(Ref<GradientTexture2D> &p_texture) {
|
|||
|
||||
void GradientTexture2DEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
reverse_button->set_icon(get_theme_icon(SNAME("ReverseGradient"), SNAME("EditorIcons")));
|
||||
snap_button->set_icon(get_theme_icon(SNAME("SnapGrid"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -35,7 +35,6 @@ void InputEventConfigContainer::_bind_methods() {
|
|||
|
||||
void InputEventConfigContainer::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
open_config_button->set_icon(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
|
|
|
@ -7134,42 +7134,6 @@ void Node3DEditor::_add_environment_to_scene(bool p_already_added_sun) {
|
|||
undo_redo->commit_action();
|
||||
}
|
||||
|
||||
void Node3DEditor::_update_theme() {
|
||||
tool_button[TOOL_MODE_SELECT]->set_icon(get_theme_icon(SNAME("ToolSelect"), SNAME("EditorIcons")));
|
||||
tool_button[TOOL_MODE_MOVE]->set_icon(get_theme_icon(SNAME("ToolMove"), SNAME("EditorIcons")));
|
||||
tool_button[TOOL_MODE_ROTATE]->set_icon(get_theme_icon(SNAME("ToolRotate"), SNAME("EditorIcons")));
|
||||
tool_button[TOOL_MODE_SCALE]->set_icon(get_theme_icon(SNAME("ToolScale"), SNAME("EditorIcons")));
|
||||
tool_button[TOOL_MODE_LIST_SELECT]->set_icon(get_theme_icon(SNAME("ListSelect"), SNAME("EditorIcons")));
|
||||
tool_button[TOOL_LOCK_SELECTED]->set_icon(get_theme_icon(SNAME("Lock"), SNAME("EditorIcons")));
|
||||
tool_button[TOOL_UNLOCK_SELECTED]->set_icon(get_theme_icon(SNAME("Unlock"), SNAME("EditorIcons")));
|
||||
tool_button[TOOL_GROUP_SELECTED]->set_icon(get_theme_icon(SNAME("Group"), SNAME("EditorIcons")));
|
||||
tool_button[TOOL_UNGROUP_SELECTED]->set_icon(get_theme_icon(SNAME("Ungroup"), SNAME("EditorIcons")));
|
||||
|
||||
tool_option_button[TOOL_OPT_LOCAL_COORDS]->set_icon(get_theme_icon(SNAME("Object"), SNAME("EditorIcons")));
|
||||
tool_option_button[TOOL_OPT_USE_SNAP]->set_icon(get_theme_icon(SNAME("Snap"), SNAME("EditorIcons")));
|
||||
tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->set_icon(get_theme_icon(SNAME("Camera3D"), SNAME("EditorIcons")));
|
||||
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), get_theme_icon(SNAME("Panels1"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), get_theme_icon(SNAME("Panels2"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS_ALT), get_theme_icon(SNAME("Panels2Alt"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS), get_theme_icon(SNAME("Panels3"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS_ALT), get_theme_icon(SNAME("Panels3Alt"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_4_VIEWPORTS), get_theme_icon(SNAME("Panels4"), SNAME("EditorIcons")));
|
||||
|
||||
sun_button->set_icon(get_theme_icon(SNAME("DirectionalLight3D"), 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_title->add_theme_font_override("font", get_theme_font(SNAME("title_font"), SNAME("Window")));
|
||||
environ_title->add_theme_font_override("font", get_theme_font(SNAME("title_font"), SNAME("Window")));
|
||||
|
||||
sun_color->set_custom_minimum_size(Size2(0, get_theme_constant(SNAME("color_picker_button_height"), SNAME("Editor"))));
|
||||
environ_sky_color->set_custom_minimum_size(Size2(0, get_theme_constant(SNAME("color_picker_button_height"), SNAME("Editor"))));
|
||||
environ_ground_color->set_custom_minimum_size(Size2(0, get_theme_constant(SNAME("color_picker_button_height"), SNAME("Editor"))));
|
||||
|
||||
context_menu_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("ContextualToolbar"), SNAME("EditorStyles")));
|
||||
}
|
||||
|
||||
void Node3DEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_READY: {
|
||||
|
@ -7192,7 +7156,6 @@ void Node3DEditor::_notification(int p_what) {
|
|||
} break;
|
||||
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
_update_theme();
|
||||
_register_all_gizmos();
|
||||
_update_gizmos_menu();
|
||||
_init_indicators();
|
||||
|
@ -7204,7 +7167,40 @@ void Node3DEditor::_notification(int p_what) {
|
|||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_update_theme();
|
||||
tool_button[TOOL_MODE_SELECT]->set_icon(get_theme_icon(SNAME("ToolSelect"), SNAME("EditorIcons")));
|
||||
tool_button[TOOL_MODE_MOVE]->set_icon(get_theme_icon(SNAME("ToolMove"), SNAME("EditorIcons")));
|
||||
tool_button[TOOL_MODE_ROTATE]->set_icon(get_theme_icon(SNAME("ToolRotate"), SNAME("EditorIcons")));
|
||||
tool_button[TOOL_MODE_SCALE]->set_icon(get_theme_icon(SNAME("ToolScale"), SNAME("EditorIcons")));
|
||||
tool_button[TOOL_MODE_LIST_SELECT]->set_icon(get_theme_icon(SNAME("ListSelect"), SNAME("EditorIcons")));
|
||||
tool_button[TOOL_LOCK_SELECTED]->set_icon(get_theme_icon(SNAME("Lock"), SNAME("EditorIcons")));
|
||||
tool_button[TOOL_UNLOCK_SELECTED]->set_icon(get_theme_icon(SNAME("Unlock"), SNAME("EditorIcons")));
|
||||
tool_button[TOOL_GROUP_SELECTED]->set_icon(get_theme_icon(SNAME("Group"), SNAME("EditorIcons")));
|
||||
tool_button[TOOL_UNGROUP_SELECTED]->set_icon(get_theme_icon(SNAME("Ungroup"), SNAME("EditorIcons")));
|
||||
|
||||
tool_option_button[TOOL_OPT_LOCAL_COORDS]->set_icon(get_theme_icon(SNAME("Object"), SNAME("EditorIcons")));
|
||||
tool_option_button[TOOL_OPT_USE_SNAP]->set_icon(get_theme_icon(SNAME("Snap"), SNAME("EditorIcons")));
|
||||
tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->set_icon(get_theme_icon(SNAME("Camera3D"), SNAME("EditorIcons")));
|
||||
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), get_theme_icon(SNAME("Panels1"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), get_theme_icon(SNAME("Panels2"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS_ALT), get_theme_icon(SNAME("Panels2Alt"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS), get_theme_icon(SNAME("Panels3"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS_ALT), get_theme_icon(SNAME("Panels3Alt"), SNAME("EditorIcons")));
|
||||
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_4_VIEWPORTS), get_theme_icon(SNAME("Panels4"), SNAME("EditorIcons")));
|
||||
|
||||
sun_button->set_icon(get_theme_icon(SNAME("DirectionalLight3D"), 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_title->add_theme_font_override("font", get_theme_font(SNAME("title_font"), SNAME("Window")));
|
||||
environ_title->add_theme_font_override("font", get_theme_font(SNAME("title_font"), SNAME("Window")));
|
||||
|
||||
sun_color->set_custom_minimum_size(Size2(0, get_theme_constant(SNAME("color_picker_button_height"), SNAME("Editor"))));
|
||||
environ_sky_color->set_custom_minimum_size(Size2(0, get_theme_constant(SNAME("color_picker_button_height"), SNAME("Editor"))));
|
||||
environ_ground_color->set_custom_minimum_size(Size2(0, get_theme_constant(SNAME("color_picker_button_height"), SNAME("Editor"))));
|
||||
|
||||
context_menu_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("ContextualToolbar"), SNAME("EditorStyles")));
|
||||
|
||||
_update_gizmos_menu_theme();
|
||||
sun_title->add_theme_font_override("font", get_theme_font(SNAME("title_font"), SNAME("Window")));
|
||||
environ_title->add_theme_font_override("font", get_theme_font(SNAME("title_font"), SNAME("Window")));
|
||||
|
|
|
@ -778,8 +778,6 @@ private:
|
|||
void _add_sun_to_scene(bool p_already_added_environment = false);
|
||||
void _add_environment_to_scene(bool p_already_added_sun = false);
|
||||
|
||||
void _update_theme();
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
//void _gui_input(InputEvent p_event);
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
|
||||
void Path2DEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
curve_edit->set_icon(get_theme_icon(SNAME("CurveEdit"), SNAME("EditorIcons")));
|
||||
curve_edit_curve->set_icon(get_theme_icon(SNAME("CurveCurve"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -563,8 +563,6 @@ void Path3DEditorPlugin::_notification(int p_what) {
|
|||
curve_edit->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(1));
|
||||
curve_del->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(2));
|
||||
curve_close->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_close_curve));
|
||||
|
||||
_update_theme();
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_READY: {
|
||||
|
|
|
@ -91,8 +91,8 @@ void Polygon2DEditor::_notification(int p_what) {
|
|||
|
||||
uv_vscroll->set_anchors_and_offsets_preset(PRESET_RIGHT_WIDE);
|
||||
uv_hscroll->set_anchors_and_offsets_preset(PRESET_BOTTOM_WIDE);
|
||||
[[fallthrough]];
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
uv_edit_draw->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
bone_scroll->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
|
||||
void ResourcePreloaderEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
load->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
|
|
|
@ -234,7 +234,6 @@ void EditorPropertyRootMotion::setup(const NodePath &p_base_hint) {
|
|||
|
||||
void EditorPropertyRootMotion::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
Ref<Texture2D> t = get_theme_icon(SNAME("Clear"), SNAME("EditorIcons"));
|
||||
clear->set_icon(t);
|
||||
|
|
|
@ -352,9 +352,9 @@ void ScriptEditorQuickOpen::_notification(int p_what) {
|
|||
connect("confirmed", callable_mp(this, &ScriptEditorQuickOpen::_confirmed));
|
||||
|
||||
search_box->set_clear_button_enabled(true);
|
||||
[[fallthrough]];
|
||||
}
|
||||
case NOTIFICATION_VISIBILITY_CHANGED: {
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
search_box->set_right_icon(search_options->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
|
||||
|
@ -1613,8 +1613,8 @@ void ScriptEditor::_notification(int p_what) {
|
|||
EditorSettings::get_singleton()->connect("settings_changed", callable_mp(this, &ScriptEditor::_editor_settings_changed));
|
||||
EditorFileSystem::get_singleton()->connect("filesystem_changed", callable_mp(this, &ScriptEditor::_filesystem_changed));
|
||||
_editor_settings_changed();
|
||||
[[fallthrough]];
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_TRANSLATION_CHANGED:
|
||||
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
|
|
|
@ -1392,7 +1392,11 @@ void ScriptTextEditor::_change_syntax_highlighter(int p_idx) {
|
|||
|
||||
void ScriptTextEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_THEME_CHANGED:
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
code_editor->get_text_editor()->set_gutter_width(connection_gutter, code_editor->get_text_editor()->get_line_height());
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
if (!editor_enabled) {
|
||||
break;
|
||||
}
|
||||
|
@ -1400,9 +1404,6 @@ void ScriptTextEditor::_notification(int p_what) {
|
|||
_update_warnings();
|
||||
_update_errors();
|
||||
}
|
||||
[[fallthrough]];
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
code_editor->get_text_editor()->set_gutter_width(connection_gutter, code_editor->get_text_editor()->get_line_height());
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -712,7 +712,6 @@ void ShaderEditor::_menu_option(int p_option) {
|
|||
|
||||
void ShaderEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
PopupMenu *popup = help_menu->get_popup();
|
||||
popup->set_item_icon(popup->get_item_index(HELP_DOCS), get_theme_icon(SNAME("ExternalLink"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -506,7 +506,6 @@ void Sprite2DEditor::_debug_uv_draw() {
|
|||
|
||||
void Sprite2DEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
options->set_icon(get_theme_icon(SNAME("Sprite2D"), SNAME("EditorIcons")));
|
||||
|
||||
|
|
|
@ -408,7 +408,6 @@ void SpriteFramesEditor::_prepare_sprite_sheet(const String &p_file) {
|
|||
|
||||
void SpriteFramesEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
load->set_icon(get_theme_icon(SNAME("Load"), SNAME("EditorIcons")));
|
||||
load_sheet->set_icon(get_theme_icon(SNAME("SpriteSheet"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -71,15 +71,7 @@ void StyleBoxPreview::_sb_changed() {
|
|||
|
||||
void StyleBoxPreview::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
if (!is_inside_tree()) {
|
||||
// TODO: This is a workaround because `NOTIFICATION_THEME_CHANGED`
|
||||
// is getting called for some reason when the `TexturePreview` is
|
||||
// getting destroyed, which causes `get_theme_font()` to return `nullptr`.
|
||||
// See https://github.com/godotengine/godot/issues/50743.
|
||||
break;
|
||||
}
|
||||
grid_preview->set_normal_texture(get_theme_icon(SNAME("StyleBoxGridInvisible"), SNAME("EditorIcons")));
|
||||
grid_preview->set_pressed_texture(get_theme_icon(SNAME("StyleBoxGridVisible"), SNAME("EditorIcons")));
|
||||
grid_preview->set_hover_texture(get_theme_icon(SNAME("StyleBoxGridVisible"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -38,16 +38,7 @@ TextureRect *TexturePreview::get_texture_display() {
|
|||
|
||||
void TexturePreview::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
if (!is_inside_tree()) {
|
||||
// TODO: This is a workaround because `NOTIFICATION_THEME_CHANGED`
|
||||
// is getting called for some reason when the `TexturePreview` is
|
||||
// getting destroyed, which causes `get_theme_font()` to return `nullptr`.
|
||||
// See https://github.com/godotengine/godot/issues/50743.
|
||||
break;
|
||||
}
|
||||
|
||||
if (metadata_label) {
|
||||
Ref<Font> metadata_label_font = get_theme_font(SNAME("expression"), SNAME("EditorFonts"));
|
||||
metadata_label->add_theme_font_override("font", metadata_label_font);
|
||||
|
|
|
@ -821,7 +821,6 @@ void TextureRegionEditor::_update_autoslice() {
|
|||
|
||||
void TextureRegionEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
edit_draw->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
} break;
|
||||
|
|
|
@ -839,7 +839,6 @@ bool ThemeItemImportTree::has_selected_items() const {
|
|||
|
||||
void ThemeItemImportTree::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
select_icons_warning_icon->set_texture(get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons")));
|
||||
select_icons_warning->add_theme_color_override("font_color", get_theme_color(SNAME("disabled_font_color"), SNAME("Editor")));
|
||||
|
@ -1865,8 +1864,8 @@ void ThemeItemEditorDialog::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
connect("about_to_popup", callable_mp(this, &ThemeItemEditorDialog::_dialog_about_to_show));
|
||||
[[fallthrough]];
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
edit_items_add_color->set_icon(get_theme_icon(SNAME("Color"), SNAME("EditorIcons")));
|
||||
edit_items_add_constant->set_icon(get_theme_icon(SNAME("MemberConstant"), SNAME("EditorIcons")));
|
||||
|
@ -2194,8 +2193,8 @@ void ThemeTypeDialog::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
connect("about_to_popup", callable_mp(this, &ThemeTypeDialog::_dialog_about_to_show));
|
||||
[[fallthrough]];
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_update_add_type_options();
|
||||
} break;
|
||||
|
@ -3302,7 +3301,6 @@ void ThemeTypeEditor::_add_type_dialog_selected(const String p_type_name) {
|
|||
|
||||
void ThemeTypeEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
add_type_button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
|
||||
|
@ -3595,7 +3593,6 @@ void ThemeEditor::_preview_control_picked(String p_class_name) {
|
|||
|
||||
void ThemeEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
preview_tabs->add_theme_style_override("tab_selected", get_theme_stylebox(SNAME("ThemeEditorPreviewFG"), SNAME("EditorStyles")));
|
||||
preview_tabs->add_theme_style_override("tab_unselected", get_theme_stylebox(SNAME("ThemeEditorPreviewBG"), SNAME("EditorStyles")));
|
||||
|
|
|
@ -193,8 +193,8 @@ void ThemeEditorPreview::_notification(int p_what) {
|
|||
}
|
||||
|
||||
connect("visibility_changed", callable_mp(this, &ThemeEditorPreview::_preview_visibility_changed));
|
||||
[[fallthrough]];
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
picker_button->set_icon(get_theme_icon(SNAME("ColorPick"), SNAME("EditorIcons")));
|
||||
|
||||
|
@ -272,7 +272,6 @@ ThemeEditorPreview::ThemeEditorPreview() {
|
|||
|
||||
void DefaultThemeEditorPreview::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
test_color_picker_button->set_custom_minimum_size(Size2(0, get_theme_constant(SNAME("color_picker_button_height"), SNAME("Editor"))));
|
||||
} break;
|
||||
|
@ -475,7 +474,6 @@ void SceneThemeEditorPreview::_reload_scene() {
|
|||
|
||||
void SceneThemeEditorPreview::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
reload_scene_button->set_icon(get_theme_icon(SNAME("Reload"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
|
|
|
@ -722,7 +722,6 @@ void GenericTilePolygonEditor::set_multiple_polygon_mode(bool p_multiple_polygon
|
|||
|
||||
void GenericTilePolygonEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
button_create->set_icon(get_theme_icon(SNAME("CurveCreate"), SNAME("EditorIcons")));
|
||||
button_edit->set_icon(get_theme_icon(SNAME("CurveEdit"), SNAME("EditorIcons")));
|
||||
|
@ -1168,7 +1167,6 @@ void TileDataDefaultEditor::setup_property_editor(Variant::Type p_type, String p
|
|||
|
||||
void TileDataDefaultEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
picker_button->set_icon(get_theme_icon(SNAME("ColorPick"), SNAME("EditorIcons")));
|
||||
tile_bool_checked = get_theme_icon(SNAME("TileChecked"), SNAME("EditorIcons"));
|
||||
|
@ -2567,7 +2565,6 @@ void TileDataTerrainsEditor::draw_over_tile(CanvasItem *p_canvas_item, Transform
|
|||
|
||||
void TileDataTerrainsEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
picker_button->set_icon(get_theme_icon(SNAME("ColorPick"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
|
|
|
@ -2146,7 +2146,6 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() {
|
|||
|
||||
// --- Bottom panel tiles ---
|
||||
tiles_bottom_panel = memnew(VBoxContainer);
|
||||
tiles_bottom_panel->connect("tree_entered", callable_mp(this, &TileMapEditorTilesPlugin::_update_theme));
|
||||
tiles_bottom_panel->connect("theme_changed", callable_mp(this, &TileMapEditorTilesPlugin::_update_theme));
|
||||
tiles_bottom_panel->connect("visibility_changed", callable_mp(this, &TileMapEditorTilesPlugin::_stop_dragging));
|
||||
tiles_bottom_panel->connect("visibility_changed", callable_mp(this, &TileMapEditorTilesPlugin::_tab_changed));
|
||||
|
@ -3311,7 +3310,6 @@ TileMapEditorTerrainsPlugin::TileMapEditorTerrainsPlugin() {
|
|||
undo_redo = EditorNode::get_undo_redo();
|
||||
|
||||
main_vbox_container = memnew(VBoxContainer);
|
||||
main_vbox_container->connect("tree_entered", callable_mp(this, &TileMapEditorTerrainsPlugin::_update_theme));
|
||||
main_vbox_container->connect("theme_changed", callable_mp(this, &TileMapEditorTerrainsPlugin::_update_theme));
|
||||
main_vbox_container->set_name("Terrains");
|
||||
|
||||
|
@ -3419,7 +3417,6 @@ TileMapEditorTerrainsPlugin::~TileMapEditorTerrainsPlugin() {
|
|||
|
||||
void TileMapEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
missing_tile_texture = get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons"));
|
||||
warning_pattern_texture = get_theme_icon(SNAME("WarningPattern"), SNAME("EditorIcons"));
|
||||
|
|
|
@ -2287,7 +2287,6 @@ void TileSetAtlasSourceEditor::_auto_remove_tiles() {
|
|||
|
||||
void TileSetAtlasSourceEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
tool_setup_atlas_source_button->set_icon(get_theme_icon(SNAME("Tools"), SNAME("EditorIcons")));
|
||||
tool_select_button->set_icon(get_theme_icon(SNAME("ToolSelect"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -333,7 +333,6 @@ void TileSetEditor::_set_source_sort(int p_sort) {
|
|||
|
||||
void TileSetEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
sources_delete_button->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
|
||||
sources_add_button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -329,7 +329,6 @@ void TileSetScenesCollectionSourceEditor::_update_scenes_list() {
|
|||
|
||||
void TileSetScenesCollectionSourceEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
scene_tile_add_button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
scene_tile_delete_button->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -1716,7 +1716,6 @@ void VisualShaderEditor::_update_graph() {
|
|||
|
||||
graph_plugin->clear_links();
|
||||
graph_plugin->make_dirty(true);
|
||||
graph_plugin->update_theme();
|
||||
|
||||
for (int n_i = 0; n_i < nodes.size(); n_i++) {
|
||||
graph_plugin->add_node(type, nodes[n_i]);
|
||||
|
@ -3704,9 +3703,11 @@ void VisualShaderEditor::_notification(int p_what) {
|
|||
|
||||
graph->get_panner()->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning")));
|
||||
graph->set_warped_panning(bool(EditorSettings::get_singleton()->get("editors/panning/warped_mouse_panning")));
|
||||
[[fallthrough]];
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
graph_plugin->update_theme();
|
||||
|
||||
highend_label->set_modulate(get_theme_color(SNAME("vulkan_color"), SNAME("Editor")));
|
||||
|
||||
node_filter->set_right_icon(Control::get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
|
@ -3759,7 +3760,7 @@ void VisualShaderEditor::_notification(int p_what) {
|
|||
|
||||
tools->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("Tools"), SNAME("EditorIcons")));
|
||||
|
||||
if (p_what == NOTIFICATION_THEME_CHANGED && is_visible_in_tree()) {
|
||||
if (is_visible_in_tree()) {
|
||||
_update_graph();
|
||||
}
|
||||
} break;
|
||||
|
|
|
@ -518,24 +518,6 @@ void ProjectSettingsEditor::_update_action_map_editor() {
|
|||
action_map_editor->update_action_list(actions);
|
||||
}
|
||||
|
||||
void ProjectSettingsEditor::_update_theme() {
|
||||
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_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_label->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
|
||||
type_box->clear();
|
||||
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
|
||||
if (i == Variant::NIL || i == Variant::OBJECT || i == Variant::CALLABLE || i == Variant::SIGNAL || i == Variant::RID) {
|
||||
// These types can't be serialized properly, so skip them.
|
||||
continue;
|
||||
}
|
||||
String type = Variant::get_type_name(Variant::Type(i));
|
||||
type_box->add_icon_item(get_theme_icon(type, SNAME("EditorIcons")), type, i);
|
||||
}
|
||||
}
|
||||
|
||||
void ProjectSettingsEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_VISIBILITY_CHANGED: {
|
||||
|
@ -547,11 +529,24 @@ void ProjectSettingsEditor::_notification(int p_what) {
|
|||
case NOTIFICATION_ENTER_TREE: {
|
||||
general_settings_inspector->edit(ps);
|
||||
_update_action_map_editor();
|
||||
_update_theme();
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_update_theme();
|
||||
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_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_label->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
|
||||
type_box->clear();
|
||||
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
|
||||
if (i == Variant::NIL || i == Variant::OBJECT || i == Variant::CALLABLE || i == Variant::SIGNAL || i == Variant::RID) {
|
||||
// These types can't be serialized properly, so skip them.
|
||||
continue;
|
||||
}
|
||||
String type = Variant::get_type_name(Variant::Type(i));
|
||||
type_box->add_icon_item(get_theme_icon(type, SNAME("EditorIcons")), type, i);
|
||||
}
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,7 +106,6 @@ class ProjectSettingsEditor : public AcceptDialog {
|
|||
void _action_renamed(const String &p_old_name, const String &p_new_name);
|
||||
void _action_reordered(const String &p_action_name, const String &p_relative_to, bool p_before);
|
||||
void _update_action_map_editor();
|
||||
void _update_theme();
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
|
||||
void SceneCreateDialog::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
select_node_button->set_icon(get_theme_icon(SNAME("ClassList"), SNAME("EditorIcons")));
|
||||
node_type_2d->set_icon(get_theme_icon(SNAME("Node2D"), SNAME("EditorIcons")));
|
||||
|
|
|
@ -1345,10 +1345,6 @@ void SceneTreeDialog::popup_scenetree_dialog() {
|
|||
popup_centered_clamped(Size2(350, 700) * EDSCALE);
|
||||
}
|
||||
|
||||
void SceneTreeDialog::_update_theme() {
|
||||
filter->set_right_icon(tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
void SceneTreeDialog::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_VISIBILITY_CHANGED: {
|
||||
|
@ -1359,11 +1355,10 @@ void SceneTreeDialog::_notification(int p_what) {
|
|||
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
connect("confirmed", callable_mp(this, &SceneTreeDialog::_select));
|
||||
_update_theme();
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_update_theme();
|
||||
filter->set_right_icon(tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_EXIT_TREE: {
|
||||
|
|
|
@ -179,7 +179,6 @@ class SceneTreeDialog : public ConfirmationDialog {
|
|||
void _cancel();
|
||||
void _selected_changed();
|
||||
void _filter_changed(const String &p_filter);
|
||||
void _update_theme();
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
|
|
|
@ -120,9 +120,8 @@ void ScriptCreateDialog::_notification(int p_what) {
|
|||
} else {
|
||||
language_menu->select(default_language);
|
||||
}
|
||||
} break;
|
||||
|
||||
[[fallthrough]];
|
||||
}
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
for (int i = 0; i < ScriptServer::get_language_count(); i++) {
|
||||
Ref<Texture2D> language_icon = get_theme_icon(ScriptServer::get_language(i)->get_type(), SNAME("EditorIcons"));
|
||||
|
|
|
@ -47,8 +47,6 @@ enum ShaderType {
|
|||
void ShaderCreateDialog::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
_update_theme();
|
||||
|
||||
String last_lang = EditorSettings::get_singleton()->get_project_metadata("shader_setup", "last_selected_language", "");
|
||||
if (!last_lang.is_empty()) {
|
||||
for (int i = 0; i < type_menu->get_item_count(); i++) {
|
||||
|
@ -67,31 +65,27 @@ void ShaderCreateDialog::_notification(int p_what) {
|
|||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_update_theme();
|
||||
Ref<Texture2D> shader_icon = gc->get_theme_icon(SNAME("Shader"), SNAME("EditorIcons"));
|
||||
if (shader_icon.is_valid()) {
|
||||
type_menu->set_item_icon(0, shader_icon);
|
||||
}
|
||||
|
||||
Ref<Texture2D> visual_shader_icon = gc->get_theme_icon(SNAME("VisualShader"), SNAME("EditorIcons"));
|
||||
if (visual_shader_icon.is_valid()) {
|
||||
type_menu->set_item_icon(1, visual_shader_icon);
|
||||
}
|
||||
|
||||
Ref<Texture2D> include_icon = gc->get_theme_icon(SNAME("TextFile"), SNAME("EditorIcons"));
|
||||
if (include_icon.is_valid()) {
|
||||
type_menu->set_item_icon(2, include_icon);
|
||||
}
|
||||
|
||||
path_button->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
|
||||
status_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
void ShaderCreateDialog::_update_theme() {
|
||||
Ref<Texture2D> shader_icon = gc->get_theme_icon(SNAME("Shader"), SNAME("EditorIcons"));
|
||||
if (shader_icon.is_valid()) {
|
||||
type_menu->set_item_icon(0, shader_icon);
|
||||
}
|
||||
|
||||
Ref<Texture2D> visual_shader_icon = gc->get_theme_icon(SNAME("VisualShader"), SNAME("EditorIcons"));
|
||||
if (visual_shader_icon.is_valid()) {
|
||||
type_menu->set_item_icon(1, visual_shader_icon);
|
||||
}
|
||||
|
||||
Ref<Texture2D> include_icon = gc->get_theme_icon(SNAME("TextFile"), SNAME("EditorIcons"));
|
||||
if (include_icon.is_valid()) {
|
||||
type_menu->set_item_icon(2, include_icon);
|
||||
}
|
||||
|
||||
path_button->set_icon(get_theme_icon(SNAME("Folder"), SNAME("EditorIcons")));
|
||||
status_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
}
|
||||
|
||||
void ShaderCreateDialog::_update_language_info() {
|
||||
type_data.clear();
|
||||
|
||||
|
|
|
@ -98,7 +98,6 @@ class ShaderCreateDialog : public ConfirmationDialog {
|
|||
void _update_dialog();
|
||||
|
||||
protected:
|
||||
void _update_theme();
|
||||
void _notification(int p_what);
|
||||
static void _bind_methods();
|
||||
|
||||
|
|
|
@ -1011,13 +1011,6 @@ void GridMapEditor::_draw_grids(const Vector3 &cell_size) {
|
|||
}
|
||||
}
|
||||
|
||||
void GridMapEditor::_update_theme() {
|
||||
options->set_icon(get_theme_icon(SNAME("GridMap"), SNAME("EditorIcons")));
|
||||
search_box->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
mode_thumbnail->set_icon(get_theme_icon(SNAME("FileThumbnail"), SNAME("EditorIcons")));
|
||||
mode_list->set_icon(get_theme_icon(SNAME("FileList"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
void GridMapEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
|
@ -1038,7 +1031,6 @@ void GridMapEditor::_notification(int p_what) {
|
|||
|
||||
_update_selection_transform();
|
||||
_update_paste_indicator();
|
||||
_update_theme();
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_EXIT_TREE: {
|
||||
|
@ -1079,7 +1071,10 @@ void GridMapEditor::_notification(int p_what) {
|
|||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_update_theme();
|
||||
options->set_icon(get_theme_icon(SNAME("GridMap"), SNAME("EditorIcons")));
|
||||
search_box->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
|
||||
mode_thumbnail->set_icon(get_theme_icon(SNAME("FileThumbnail"), SNAME("EditorIcons")));
|
||||
mode_list->set_icon(get_theme_icon(SNAME("FileList"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_APPLICATION_FOCUS_OUT: {
|
||||
|
|
|
@ -193,7 +193,6 @@ class GridMapEditor : public VBoxContainer {
|
|||
void _item_selected_cbk(int idx);
|
||||
void _update_cursor_transform();
|
||||
void _update_cursor_instance();
|
||||
void _update_theme();
|
||||
|
||||
void _text_changed(const String &p_text);
|
||||
void _sbox_input(const Ref<InputEvent> &p_ie);
|
||||
|
|
|
@ -34,15 +34,10 @@ void OpenXRActionEditor::_bind_methods() {
|
|||
ADD_SIGNAL(MethodInfo("remove", PropertyInfo(Variant::OBJECT, "action_editor")));
|
||||
}
|
||||
|
||||
void OpenXRActionEditor::_theme_changed() {
|
||||
rem_action->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
void OpenXRActionEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_theme_changed();
|
||||
rem_action->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@ private:
|
|||
OptionButton *action_type = nullptr;
|
||||
Button *rem_action = nullptr;
|
||||
|
||||
void _theme_changed();
|
||||
void _on_action_name_changed(const String p_new_text);
|
||||
void _on_action_localized_name_changed(const String p_new_text);
|
||||
void _on_item_selected(int p_idx);
|
||||
|
|
|
@ -52,7 +52,6 @@ void OpenXRActionMapEditor::_bind_methods() {
|
|||
|
||||
void OpenXRActionMapEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
for (int i = 0; i < tabs->get_child_count(); i++) {
|
||||
Control *tab = static_cast<Control *>(tabs->get_child(i));
|
||||
|
|
|
@ -44,17 +44,12 @@ void OpenXRActionSetEditor::_set_fold_icon() {
|
|||
}
|
||||
}
|
||||
|
||||
void OpenXRActionSetEditor::_theme_changed() {
|
||||
_set_fold_icon();
|
||||
add_action->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
rem_action_set->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
|
||||
}
|
||||
|
||||
void OpenXRActionSetEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_theme_changed();
|
||||
_set_fold_icon();
|
||||
add_action->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
|
||||
rem_action_set->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
|
||||
panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("TabContainer")));
|
||||
} break;
|
||||
}
|
||||
|
|
|
@ -61,7 +61,6 @@ private:
|
|||
VBoxContainer *actions_vb = nullptr;
|
||||
|
||||
void _set_fold_icon();
|
||||
void _theme_changed();
|
||||
OpenXRActionEditor *_add_action_editor(Ref<OpenXRAction> p_action);
|
||||
void _update_actions();
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ void OpenXRSelectActionDialog::_bind_methods() {
|
|||
|
||||
void OpenXRSelectActionDialog::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
scroll->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
} break;
|
||||
|
|
|
@ -36,7 +36,6 @@ void OpenXRSelectInteractionProfileDialog::_bind_methods() {
|
|||
|
||||
void OpenXRSelectInteractionProfileDialog::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
scroll->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
|
||||
} break;
|
||||
|
|
|
@ -36,8 +36,7 @@
|
|||
|
||||
void CodeEdit::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_THEME_CHANGED:
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
style_normal = get_theme_stylebox(SNAME("normal"));
|
||||
|
||||
font = get_theme_font(SNAME("font"));
|
||||
|
|
|
@ -63,8 +63,8 @@ void ColorPicker::_notification(int p_what) {
|
|||
}
|
||||
}
|
||||
#endif
|
||||
[[fallthrough]];
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
btn_pick->set_icon(get_theme_icon(SNAME("screen_picker"), SNAME("ColorPicker")));
|
||||
btn_add_preset->set_icon(get_theme_icon(SNAME("add_preset")));
|
||||
|
|
|
@ -357,6 +357,7 @@ public:
|
|||
NOTIFICATION_MOUSE_EXIT = 42,
|
||||
NOTIFICATION_FOCUS_ENTER = 43,
|
||||
NOTIFICATION_FOCUS_EXIT = 44,
|
||||
// This doesn't need to be paired with `NOTIFICATION_ENTER_TREE`.
|
||||
NOTIFICATION_THEME_CHANGED = 45,
|
||||
NOTIFICATION_SCROLL_BEGIN = 47,
|
||||
NOTIFICATION_SCROLL_END = 48,
|
||||
|
|
|
@ -59,38 +59,6 @@ VBoxContainer *FileDialog::get_vbox() {
|
|||
return vbox;
|
||||
}
|
||||
|
||||
void FileDialog::_theme_changed() {
|
||||
Color font_color = vbox->get_theme_color(SNAME("font_color"), SNAME("Button"));
|
||||
Color font_hover_color = vbox->get_theme_color(SNAME("font_hover_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"));
|
||||
|
||||
dir_up->add_theme_color_override("icon_normal_color", font_color);
|
||||
dir_up->add_theme_color_override("icon_hover_color", font_hover_color);
|
||||
dir_up->add_theme_color_override("icon_focus_color", font_focus_color);
|
||||
dir_up->add_theme_color_override("icon_pressed_color", font_pressed_color);
|
||||
|
||||
dir_prev->add_theme_color_override("icon_color_normal", font_color);
|
||||
dir_prev->add_theme_color_override("icon_color_hover", font_hover_color);
|
||||
dir_prev->add_theme_color_override("icon_focus_color", font_focus_color);
|
||||
dir_prev->add_theme_color_override("icon_color_pressed", font_pressed_color);
|
||||
|
||||
dir_next->add_theme_color_override("icon_color_normal", font_color);
|
||||
dir_next->add_theme_color_override("icon_color_hover", font_hover_color);
|
||||
dir_next->add_theme_color_override("icon_focus_color", font_focus_color);
|
||||
dir_next->add_theme_color_override("icon_color_pressed", font_pressed_color);
|
||||
|
||||
refresh->add_theme_color_override("icon_normal_color", font_color);
|
||||
refresh->add_theme_color_override("icon_hover_color", font_hover_color);
|
||||
refresh->add_theme_color_override("icon_focus_color", font_focus_color);
|
||||
refresh->add_theme_color_override("icon_pressed_color", font_pressed_color);
|
||||
|
||||
show_hidden->add_theme_color_override("icon_normal_color", font_color);
|
||||
show_hidden->add_theme_color_override("icon_hover_color", font_hover_color);
|
||||
show_hidden->add_theme_color_override("icon_focus_color", font_focus_color);
|
||||
show_hidden->add_theme_color_override("icon_pressed_color", font_pressed_color);
|
||||
}
|
||||
|
||||
void FileDialog::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_VISIBILITY_CHANGED: {
|
||||
|
@ -99,23 +67,52 @@ void FileDialog::_notification(int p_what) {
|
|||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
dir_up->set_icon(vbox->get_theme_icon(SNAME("parent_folder"), SNAME("FileDialog")));
|
||||
if (vbox->is_layout_rtl()) {
|
||||
dir_prev->set_icon(vbox->get_theme_icon(SNAME("forward_folder"), SNAME("FileDialog")));
|
||||
dir_next->set_icon(vbox->get_theme_icon(SNAME("back_folder"), SNAME("FileDialog")));
|
||||
} else {
|
||||
dir_prev->set_icon(vbox->get_theme_icon(SNAME("back_folder"), SNAME("FileDialog")));
|
||||
dir_next->set_icon(vbox->get_theme_icon(SNAME("forward_folder"), SNAME("FileDialog")));
|
||||
}
|
||||
refresh->set_icon(vbox->get_theme_icon(SNAME("reload"), SNAME("FileDialog")));
|
||||
show_hidden->set_icon(vbox->get_theme_icon(SNAME("toggle_hidden"), SNAME("FileDialog")));
|
||||
_theme_changed();
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_TRANSLATION_CHANGED: {
|
||||
update_filters();
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
dir_up->set_icon(get_theme_icon(SNAME("parent_folder"), SNAME("FileDialog")));
|
||||
if (vbox->is_layout_rtl()) {
|
||||
dir_prev->set_icon(get_theme_icon(SNAME("forward_folder"), SNAME("FileDialog")));
|
||||
dir_next->set_icon(get_theme_icon(SNAME("back_folder"), SNAME("FileDialog")));
|
||||
} else {
|
||||
dir_prev->set_icon(get_theme_icon(SNAME("back_folder"), SNAME("FileDialog")));
|
||||
dir_next->set_icon(get_theme_icon(SNAME("forward_folder"), SNAME("FileDialog")));
|
||||
}
|
||||
refresh->set_icon(get_theme_icon(SNAME("reload"), SNAME("FileDialog")));
|
||||
show_hidden->set_icon(get_theme_icon(SNAME("toggle_hidden"), SNAME("FileDialog")));
|
||||
|
||||
Color font_color = get_theme_color(SNAME("font_color"), SNAME("Button"));
|
||||
Color font_hover_color = get_theme_color(SNAME("font_hover_color"), SNAME("Button"));
|
||||
Color font_focus_color = get_theme_color(SNAME("font_focus_color"), SNAME("Button"));
|
||||
Color font_pressed_color = get_theme_color(SNAME("font_pressed_color"), SNAME("Button"));
|
||||
|
||||
dir_up->add_theme_color_override("icon_normal_color", font_color);
|
||||
dir_up->add_theme_color_override("icon_hover_color", font_hover_color);
|
||||
dir_up->add_theme_color_override("icon_focus_color", font_focus_color);
|
||||
dir_up->add_theme_color_override("icon_pressed_color", font_pressed_color);
|
||||
|
||||
dir_prev->add_theme_color_override("icon_color_normal", font_color);
|
||||
dir_prev->add_theme_color_override("icon_color_hover", font_hover_color);
|
||||
dir_prev->add_theme_color_override("icon_focus_color", font_focus_color);
|
||||
dir_prev->add_theme_color_override("icon_color_pressed", font_pressed_color);
|
||||
|
||||
dir_next->add_theme_color_override("icon_color_normal", font_color);
|
||||
dir_next->add_theme_color_override("icon_color_hover", font_hover_color);
|
||||
dir_next->add_theme_color_override("icon_focus_color", font_focus_color);
|
||||
dir_next->add_theme_color_override("icon_color_pressed", font_pressed_color);
|
||||
|
||||
refresh->add_theme_color_override("icon_normal_color", font_color);
|
||||
refresh->add_theme_color_override("icon_hover_color", font_hover_color);
|
||||
refresh->add_theme_color_override("icon_focus_color", font_focus_color);
|
||||
refresh->add_theme_color_override("icon_pressed_color", font_pressed_color);
|
||||
|
||||
show_hidden->add_theme_color_override("icon_normal_color", font_color);
|
||||
show_hidden->add_theme_color_override("icon_hover_color", font_hover_color);
|
||||
show_hidden->add_theme_color_override("icon_focus_color", font_focus_color);
|
||||
show_hidden->add_theme_color_override("icon_pressed_color", font_pressed_color);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -506,10 +503,10 @@ void FileDialog::update_file_list() {
|
|||
}
|
||||
|
||||
TreeItem *root = tree->create_item();
|
||||
Ref<Texture2D> folder = vbox->get_theme_icon(SNAME("folder"), SNAME("FileDialog"));
|
||||
Ref<Texture2D> file_icon = vbox->get_theme_icon(SNAME("file"), SNAME("FileDialog"));
|
||||
const Color folder_color = vbox->get_theme_color(SNAME("folder_icon_modulate"), SNAME("FileDialog"));
|
||||
const Color file_color = vbox->get_theme_color(SNAME("file_icon_modulate"), SNAME("FileDialog"));
|
||||
Ref<Texture2D> folder = get_theme_icon(SNAME("folder"), SNAME("FileDialog"));
|
||||
Ref<Texture2D> file_icon = get_theme_icon(SNAME("file"), SNAME("FileDialog"));
|
||||
const Color folder_color = get_theme_color(SNAME("folder_icon_modulate"), SNAME("FileDialog"));
|
||||
const Color file_color = get_theme_color(SNAME("file_icon_modulate"), SNAME("FileDialog"));
|
||||
List<String> files;
|
||||
List<String> dirs;
|
||||
|
||||
|
@ -606,7 +603,7 @@ void FileDialog::update_file_list() {
|
|||
ti->set_icon_modulate(0, file_color);
|
||||
|
||||
if (mode == FILE_MODE_OPEN_DIR) {
|
||||
ti->set_custom_color(0, vbox->get_theme_color(SNAME("files_disabled"), SNAME("FileDialog")));
|
||||
ti->set_custom_color(0, get_theme_color(SNAME("files_disabled"), SNAME("FileDialog")));
|
||||
ti->set_selectable(0, false);
|
||||
}
|
||||
Dictionary d;
|
||||
|
@ -1006,7 +1003,6 @@ FileDialog::FileDialog() {
|
|||
|
||||
vbox = memnew(VBoxContainer);
|
||||
add_child(vbox, false, INTERNAL_MODE_FRONT);
|
||||
vbox->connect("theme_changed", callable_mp(this, &FileDialog::_theme_changed));
|
||||
|
||||
mode = FILE_MODE_SAVE_FILE;
|
||||
set_title(TTRC("Save a File"));
|
||||
|
|
|
@ -143,8 +143,6 @@ private:
|
|||
virtual void _post_popup() override;
|
||||
|
||||
protected:
|
||||
void _theme_changed();
|
||||
|
||||
void _notification(int p_what);
|
||||
static void _bind_methods();
|
||||
//bind helpers
|
||||
|
|
|
@ -292,8 +292,8 @@ void GradientEdit::_notification(int p_what) {
|
|||
if (!picker->is_connected("color_changed", callable_mp(this, &GradientEdit::_color_changed))) {
|
||||
picker->connect("color_changed", callable_mp(this, &GradientEdit::_color_changed));
|
||||
}
|
||||
[[fallthrough]];
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
draw_spacing = BASE_SPACING * get_theme_default_base_scale();
|
||||
draw_point_width = BASE_POINT_WIDTH * get_theme_default_base_scale();
|
||||
|
|
|
@ -424,7 +424,6 @@ void GraphEdit::remove_child_notify(Node *p_child) {
|
|||
|
||||
void GraphEdit::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
port_hotzone_inner_extent = get_theme_constant("port_hotzone_inner_extent");
|
||||
port_hotzone_outer_extent = get_theme_constant("port_hotzone_outer_extent");
|
||||
|
|
|
@ -240,8 +240,7 @@ void PopupPanel::_notification(int p_what) {
|
|||
panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), get_class_name()));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_READY: {
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), get_class_name()));
|
||||
_update_child_rects();
|
||||
} break;
|
||||
|
|
|
@ -317,10 +317,9 @@ void ScrollContainer::_reposition_children() {
|
|||
|
||||
void ScrollContainer::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED:
|
||||
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
|
||||
case NOTIFICATION_TRANSLATION_CHANGED: {
|
||||
case NOTIFICATION_TRANSLATION_CHANGED:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
_updating_scrollbars = true;
|
||||
call_deferred(SNAME("_update_scrollbar_position"));
|
||||
} break;
|
||||
|
|
|
@ -168,6 +168,7 @@ public:
|
|||
enum {
|
||||
NOTIFICATION_VISIBILITY_CHANGED = 30,
|
||||
NOTIFICATION_POST_POPUP = 31,
|
||||
// This doesn't need to be paired with `NOTIFICATION_ENTER_TREE`.
|
||||
NOTIFICATION_THEME_CHANGED = 32
|
||||
};
|
||||
|
||||
|
|
|
@ -2943,6 +2943,10 @@ TEST_CASE("[SceneTree][CodeEdit] completion") {
|
|||
code_edit->set_code_completion_enabled(true);
|
||||
CHECK(code_edit->get_code_completion_selected_index() == -1);
|
||||
|
||||
// Need to flush here since `NOTIFICATION_THEME_CHANGED` is called deferred from `NOTIFICATION_ENTER_TREE`,
|
||||
// and `update_code_completion_options` requires access to the theme's font size.
|
||||
MessageQueue::get_singleton()->flush();
|
||||
|
||||
code_edit->update_code_completion_options();
|
||||
code_edit->set_code_completion_selected_index(1);
|
||||
CHECK(code_edit->get_code_completion_selected_index() == -1);
|
||||
|
|
Loading…
Reference in New Issue