chore: checkpoint current workspace changes
This commit is contained in:
@@ -37,12 +37,12 @@ void AppendDisclosureArrow(
|
||||
const ::XCEngine::UI::UIRect& rect,
|
||||
bool expanded,
|
||||
const ::XCEngine::UI::UIColor& color) {
|
||||
constexpr float kOpticalCenterYOffset = -0.5f;
|
||||
constexpr float kOpticalCenterYOffset = -1.0f;
|
||||
const float centerX = std::floor(rect.x + rect.width * 0.5f) + 0.5f;
|
||||
const float centerY =
|
||||
std::floor(rect.y + rect.height * 0.5f + kOpticalCenterYOffset) + 0.5f;
|
||||
const float halfExtent = (std::max)(2.5f, std::floor((std::min)(rect.width, rect.height) * 0.24f));
|
||||
const float triangleHeight = halfExtent * 1.55f;
|
||||
const float halfExtent = (std::max)(3.0f, std::floor((std::min)(rect.width, rect.height) * 0.24f));
|
||||
const float triangleHeight = halfExtent * 1.45f;
|
||||
|
||||
::XCEngine::UI::UIPoint points[3] = {};
|
||||
if (expanded) {
|
||||
@@ -185,6 +185,7 @@ UIEditorTreeViewLayout BuildUIEditorTreeViewLayout(
|
||||
layout.visibleItemIndices = CollectUIEditorTreeViewVisibleItemIndices(items, expansionModel);
|
||||
layout.rowRects.reserve(layout.visibleItemIndices.size());
|
||||
layout.disclosureRects.reserve(layout.visibleItemIndices.size());
|
||||
layout.iconRects.reserve(layout.visibleItemIndices.size());
|
||||
layout.labelRects.reserve(layout.visibleItemIndices.size());
|
||||
layout.itemHasChildren.reserve(layout.visibleItemIndices.size());
|
||||
layout.itemExpanded.reserve(layout.visibleItemIndices.size());
|
||||
@@ -211,16 +212,29 @@ UIEditorTreeViewLayout BuildUIEditorTreeViewLayout(
|
||||
rowRect.y + (rowRect.height - metrics.disclosureExtent) * 0.5f,
|
||||
metrics.disclosureExtent,
|
||||
metrics.disclosureExtent);
|
||||
const bool hasLeadingIcon = item.leadingIcon.IsValid();
|
||||
const float iconExtent = ClampNonNegative(metrics.iconExtent);
|
||||
const float contentStartX = disclosureRect.x + metrics.disclosureExtent + metrics.disclosureLabelGap;
|
||||
const ::XCEngine::UI::UIRect iconRect(
|
||||
hasLeadingIcon ? contentStartX : 0.0f,
|
||||
rowRect.y + (rowRect.height - iconExtent) * 0.5f,
|
||||
hasLeadingIcon ? iconExtent : 0.0f,
|
||||
hasLeadingIcon ? iconExtent : 0.0f);
|
||||
const float labelStartX =
|
||||
hasLeadingIcon
|
||||
? iconRect.x + iconRect.width + metrics.iconLabelGap
|
||||
: contentStartX;
|
||||
const ::XCEngine::UI::UIRect labelRect(
|
||||
disclosureRect.x + metrics.disclosureExtent + metrics.disclosureLabelGap,
|
||||
labelStartX,
|
||||
rowRect.y,
|
||||
(rowRect.x + rowRect.width) -
|
||||
(disclosureRect.x + metrics.disclosureExtent + metrics.disclosureLabelGap) -
|
||||
labelStartX -
|
||||
metrics.horizontalPadding,
|
||||
rowRect.height);
|
||||
|
||||
layout.rowRects.push_back(rowRect);
|
||||
layout.disclosureRects.push_back(disclosureRect);
|
||||
layout.iconRects.push_back(iconRect);
|
||||
layout.labelRects.push_back(labelRect);
|
||||
layout.itemHasChildren.push_back(hasChildren);
|
||||
layout.itemExpanded.push_back(expanded);
|
||||
@@ -300,6 +314,9 @@ void AppendUIEditorTreeViewForeground(
|
||||
layout.itemExpanded[visibleOffset],
|
||||
palette.disclosureColor);
|
||||
}
|
||||
if (item.leadingIcon.IsValid()) {
|
||||
drawList.AddImage(layout.iconRects[visibleOffset], item.leadingIcon);
|
||||
}
|
||||
|
||||
drawList.PushClipRect(layout.labelRects[visibleOffset]);
|
||||
drawList.AddText(
|
||||
|
||||
Reference in New Issue
Block a user