Fix centered layout for demo header

This commit is contained in:
fanlusky committed 2026-06-16 18:24:25 +08:00
1 parent 326d4a2497
commit 52b9108428
2 files changed
+7 -8

No files matched your search

+1
View File
@@ -70,6 +70,7 @@
- 移除了 demo 中 `Accordion` 示例的固定高度,避免多项同时展开后内容文本被裁切和溢出
- 微调了多行 `TextBox` 的水平文字内边距,让大尺寸编辑区中的光标和首行文本不会显得过于贴近左边框
- 将 demo 顶部的 `msimeui` 标题和副标题改为居中展示,并把标题上方留白收窄到原来的一半
- 修正了 demo 顶部标题区的居中方式:改为通过独立 header 容器居中内容,确保 `msimeui` 标题和描述文本在页面顶部真正水平居中
## 构建
+6 -8
View File
@@ -10,15 +10,13 @@ std::unique_ptr<Scene> CreateDemoScene()
{
auto root = std::make_shared<StackPanel>(0.0f);
root->AddChild(std::make_shared<Spacer>(14.0f));
auto appTitle = std::make_shared<TextBlock>(L"msimeui", 34.0f, D2D1::ColorF(0x111827), true);
appTitle->SetHorizontalAlignment(HorizontalAlignment::Center);
root->AddChild(appTitle);
root->AddChild(std::make_shared<Spacer>(12.0f));
auto appSubtitle =
auto appHeader = std::make_shared<StackPanel>(12.0f);
appHeader->SetHorizontalContentAlignment(HorizontalAlignment::Center);
appHeader->AddChild(std::make_shared<TextBlock>(L"msimeui", 34.0f, D2D1::ColorF(0x111827), true));
appHeader->AddChild(
std::make_shared<TextBlock>(L"A retained-mode Win32 GUI framework with Direct2D / DirectWrite and in-tree TSF.",
16.0f, D2D1::ColorF(0x5B6472));
appSubtitle->SetHorizontalAlignment(HorizontalAlignment::Center);
root->AddChild(appSubtitle);
16.0f, D2D1::ColorF(0x5B6472)));
root->AddChild(appHeader);
root->AddChild(std::make_shared<Spacer>(36.0f));
Brush surface;