fix(app-iced): M75 复审 P1-A/P1-B/P2 —— 内容色跟态走 + 断言收紧 + 矩阵排版
P1-A 禁用内容色没下发(视觉 reviewer:text/standard 的 enabled 与 disabled 逐像素相同): assemble 里内容色恒取 ui.color(content) 再被 text().color() 钉死,Style.text_color 的 38% 永远下发不出去。新增 assemble::content_color(ui, forced, content),文字按钮与 IconButton 共用;probe 补两条像素断言(禁用 38% 墨迹必须存在、禁用容器内不得有满档 OnPrimary)。 P1-B 渲染层断言抓不住 2px 级回归(reviewer 变异验证:高度 42 仍绿): 高度改成精确 == 40;补「带图标左内边距 16(墨迹 ≈21)」断言;分隔线从「行数」改成 「墨量覆盖率 ≈1.0」(1.5dp 会到 ≈1.5)。 P2-1 probe 给了图却读不到时硬失败(只有完全没给 ULL_GALLERY_SHOT 才跳过)。 P2-2 Geometry::stroke 真正接到 Border.width;IconGeometry::icon 改由 side−2×padding 推导。 P2-3 矩阵 cell 宽 192→160(总宽 1040<1180,disabled 列不再被裁);禁用格保留前后图标。 P2-4 补注:snap 仅 wgpu 实现,CPU 验收图不受它影响。
This commit is contained in:
1 parent
8072f1cc7e
commit
e905fa3922
8 files changed
+195
-68
No files matched your search
@@ -131,21 +131,20 @@ fn text_button<'a>(ui: &'a Ui, variant: Variant, state: Interaction) -> Element<
|
||||
Variant::Text => "Text",
|
||||
};
|
||||
|
||||
let lead = if variant == Variant::Text {
|
||||
Button::new(label, DemoMessage::Pressed("text"))
|
||||
} else {
|
||||
Button::new(label, DemoMessage::Pressed(label))
|
||||
.leading(IconKind::Play)
|
||||
.trailing(IconKind::ChevronRight)
|
||||
};
|
||||
|
||||
// 禁用格必须真的没有消息(语义正确),再强制成 Disabled 的画法
|
||||
let spec = if state.is_disabled() {
|
||||
// 五态共用**同一套**装配,只有「有没有消息」随禁用变:
|
||||
// 早先禁用格单独走 `Button::disabled(label)`,把前后图标一起丢了,于是 disabled 列看起来
|
||||
// 像另一个组件(视觉 reviewer P2-3)。
|
||||
let mut spec = if state.is_disabled() {
|
||||
Button::disabled(label)
|
||||
} else {
|
||||
lead
|
||||
Button::new(label, DemoMessage::Pressed(label))
|
||||
}
|
||||
.state(state);
|
||||
if variant != Variant::Text {
|
||||
spec = spec
|
||||
.leading(IconKind::Play)
|
||||
.trailing(IconKind::ChevronRight);
|
||||
}
|
||||
|
||||
match variant {
|
||||
Variant::Filled => buttons::filled(ui, spec),
|
||||
|
||||
Reference in new issue
Block a user