Refactor layout pipeline, add KEY5 regression, and fix tooltip hide

This commit is contained in:
Codex
2026-04-10 23:26:25 +08:00
parent 241a564095
commit b7ad960518
13 changed files with 719 additions and 290 deletions
+22 -1
View File
@@ -355,17 +355,38 @@ void Table::setWidth(int width)
void Table::setHeight(int height)
{
//高度不变
// 当前阶段 Table 明确不支持纵向 Stretch。
// 高度链路依赖表头、表体、页脚、按钮和页码计算,
// 因此这里保持空实现,避免被通用布局层错误拉高/压缩。
}
Table::Table(int x, int y)
:Control(x, y, 0, 0)
{
this->id = "Table";
// Table 当前正式能力边界:
// 仅允许 X 轴 StretchY 轴固定尺寸。
this->layoutCapability.allowStretchY = false;
}
Table::~Table() = default;
void Table::applyResolvedLayoutRect(const StellarX::ResolvedLayoutRect& rect)
{
// Table 不能像普通控件那样直接写入 width/height
// 它的 setWidth() 内部会联动列宽与页脚布局,因此这里必须复用原有 setter 副作用。
// 同时由于 setHeight() 为空实现,Y 轴会自然保持固定尺寸。
if (this->x != rect.worldX)
setX(rect.worldX);
if (this->y != rect.worldY)
setY(rect.worldY);
if (this->width != rect.width)
setWidth(rect.width);
if (this->height != rect.height)
setHeight(rect.height);
dirty = true;
}
void Table::draw()
{
//在这里先初始化保证翻页按钮不为空