Voltray Engine Docs
Loading...
Searching...
No Matches
IconRenderer.h
Go to the documentation of this file.
1#pragma once
2#include "../Core/AssetItem.h"
3#include <imgui.h>
4
10namespace Editor
11{
12 namespace Assets
13 {
19 {
20 public:
31 static void RenderFileIcon(
32 ImDrawList *drawList,
33 ImVec2 center,
34 float size,
35 const std::string &extension,
36 bool isDirectory,
37 bool isParentDir,
38 bool isSelected = false);
39
47 static void RenderSmallIcon(
48 ImDrawList *drawList,
49 ImVec2 center,
50 const std::string &extension,
51 bool isDirectory);
52
59 static ImU32 GetFileTypeColor(const std::string &extension, bool isDirectory);
60
61 private:
65 static void RenderFolderIcon(ImDrawList *drawList, ImVec2 center, float size, bool isSelected);
66
70 static void RenderParentDirIcon(ImDrawList *drawList, ImVec2 center, float size, bool isSelected);
71
75 static void Render3DModelIcon(ImDrawList *drawList, ImVec2 center, float size, bool isSelected);
76
80 static void RenderImageIcon(ImDrawList *drawList, ImVec2 center, float size, bool isSelected);
81
85 static void RenderAudioIcon(ImDrawList *drawList, ImVec2 center, float size, bool isSelected);
86
90 static void RenderTextIcon(ImDrawList *drawList, ImVec2 center, float size, bool isSelected);
91
95 static void RenderCodeIcon(ImDrawList *drawList, ImVec2 center, float size, bool isSelected);
96
100 static void RenderSceneIcon(ImDrawList *drawList, ImVec2 center, float size, bool isSelected);
101
105 static void RenderMaterialIcon(ImDrawList *drawList, ImVec2 center, float size, bool isSelected);
106
110 static void RenderGenericFileIcon(ImDrawList *drawList, ImVec2 center, float size, bool isSelected);
111
112 // Color constants
113 static constexpr ImU32 FOLDER_COLOR = IM_COL32(255, 200, 100, 255);
114 static constexpr ImU32 PARENT_COLOR = IM_COL32(100, 150, 255, 255);
115 static constexpr ImU32 MODEL_COLOR = IM_COL32(150, 150, 255, 255);
116 static constexpr ImU32 IMAGE_COLOR = IM_COL32(100, 255, 150, 255);
117 static constexpr ImU32 AUDIO_COLOR = IM_COL32(255, 150, 100, 255);
118 static constexpr ImU32 TEXT_COLOR = IM_COL32(200, 200, 200, 255);
119 static constexpr ImU32 CODE_COLOR = IM_COL32(100, 255, 100, 255);
120 static constexpr ImU32 SCENE_COLOR = IM_COL32(255, 100, 255, 255);
121 static constexpr ImU32 MATERIAL_COLOR = IM_COL32(150, 100, 200, 255);
122 static constexpr ImU32 GENERIC_COLOR = IM_COL32(180, 180, 180, 255);
123 };
124 }
125}
A panel component responsible for managing and displaying asset resources.
Renders visual icons using Dear ImGui drawing primitives.
Definition IconRenderer.h:19
static void RenderSmallIcon(ImDrawList *drawList, ImVec2 center, const std::string &extension, bool isDirectory)
Render a small icon for list view.
Definition IconRenderer.cpp:67
static void RenderFileIcon(ImDrawList *drawList, ImVec2 center, float size, const std::string &extension, bool isDirectory, bool isParentDir, bool isSelected=false)
Render a file icon at the specified position.
Definition IconRenderer.cpp:9
static ImU32 GetFileTypeColor(const std::string &extension, bool isDirectory)
Get the color scheme for a file type.
Definition IconRenderer.cpp:77
Definition AssetsPanel.cpp:7