Refactor layout pipeline, add KEY5 regression, and fix tooltip hide
This commit is contained in:
@@ -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 轴 Stretch,Y 轴固定尺寸。
|
||||
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()
|
||||
{
|
||||
//在这里先初始化保证翻页按钮不为空
|
||||
|
||||
Reference in New Issue
Block a user