// // AssetItemView:资产条目的绘制单元(列表行 / 网格瓦片 / 目录 / 拖拽源 / // tooltip)。Content Browser 与材质纹理选择器共用同一套视觉与交互。 // #ifndef HELLOVULKAN_ASSETITEMVIEW_H #define HELLOVULKAN_ASSETITEMVIEW_H #include "EditorContext.h" #include #include namespace EditorAssetView { // 单击 / 双击结果(调用方决定选中与打开语义) struct ItemResult { bool clicked = false; bool doubleClicked = false; }; // 拖拽源:按资产类别发出对应 payload(材质/控制器/预制体/模型/纹理) void DrawDragSource(const std::filesystem::path& path, const std::string& name); // 统一 tooltip(类型/大小/修改时间/加载状态) void DrawTooltip(const EditorContext& ctx, const std::filesystem::path& path); // 列表行:内联小缩略图 + 彩色短标签 + 类别色名称 ItemResult DrawRow(const EditorContext& ctx, const std::filesystem::path& path, bool selected); // 网格瓦片:缩略图/类别色占位块 + 名称(截断到瓦片宽) ItemResult DrawTile(const EditorContext& ctx, const std::filesystem::path& path, float tileSize, bool selected); // 目录(文件夹色):返回是否被点击(选中/进入) bool DrawFolderRow(const std::filesystem::path& dir); bool DrawFolderTile(const std::filesystem::path& dir, float tileSize, bool selected); } // namespace EditorAssetView #endif //HELLOVULKAN_ASSETITEMVIEW_H