Refactor editor rendering contracts

This commit is contained in:
2026-04-28 02:57:49 +08:00
parent 3bc0cfcf08
commit b1ae6c462d
47 changed files with 798 additions and 377 deletions

View File

@@ -1,5 +1,5 @@
#include "ProjectPanel.h"
#include "Assets/BuiltInIcons.h"
#include "Assets/EditorIconService.h"
#include <XCEditor/Collections/UIEditorScrollView.h>
#include <XCEditor/Collections/UIEditorTreeView.h>
#include <XCEditor/Foundation/UIEditorTheme.h>
@@ -71,7 +71,7 @@ float MeasureTextWidth(
const UIEditorTextMeasurer* textMeasurer,
std::string_view text,
float fontSize);
::XCEngine::UI::UITextureHandle ResolveFolderIcon(const BuiltInIcons* icons);
::XCEngine::UI::UITextureHandle ResolveFolderIcon(const EditorIconService* icons);
float ClampNavigationWidth(float value, float totalWidth);
UIRect ComputeFittedTextureRect(
const UIRect& bounds,
@@ -129,7 +129,7 @@ float MeasureTextWidth(
return static_cast<float>(text.size()) * fontSize * 0.56f;
}
::XCEngine::UI::UITextureHandle ResolveFolderIcon(const BuiltInIcons* icons) {
::XCEngine::UI::UITextureHandle ResolveFolderIcon(const EditorIconService* icons) {
return icons != nullptr
? icons->Resolve(BuiltInIconKind::Folder)
: ::XCEngine::UI::UITextureHandle {};
@@ -425,7 +425,7 @@ void ProjectPanel::SetSystemInteractionHost(
m_systemInteractionHost = systemInteractionHost;
}
void ProjectPanel::SetBuiltInIcons(BuiltInIcons* icons) {
void ProjectPanel::SetIconService(EditorIconService* icons) {
m_icons = icons;
RebuildWindowTreeItems();
}