4040#include " editor/editor_node.h"
4141#include " editor/editor_string_names.h"
4242#include " editor/editor_undo_redo_manager.h"
43- #include " editor/gui/editor_bottom_panel.h"
4443#include " editor/run/editor_run_bar.h"
4544#include " editor/script/script_editor_plugin.h"
45+ #include " editor/settings/editor_command_palette.h"
4646#include " editor/settings/editor_settings.h"
4747#include " editor/themes/editor_theme_manager.h"
4848#include " scene/gui/menu_button.h"
@@ -61,6 +61,17 @@ void _for_all(TabContainer *p_node, const Func &p_func) {
6161EditorDebuggerNode *EditorDebuggerNode::singleton = nullptr ;
6262
6363EditorDebuggerNode::EditorDebuggerNode () {
64+ set_name (TTRC (" Debugger" ));
65+ set_icon_name (" Debug" );
66+ set_dock_shortcut (ED_SHORTCUT_AND_COMMAND (" bottom_panels/toggle_debugger_bottom_panel" , TTRC (" Toggle Debugger Dock" ), KeyModifierMask::ALT | Key::D));
67+ set_default_slot (DockConstants::DOCK_SLOT_BOTTOM);
68+ set_available_layouts (EditorDock::DOCK_LAYOUT_HORIZONTAL);
69+ set_global (false );
70+ set_transient (true );
71+
72+ set_clip_contents (false );
73+ _update_margins ();
74+
6475 if (!singleton) {
6576 singleton = this ;
6677 }
@@ -332,13 +343,6 @@ void EditorDebuggerNode::_notification(int p_what) {
332343 } break ;
333344
334345 case NOTIFICATION_READY: {
335- // TODO: Replace this hack once EditorDebuggerNode is converted to a dock. It should be in the constructor.
336- EditorDock *parent = Object::cast_to<EditorDock>(get_parent ());
337- if (parent) {
338- parent->set_clip_contents (false );
339- _update_margins ();
340- }
341-
342346 _update_debug_options ();
343347 initializing = false ;
344348 } break ;
@@ -440,29 +444,25 @@ void EditorDebuggerNode::_update_errors() {
440444 last_error_count = error_count;
441445 last_warning_count = warning_count;
442446
443- // TODO: Replace this hack once EditorDebuggerNode is converted to a dock.
444- EditorDock *parent = Object::cast_to<EditorDock>(get_parent ());
445- if (!parent) {
446- return ;
447- }
448-
449447 if (error_count == 0 && warning_count == 0 ) {
450- set_name (TTR (" Debugger" ));
451- parent->set_dock_icon (Ref<Texture2D>());
452- parent->set_title_color (Color (0 , 0 , 0 , 0 ));
448+ set_title (" " );
449+ set_dock_icon (Ref<Texture2D>());
450+ set_title_color (Color (0 , 0 , 0 , 0 ));
451+ set_force_show_icon (false );
453452 } else {
454- set_name (TTR (" Debugger" ) + " (" + itos (error_count + warning_count) + " )" );
453+ set_title (TTR (" Debugger" ) + " (" + itos (error_count + warning_count) + " )" );
455454 if (error_count >= 1 && warning_count >= 1 ) {
456- parent-> set_dock_icon (get_editor_theme_icon (SNAME (" ErrorWarning" )));
455+ set_dock_icon (get_editor_theme_icon (SNAME (" ErrorWarning" )));
457456 // Use error color to represent the highest level of severity reported.
458- parent-> set_title_color (get_theme_color (SNAME (" error_color" ), EditorStringName (Editor)));
457+ set_title_color (get_theme_color (SNAME (" error_color" ), EditorStringName (Editor)));
459458 } else if (error_count >= 1 ) {
460- parent-> set_dock_icon (get_editor_theme_icon (SNAME (" Error" )));
461- parent-> set_title_color (get_theme_color (SNAME (" error_color" ), EditorStringName (Editor)));
459+ set_dock_icon (get_editor_theme_icon (SNAME (" Error" )));
460+ set_title_color (get_theme_color (SNAME (" error_color" ), EditorStringName (Editor)));
462461 } else {
463- parent-> set_dock_icon (get_editor_theme_icon (SNAME (" Warning" )));
464- parent-> set_title_color (get_theme_color (SNAME (" warning_color" ), EditorStringName (Editor)));
462+ set_dock_icon (get_editor_theme_icon (SNAME (" Warning" )));
463+ set_title_color (get_theme_color (SNAME (" warning_color" ), EditorStringName (Editor)));
465464 }
465+ set_force_show_icon (true );
466466 }
467467 }
468468}
@@ -564,7 +564,7 @@ void EditorDebuggerNode::_break_state_changed() {
564564 const bool breaked = get_current_debugger ()->is_breaked ();
565565 const bool can_debug = get_current_debugger ()->is_debuggable ();
566566 if (breaked) { // Show debugger.
567- EditorNode::get_bottom_panel ()->make_item_visible (this );
567+ EditorDockManager::get_singleton ()->focus_dock (this );
568568 }
569569
570570 // Update script menu.
0 commit comments