summaryrefslogtreecommitdiff
path: root/editor/plugins/ot_features_plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/ot_features_plugin.cpp')
-rw-r--r--editor/plugins/ot_features_plugin.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/editor/plugins/ot_features_plugin.cpp b/editor/plugins/ot_features_plugin.cpp
index d2daa4fa8d..f8e6054848 100644
--- a/editor/plugins/ot_features_plugin.cpp
+++ b/editor/plugins/ot_features_plugin.cpp
@@ -30,8 +30,6 @@
#include "ot_features_plugin.h"
-#include "editor/editor_scale.h"
-
void OpenTypeFeaturesEditor::_value_changed(double val) {
if (setting) {
return;
@@ -48,12 +46,15 @@ void OpenTypeFeaturesEditor::update_property() {
}
void OpenTypeFeaturesEditor::_notification(int p_what) {
- if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
- Color base = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
-
- button->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
- button->set_size(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons"))->get_size());
- spin->set_custom_label_color(true, base);
+ switch (p_what) {
+ case NOTIFICATION_ENTER_TREE:
+ case NOTIFICATION_THEME_CHANGED: {
+ Color base = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
+
+ button->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
+ button->set_size(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons"))->get_size());
+ spin->set_custom_label_color(true, base);
+ } break;
}
}
@@ -141,10 +142,13 @@ void OpenTypeFeaturesAdd::_features_menu() {
}
void OpenTypeFeaturesAdd::_notification(int p_what) {
- if (p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_ENTER_TREE) {
- set_label("");
- button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
- button->set_size(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))->get_size());
+ switch (p_what) {
+ case NOTIFICATION_THEME_CHANGED:
+ case NOTIFICATION_ENTER_TREE: {
+ set_label("");
+ button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
+ button->set_size(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))->get_size());
+ } break;
}
}
@@ -201,7 +205,7 @@ bool EditorInspectorPluginOpenTypeFeatures::parse_property(Object *p_object, con
/*************************************************************************/
-OpenTypeFeaturesEditorPlugin::OpenTypeFeaturesEditorPlugin(EditorNode *p_node) {
+OpenTypeFeaturesEditorPlugin::OpenTypeFeaturesEditorPlugin() {
Ref<EditorInspectorPluginOpenTypeFeatures> ftr_plugin;
ftr_plugin.instantiate();
EditorInspector::add_inspector_plugin(ftr_plugin);