Use SVGTextures for editor and default theme icons.

This commit is contained in:
Pāvels Nadtočajevs
2025-04-15 09:35:38 +03:00
parent 9f5048fb36
commit 24bb0d5c4f
5 changed files with 26 additions and 57 deletions

View File

@@ -44,6 +44,7 @@
#include "scene/resources/style_box_flat.h"
#include "scene/resources/style_box_line.h"
#include "scene/resources/style_box_texture.h"
#include "scene/resources/svg_texture.h"
#include "scene/resources/texture.h"
// Theme configuration.
@@ -1724,7 +1725,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
p_theme->set_constant("port_h_offset", "GraphNode", 1);
p_theme->set_constant("separation", "GraphNode", 1 * EDSCALE);
Ref<ImageTexture> port_icon = p_theme->get_icon(SNAME("GuiGraphNodePort"), EditorStringName(EditorIcons));
Ref<SVGTexture> port_icon = p_theme->get_icon(SNAME("GuiGraphNodePort"), EditorStringName(EditorIcons));
// The true size is 24x24 This is necessary for sharp port icons at high zoom levels in GraphEdit (up to ~200%).
port_icon->set_size_override(Size2(12, 12));
p_theme->set_icon("port", "GraphNode", port_icon);