mirror of
https://github.com/godotengine/godot.git
synced 2026-01-08 00:25:01 +03:00
Revert "Add missing SNAME macro optimization to all theme methods call"
This reverts commit a988fad9a0.
As discussed in #57725 and clarified in #57788, `SNAME` is not meant to be used
everywhere but only in critical code paths. For theme methods specifically, it
was by design that only getters use `SNAME` and not setters.
This commit is contained in:
@@ -561,12 +561,12 @@ void ImportDock::_reimport() {
|
||||
void ImportDock::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
||||
imported->add_theme_style_override(SNAME("normal"), get_theme_stylebox(SNAME("normal"), SNAME("LineEdit")));
|
||||
imported->add_theme_style_override("normal", get_theme_stylebox(SNAME("normal"), SNAME("LineEdit")));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
import_opts->edit(params);
|
||||
label_warning->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
label_warning->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
@@ -579,12 +579,12 @@ void ImportDock::_set_dirty(bool p_dirty) {
|
||||
if (p_dirty) {
|
||||
// Add a dirty marker to notify the user that they should reimport the selected resource to see changes.
|
||||
import->set_text(TTR("Reimport") + " (*)");
|
||||
import->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
import->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
|
||||
import->set_tooltip(TTR("You have pending changes that haven't been applied yet. Click Reimport to apply changes made to the import options.\nSelecting another resource in the FileSystem dock without clicking Reimport first will discard changes made in the Import dock."));
|
||||
} else {
|
||||
// Remove the dirty marker on the Reimport button.
|
||||
import->set_text(TTR("Reimport"));
|
||||
import->remove_theme_color_override(SNAME("font_color"));
|
||||
import->remove_theme_color_override("font_color");
|
||||
import->set_tooltip("");
|
||||
}
|
||||
}
|
||||
@@ -617,7 +617,7 @@ ImportDock::ImportDock() {
|
||||
content->hide();
|
||||
|
||||
imported = memnew(Label);
|
||||
imported->add_theme_style_override(SNAME("normal"), EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("normal"), SNAME("LineEdit")));
|
||||
imported->add_theme_style_override("normal", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("normal"), SNAME("LineEdit")));
|
||||
imported->set_clip_text(true);
|
||||
content->add_child(imported);
|
||||
HBoxContainer *hb = memnew(HBoxContainer);
|
||||
|
||||
Reference in New Issue
Block a user