docs(ui): M299 补三处与行为对齐的文档(chip 选中支、tabs 状态层、分组导航的半径实测)

只改注释,零行为变化:cargo test -p unlucky-app-iced --all-targets 全绿(1040 + 6)。
This commit is contained in:
AskaEth committed 2026-11-13 14:56:20 +08:00
1 parent 0d917e88da
commit 8144714f30
3 files changed
+16 -3

No files matched your search

@@ -215,6 +215,11 @@ fn secondary_line_color(ui: &Ui) -> Color {
} }
/// 一行标签页(自带横向滚动)。 /// 一行标签页(自带横向滚动)。
/// ## 状态层画在哪儿(M299)
///
/// tab 容器**没有**选中实底(选中的标记是下方那条指示条),所以选中与未选中都一样:状态层叠在
/// `base` 上(`Tabs::base(..)`,默认画布)。M299 之前这一层是在样式闭包**外**算的,真实
/// hover / pressed 一个像素都不变;现在由 [`tab_fill`] 在闭包里跟 `button::Status` 求值。
pub fn tabs<'a, M: Clone + 'a>(ui: &'a Ui, tabs: Tabs<'a, M>) -> Element<'a, M> { pub fn tabs<'a, M: Clone + 'a>(ui: &'a Ui, tabs: Tabs<'a, M>) -> Element<'a, M> {
let geometry = TabsGeometry::of(ui); let geometry = TabsGeometry::of(ui);
let primary = tabs.variant.is_primary(); let primary = tabs.variant.is_primary();
@@ -22,6 +22,10 @@ pub enum ChipVariant {
/// ///
/// 与 Checkbox/Radio 的区别:Chip 的**状态层就是它自己的容器**(M3 的 chip 没有圆形状态层), /// 与 Checkbox/Radio 的区别:Chip 的**状态层就是它自己的容器**(M3 的 chip 没有圆形状态层),
/// 所以未选中 + hover 的 fill 是「状态层叠在 surface 上」的实色。 /// 所以未选中 + hover 的 fill 是「状态层叠在 surface 上」的实色。
///
/// **选中也一样吃状态层**(M299):底是实色 `SecondaryContainer`,hover / pressed 叠在它上面
/// ——走 [`interaction::selected_fill`] 那个唯一入口。M299 之前这一支写死实色,`state` 参数
/// 在选中分支里根本没用上(gallery 的 `chip·filter·on` 一行三态逐像素相同)。
pub fn chip( pub fn chip(
ui: &Ui, ui: &Ui,
base: Base, base: Base,
+7 -3
View File
@@ -104,9 +104,13 @@ pub(super) fn group_nav<'a>(
/// ///
/// ## 几何没动(M283 定稿的那套形状语汇) /// ## 几何没动(M283 定稿的那套形状语汇)
/// ///
/// 高 = `LM.row_height`、圆角 = [`ShapeScale::Full`](实量半径 = 高/2,就是胶囊),宽 = 列宽, /// 高 = `LM.row_height`、圆角 = [`ShapeScale::Full`]、宽 = 列宽,内边距 `Space::X3`。**胶囊是量出来
/// 内边距 `Space::X3`。本 mission 只换**颜色入口**:选中支走 [`interaction::selected_fill`], /// 的,不是猜的**:从取证图 `DevDocs/artifacts/m299/new/settings-general-light-hover.png` 量到的
/// 未选中支走 [`interaction::layer_color`](叠在侧列自己的卡底 `frame::BASE` 上)。 /// 选中项底色 bbox 是 y240-283(高 **44**)、x120-343,且顶边下 1px 处的横向内缩是 **15px**
/// ——半径 22 的胶囊在这个位置的内缩是 r−√(r²−(r−1)²)=15.4,半径 8 的圆角只有 4.1。所以
/// **半径 = 高/2 = 22,已经是胶囊**,本 mission 只换颜色入口:选中支走
/// [`interaction::selected_fill`],未选中支走 [`interaction::layer_color`](叠在侧列自己的卡底
/// `frame::BASE` 上)。
/// ///
/// ## 内容色为什么还是静态的 /// ## 内容色为什么还是静态的
/// ///