You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Port existing _notification code to use switch statements (part 1/3)
This commit is contained in:
committed by
Jean-Michel Bernard
parent
f5b9cbaff6
commit
dcd2a92af3
@@ -423,13 +423,17 @@ void EditorVisualProfiler::_clear_pressed() {
|
||||
}
|
||||
|
||||
void EditorVisualProfiler::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_LAYOUT_DIRECTION_CHANGED || p_what == NOTIFICATION_TRANSLATION_CHANGED) {
|
||||
if (is_layout_rtl()) {
|
||||
activate->set_icon(get_theme_icon(SNAME("PlayBackwards"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
activate->set_icon(get_theme_icon(SNAME("Play"), SNAME("EditorIcons")));
|
||||
}
|
||||
clear_button->set_icon(get_theme_icon(SNAME("Clear"), SNAME("EditorIcons")));
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
|
||||
case NOTIFICATION_TRANSLATION_CHANGED: {
|
||||
if (is_layout_rtl()) {
|
||||
activate->set_icon(get_theme_icon(SNAME("PlayBackwards"), SNAME("EditorIcons")));
|
||||
} else {
|
||||
activate->set_icon(get_theme_icon(SNAME("Play"), SNAME("EditorIcons")));
|
||||
}
|
||||
clear_button->set_icon(get_theme_icon(SNAME("Clear"), SNAME("EditorIcons")));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user