Skip to content

Commit

Permalink
Update the pause button's icon and tooltip when paused.
Browse files Browse the repository at this point in the history
  • Loading branch information
WhalesState committed Apr 10, 2024
1 parent a8592fe commit 5ca4223
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 9 additions & 3 deletions editor/debugger/editor_debugger_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,11 @@ void EditorDebuggerNode::_debugger_stopped(int p_id) {
}
});
if (!found) {
EditorRunBar::get_singleton()->get_pause_button()->set_pressed(false);
EditorRunBar::get_singleton()->get_pause_button()->set_disabled(true);
Button *pause_btn = EditorRunBar::get_singleton()->get_pause_button();
pause_btn->set_pressed(false);
pause_btn->set_icon(get_editor_theme_icon(SNAME("Pause")));
pause_btn->set_tooltip_text(TTR("Pause the running project's execution for debugging."));
pause_btn->set_disabled(true);
SceneTreeDock::get_singleton()->hide_remote_tree();
SceneTreeDock::get_singleton()->hide_tab_buttons();
EditorNode::get_singleton()->notify_all_debug_sessions_exited();
Expand Down Expand Up @@ -563,7 +566,10 @@ void EditorDebuggerNode::_breaked(bool p_breaked, bool p_can_debug, String p_mes
tabs->set_current_tab(p_debugger);
}
_break_state_changed();
EditorRunBar::get_singleton()->get_pause_button()->set_pressed(p_breaked);
Button *pause_btn = EditorRunBar::get_singleton()->get_pause_button();
pause_btn->set_pressed(p_breaked);
pause_btn->set_icon(p_breaked ? get_editor_theme_icon(SNAME("PlayStart")) : get_editor_theme_icon(SNAME("Pause")));
pause_btn->set_tooltip_text(p_breaked ? TTR("Resume the running project's execution.") : TTR("Pause the running project's execution for debugging."));
emit_signal(SNAME("breaked"), p_breaked, p_can_debug);
}

Expand Down
3 changes: 3 additions & 0 deletions editor/translations/editor/ar.po
Original file line number Diff line number Diff line change
Expand Up @@ -5266,6 +5266,9 @@ msgstr "شغِّلْ المشروع"
msgid "Pause the running project's execution for debugging."
msgstr "‌أوقِفْ قليلا \"تنفيذَ\" المشروع الحالي؛ للتنقيح."

msgid "Resume the running project's execution."
msgstr ""

msgid "Pause Running Project"
msgstr "أوقِفْ المشروع قليلا"

Expand Down

0 comments on commit 5ca4223

Please sign in to comment.