diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2022-02-16 16:39:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-16 16:39:23 +0100 |
commit | 33c7f52f361961c64432cfd772909ed3ba76cd51 (patch) | |
tree | 6c86397c3797381550815c79938522a3915d58df /editor/plugins/gradient_editor_plugin.cpp | |
parent | b5c0a892d45b1a9df10aaf0f468252925ea2a4b9 (diff) | |
parent | 8824b6c5e9dc6a24a17452ded0c800ec267f812f (diff) |
Merge pull request #58169 from megalobyte/update-notificatin-if-to-switch-batch-B
Diffstat (limited to 'editor/plugins/gradient_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/gradient_editor_plugin.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/editor/plugins/gradient_editor_plugin.cpp b/editor/plugins/gradient_editor_plugin.cpp index 3f5b687430..e9d7808684 100644 --- a/editor/plugins/gradient_editor_plugin.cpp +++ b/editor/plugins/gradient_editor_plugin.cpp @@ -91,13 +91,15 @@ GradientEditor::GradientEditor() { /////////////////////// void GradientReverseButton::_notification(int p_what) { - if (p_what == NOTIFICATION_DRAW) { - Ref<Texture2D> icon = get_theme_icon(SNAME("ReverseGradient"), SNAME("EditorIcons")); - if (is_pressed()) { - draw_texture_rect(icon, Rect2(margin, margin, icon->get_width(), icon->get_height()), false, get_theme_color(SNAME("icon_pressed_color"), SNAME("Button"))); - } else { - draw_texture_rect(icon, Rect2(margin, margin, icon->get_width(), icon->get_height())); - } + switch (p_what) { + case NOTIFICATION_DRAW: { + Ref<Texture2D> icon = get_theme_icon(SNAME("ReverseGradient"), SNAME("EditorIcons")); + if (is_pressed()) { + draw_texture_rect(icon, Rect2(margin, margin, icon->get_width(), icon->get_height()), false, get_theme_color(SNAME("icon_pressed_color"), SNAME("Button"))); + } else { + draw_texture_rect(icon, Rect2(margin, margin, icon->get_width(), icon->get_height())); + } + } break; } } |