diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-02-15 18:06:48 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-02-15 18:44:55 +0100 |
commit | 0f5455230c8955be0c6533574bd3d5b6f50792b6 (patch) | |
tree | 2167f70782174feda2541c163d264c62402b50be /scene/gui/line_edit.cpp | |
parent | 171021145d49ffdda9110869d35ee63a946af9f8 (diff) | |
download | redot-engine-0f5455230c8955be0c6533574bd3d5b6f50792b6.tar.gz |
Use `switch` consistently in `_notification` (`scene` folder)
Diffstat (limited to 'scene/gui/line_edit.cpp')
-rw-r--r-- | scene/gui/line_edit.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 0e2cbfea48..883eb1a1ba 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -656,31 +656,37 @@ void LineEdit::_notification(int p_what) { } } break; #endif + case NOTIFICATION_RESIZED: { _fit_to_width(); scroll_offset = 0; set_caret_column(get_caret_column()); } break; + case NOTIFICATION_LAYOUT_DIRECTION_CHANGED: case NOTIFICATION_THEME_CHANGED: { _shape(); update(); } break; + case NOTIFICATION_TRANSLATION_CHANGED: { placeholder_translated = atr(placeholder); _shape(); update(); } break; + case NOTIFICATION_WM_WINDOW_FOCUS_IN: { window_has_focus = true; draw_caret = true; update(); } break; + case NOTIFICATION_WM_WINDOW_FOCUS_OUT: { window_has_focus = false; draw_caret = false; update(); } break; + case NOTIFICATION_DRAW: { if ((!has_focus() && !(menu && menu->has_focus()) && !caret_force_displayed) || !window_has_focus) { draw_caret = false; @@ -923,6 +929,7 @@ void LineEdit::_notification(int p_what) { } } } break; + case NOTIFICATION_FOCUS_ENTER: { if (!caret_force_displayed) { if (caret_blink_enabled) { @@ -942,6 +949,7 @@ void LineEdit::_notification(int p_what) { show_virtual_keyboard(); } break; + case NOTIFICATION_FOCUS_EXIT: { if (caret_blink_enabled && !caret_force_displayed) { caret_blink_timer->stop(); @@ -964,6 +972,7 @@ void LineEdit::_notification(int p_what) { deselect(); } } break; + case MainLoop::NOTIFICATION_OS_IME_UPDATE: { if (has_focus()) { ime_text = DisplayServer::get_singleton()->ime_get_text(); @@ -974,10 +983,12 @@ void LineEdit::_notification(int p_what) { update(); } } break; - case Control::NOTIFICATION_DRAG_BEGIN: { + + case NOTIFICATION_DRAG_BEGIN: { drag_action = true; } break; - case Control::NOTIFICATION_DRAG_END: { + + case NOTIFICATION_DRAG_END: { if (is_drag_successful()) { if (selection.drag_attempt) { selection.drag_attempt = false; |