fix(app-iced): M75 r3 —— 禁用内容角色按 A1 改 OnSurfaceVariant + 两项语汇 + probe 双色护栏

A1 定案(本机 gradle 缓存 material3.aar + javap):
  FilledButtonTokens.<clinit>: DisabledContainerColor=OnSurface, DisabledContainerOpacity=0.1f
    DisabledIconColor/DisabledLabelTextColor=OnSurfaceVariant, 两者 Opacity=0.38f
  OutlinedButtonTokens/TextButtonTokens: LabelTextColor=OnSurfaceVariant(12b §1.9 原本就对)

据此:
- interaction::disabled_content_over / disabled_colors 的内容角色从 OnSurface 改成
  OnSurfaceVariant(α 仍取令牌 DISABLED_CONTENT_ALPHA=0.38);设计层 color::state::disabled_content()
  用的是 OnSurface,与 A1 不符 —— 令牌线修好前这里按 A1 直接求值,已登记。
- content_color 的「底」按有无容器分开:有容器叠 12% 容器、无容器叠 surface(视觉 r2 P2-1)。
- probe 加第二条护栏:无容器三式的 38% 墨迹单独计数,避免只护住有容器那四式(code r2 p2-1)。
- gallery 样例图标改描边(Download + ChevronRight),并加单测钉「同控件不混用 Fill/Stroke」(P2-3)。
- 滚动条:透明轨 + OutlineVariant thumb(P2-4;宽度 10px 是 iced 内部常量,只能改颜色)。
- probe 文档修好被 //! 打断的命令、shot_path 注释归位、去掉空转的重复断言(P2-5)。
This commit is contained in:
AskaEth committed 2026-11-02 04:50:54 +08:00
1 parent d075feb77d
commit 5fd1f3ca26
7 files changed
+118 -22

No files matched your search

+23 -1
View File
@@ -41,6 +41,7 @@ use iced::{Alignment, Background, Element, Length};
use unlucky_design::color::Role;
use unlucky_design::elevation::MaterialLayer;
use unlucky_design::shape::ShapeScale;
use unlucky_design::spacing::Space;
use unlucky_design::typography::TypeRole;
@@ -110,9 +111,30 @@ pub fn view<'a>(ui: &'a Ui) -> Element<'a, DemoMessage> {
.spacing(ui.space(Space::X8))
.width(Length::Fill);
// 滚动条:默认是主题给的 10px 深灰 thumb(`#6A7985`),压过组件本体(视觉 reviewer P2-4)。
// 这里把它改成 **透明轨 + OutlineVariant thumb**;宽度 10px 是 `scrollable` 的内部常量
// (该控件不暴露 Scrollbar 配置),所以只做了「低对比」这一半,已登记为偏离 D7。
let body = scrollable(sections)
.height(Length::Fill)
.width(Length::Fill);
.width(Length::Fill)
.style(move |theme, status| {
// `scrollable::Style` 没有 `Default`:底色/间隙从主题默认值出发,只覆盖竖轨
let base = scrollable::default(theme, status);
scrollable::Style {
vertical_rail: scrollable::Rail {
background: None,
border: iced::Border::default(),
scroller: scrollable::Scroller {
background: Background::Color(ui.color(Role::OutlineVariant)),
border: iced::Border {
radius: ui.radius(ShapeScale::Full, ui.space(Space::X2)),
..iced::Border::default()
},
},
},
..base
}
});
// 页面留白走 `layout::inset`(左右/上下各 24):这是 Q8/Q9 那两个 helper 的第三个兄弟,
// 存在意义是「只改内边距、不改尺寸」,也顺手避免把 Padding 的上右下左写反。