Skip to content

Commit 37ea017

Browse files
committed
Merge pull request godotengine#93743 from poga/93690-fix-quickopen-icon-max-width
Set max width for icons in the quick open popup
2 parents 84f4042 + 77c3313 commit 37ea017

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

editor/editor_quick_open.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
#include "core/os/keyboard.h"
3434
#include "editor/editor_node.h"
35+
#include "editor/editor_string_names.h"
3536
#include "editor/themes/editor_scale.h"
3637

3738
Rect2i EditorQuickOpen::prev_rect = Rect2i();
@@ -119,10 +120,12 @@ void EditorQuickOpen::_update_search() {
119120
sorter.sort(entries.ptrw(), entries.size());
120121
}
121122

123+
const int class_icon_size = search_options->get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor));
122124
const int entry_limit = MIN(entries.size(), 300);
123125
for (int i = 0; i < entry_limit; i++) {
124126
TreeItem *ti = search_options->create_item(root);
125127
ti->set_text(0, entries[i].path);
128+
ti->set_icon_max_width(0, class_icon_size);
126129
ti->set_icon(0, *icons.lookup_ptr(entries[i].path.get_extension()));
127130
}
128131

0 commit comments

Comments
 (0)