feat: update editor ui framework and assets

This commit is contained in:
2026-03-28 15:07:19 +08:00
parent 4a12e26860
commit 4717b595c4
45 changed files with 2434 additions and 461 deletions

View File

@@ -9,6 +9,10 @@ namespace XCEngine {
namespace Editor {
namespace UI {
inline PropertyLayoutSpec InspectorPropertyLayout() {
return MakePropertyLayout();
}
template <typename ApplyFn>
inline bool ApplyPropertyChange(
bool changedByWidget,
@@ -35,7 +39,7 @@ inline bool DrawPropertyFloat(
float max = 0.0f,
const char* format = "%.2f"
) {
return DrawFloat(label, value, InspectorPropertyLabelWidth(), dragSpeed, min, max, format);
return DrawFloat(label, value, InspectorPropertyLayout(), dragSpeed, min, max, format);
}
inline bool DrawPropertyInt(
@@ -45,28 +49,28 @@ inline bool DrawPropertyInt(
int min = 0,
int max = 0
) {
return DrawInt(label, value, InspectorPropertyLabelWidth(), step, min, max);
return DrawInt(label, value, InspectorPropertyLayout(), step, min, max);
}
inline bool DrawPropertyBool(
const char* label,
bool& value
) {
return DrawBool(label, value, InspectorPropertyLabelWidth());
return DrawBool(label, value, InspectorPropertyLayout());
}
inline bool DrawPropertyColor3(
const char* label,
float color[3]
) {
return DrawColor3(label, color, InspectorPropertyLabelWidth());
return DrawColor3(label, color, InspectorPropertyLayout());
}
inline bool DrawPropertyColor4(
const char* label,
float color[4]
) {
return DrawColor4(label, color, InspectorPropertyLabelWidth());
return DrawColor4(label, color, InspectorPropertyLayout());
}
inline bool DrawPropertySliderFloat(
@@ -76,7 +80,7 @@ inline bool DrawPropertySliderFloat(
float max,
const char* format = "%.2f"
) {
return DrawSliderFloat(label, value, min, max, InspectorPropertyLabelWidth(), format);
return DrawSliderFloat(label, value, min, max, InspectorPropertyLayout(), format);
}
inline bool DrawPropertySliderInt(
@@ -85,7 +89,7 @@ inline bool DrawPropertySliderInt(
int min,
int max
) {
return DrawSliderInt(label, value, min, max, InspectorPropertyLabelWidth());
return DrawSliderInt(label, value, min, max, InspectorPropertyLayout());
}
inline int DrawPropertyCombo(
@@ -95,7 +99,7 @@ inline int DrawPropertyCombo(
int itemCount,
int heightInItems = -1
) {
return DrawCombo(label, currentItem, items, itemCount, InspectorPropertyLabelWidth(), heightInItems);
return DrawCombo(label, currentItem, items, itemCount, InspectorPropertyLayout(), heightInItems);
}
inline bool DrawPropertyVec2(
@@ -104,7 +108,7 @@ inline bool DrawPropertyVec2(
float resetValue = 0.0f,
float dragSpeed = 0.1f
) {
return DrawVec2(label, values, resetValue, InspectorPropertyLabelWidth(), dragSpeed);
return DrawVec2(label, values, resetValue, InspectorPropertyLayout(), dragSpeed);
}
inline bool DrawPropertyVec3(
@@ -114,7 +118,7 @@ inline bool DrawPropertyVec3(
float dragSpeed = 0.1f,
bool* isActive = nullptr
) {
return DrawVec3(label, values, resetValue, InspectorPropertyLabelWidth(), dragSpeed, isActive);
return DrawVec3(label, values, resetValue, InspectorPropertyLayout(), dragSpeed, isActive);
}
inline bool DrawPropertyVec3Input(
@@ -123,7 +127,7 @@ inline bool DrawPropertyVec3Input(
float dragSpeed = 0.1f,
bool* isActive = nullptr
) {
return DrawVec3Input(label, values, InspectorPropertyLabelWidth(), dragSpeed, isActive);
return DrawVec3Input(label, values, InspectorPropertyLayout(), dragSpeed, isActive);
}
}