diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2023-03-02 20:37:02 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2023-04-29 10:51:00 +0800 |
commit | d24ee551ecb09209ead942a00e88ea42b66b15be (patch) | |
tree | c683dfae43f80473b1a1ce0e6c833540384bcabf /editor/import_dock.cpp | |
parent | 9f12e7b52d944281a39b7d3a33de6700c76cc23a (diff) | |
download | redot-engine-d24ee551ecb09209ead942a00e88ea42b66b15be.tar.gz |
Allow EditorInspector to change its property name style when necessary
Previously, an EditorInspector's property name can only be set from
outside. Inspectors used for settings needs to respond to changes in
editor settings. So a few boilerplate code is almost always needed,
including watching for a certain editor setting in `_notification()`.
This commit adds a `set_use_settings_style()` function to tell the
inspector to watch for editor settings changes on its own.
Diffstat (limited to 'editor/import_dock.cpp')
-rw-r--r-- | editor/import_dock.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp index b5680f2f2c..7b8b9cd7a4 100644 --- a/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -565,7 +565,6 @@ void ImportDock::_notification(int p_what) { switch (p_what) { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { imported->add_theme_style_override("normal", get_theme_stylebox(SNAME("normal"), SNAME("LineEdit"))); - import_opts->set_property_name_style(EditorPropertyNameProcessor::get_settings_style()); } break; case NOTIFICATION_ENTER_TREE: { @@ -643,7 +642,6 @@ ImportDock::ImportDock() { import_opts = memnew(EditorInspector); content->add_child(import_opts); import_opts->set_v_size_flags(SIZE_EXPAND_FILL); - import_opts->set_property_name_style(EditorPropertyNameProcessor::get_settings_style()); import_opts->connect("property_edited", callable_mp(this, &ImportDock::_property_edited)); import_opts->connect("property_toggled", callable_mp(this, &ImportDock::_property_toggled)); |