feat(settings): M299 选中项收口到 selected_fill + 分组导航改真按钮 + tabs 用 status
- pages/settings/frame.rs:分组导航从 mouse_area 换成 button(四态可辨), 几何不变(ShapeScale::Full 胶囊),颜色走唯一的 selected_fill;forced 从 settings::view 递下来,于是 --force-state 能拍到这一处 - language / theme / appearance choice 三处「选中档位」补状态层 - components/selection/paint/chip.rs:选中分支用上 state 参数 - shell/nav.rs / shell/nav/account.rs:两处私有拷贝收口到 selected_fill(几何没动) - components/navigation/tabs.rs:状态层在样式闭包里跟 button::Status 求值 - 新增门禁 selection/tests/single_entry.rs:11 个站点必须调 selected_fill + 产品代码里不许再出现 or_else(|| Some(ui.color( 这个私有拷贝形态 - 行数:frame.rs / nav.rs / appearance::section 的单测按「纯搬移」拆出去
This commit is contained in:
1 parent
9b6e92c7b4
commit
0d917e88da
16 files changed
+1072
-355
No files matched your search
@@ -4,7 +4,7 @@ use unlucky_design::color::Role;
|
||||
|
||||
use crate::theme::{Ui, STROKE_PX};
|
||||
|
||||
use super::super::super::interaction::{Base, Interaction};
|
||||
use super::super::super::interaction::{self, Base, Interaction};
|
||||
use super::{disabled_container, disabled_ink, state_layer, ChipPaint, Frame};
|
||||
|
||||
/// Chip 的三种(§13.6 / §13.7):Assist / Filter / Input。
|
||||
@@ -55,7 +55,14 @@ pub fn chip(
|
||||
|
||||
let outline = (!selected).then(|| ui.color(Role::OutlineVariant));
|
||||
let fill = if selected {
|
||||
Some(ui.color(Role::SecondaryContainer))
|
||||
// 选中的 chip 也一样吃状态层(M299):M3 的 chip 状态层就是容器自己,
|
||||
// 选中后底是实色 `SecondaryContainer`,hover / pressed 叠在它上面。
|
||||
Some(interaction::selected_fill(
|
||||
ui,
|
||||
state,
|
||||
Role::OnSecondaryContainer,
|
||||
Role::SecondaryContainer,
|
||||
))
|
||||
} else {
|
||||
state_layer(ui, base, state, label_role)
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user