Skip to content

Commit

Permalink
Limit icon size in EditorDebuggerTree.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daylily-Zeleen committed May 25, 2024
1 parent b7feebe commit b941459
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
8 changes: 7 additions & 1 deletion editor/debugger/editor_debugger_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,18 @@ void EditorDebuggerNode::stop(bool p_force) {
void EditorDebuggerNode::_notification(int p_what) {
switch (p_what) {
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
if (tabs->get_tab_count() > 1 && EditorThemeManager::is_generated_theme_outdated()) {
if (!EditorThemeManager::is_generated_theme_outdated()) {
return;
}

if (tabs->get_tab_count() > 1) {
add_theme_constant_override("margin_left", -EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("BottomPanelDebuggerOverride"), EditorStringName(EditorStyles))->get_margin(SIDE_LEFT));
add_theme_constant_override("margin_right", -EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("BottomPanelDebuggerOverride"), EditorStringName(EditorStyles))->get_margin(SIDE_RIGHT));

tabs->add_theme_style_override("panel", EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("DebuggerPanel"), EditorStringName(EditorStyles)));
}

remote_scene_tree->update_icon_max_width();
} break;

case NOTIFICATION_READY: {
Expand Down
9 changes: 9 additions & 0 deletions editor/debugger/editor_debugger_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "editor_debugger_tree.h"

#include "editor/editor_node.h"
#include "editor/editor_string_names.h"
#include "editor/gui/editor_file_dialog.h"
#include "editor/scene_tree_dock.h"
#include "scene/debugger/scene_debugger.h"
Expand Down Expand Up @@ -62,6 +63,10 @@ void EditorDebuggerTree::_notification(int p_what) {
connect("item_collapsed", callable_mp(this, &EditorDebuggerTree::_scene_tree_folded));
connect("item_mouse_selected", callable_mp(this, &EditorDebuggerTree::_scene_tree_rmb_selected));
} break;

case NOTIFICATION_ENTER_TREE: {
update_icon_max_width();
} break;
}
}

Expand Down Expand Up @@ -293,6 +298,10 @@ Variant EditorDebuggerTree::get_drag_data(const Point2 &p_point) {
return vformat("\"%s\"", path);
}

void EditorDebuggerTree::update_icon_max_width() {
add_theme_constant_override("icon_max_width", get_theme_constant("class_icon_size", EditorStringName(Editor)));
}

String EditorDebuggerTree::get_selected_path() {
if (!get_selected()) {
return "";
Expand Down
1 change: 1 addition & 0 deletions editor/debugger/editor_debugger_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class EditorDebuggerTree : public Tree {

virtual Variant get_drag_data(const Point2 &p_point) override;

void update_icon_max_width();
String get_selected_path();
ObjectID get_selected_object();
int get_current_debugger(); // Would love to have one tree for every debugger.
Expand Down

0 comments on commit b941459

Please sign in to comment.