已落地:
- components/{mod,interaction,layout,divider,gate}.rs + buttons/{mod,geometry,assemble,tests}.rs
- gallery/{mod,buttons,probe,scan}.rs + 四个家族桩(selection/inputs/feedback/navigation)
- cli.rs: --screen=shell|gallery + capture_flavor(截图默认 Light,删掉等系统主题的闸门)
- app.rs: gallery 路由 + DemoMessage 接线(400 行)
待办(下一个 commit):编译/测试全绿、浅深矩阵出图、1:1 并排与数值表。
36 lines
1.5 KiB
Rust
36 lines
1.5 KiB
Rust
//! **输入类家族(桩)**:由后续 mission 填充(§9 TextField / §20 Search / §11 Slider / §8 Menu)。
|
||
//!
|
||
//! 本文件目前只有占位 `demo()`。**后续 mission 只写本目录内的文件,不改 `components/mod.rs`**:
|
||
//! 家族模块已经在 `mod.rs` 里声明好,`gallery/inputs.rs` 也已经在 `gallery/mod.rs` 里声明好,
|
||
//! 所以「加组件」不需要碰任何共享文件(D39 §1 的并行地基)。
|
||
//!
|
||
//! 填充时请照抄按钮家族的分层:
|
||
//!
|
||
//! - 几何进 `inputs/geometry.rs`(数值从 `ComponentMetrics::SEARCH_BAR` / `Space` / `ShapeScale` 取,
|
||
//! 缺令牌登记 G 编号);
|
||
//! - 状态层只能走 [`crate::app::components::interaction`](α 一处定义);
|
||
//! - 精确尺寸用 [`crate::app::components::layout`](Q8/Q9 的解法),别手写 `.width(x)`;
|
||
//! - 受控组件签名收 `impl Fn(String) -> M`(契约 §2),组件内不持有 `String`。
|
||
|
||
use iced::widget::{container, text};
|
||
use iced::Element;
|
||
|
||
use unlucky_design::color::Role;
|
||
use unlucky_design::spacing::Space;
|
||
use unlucky_design::typography::TypeRole;
|
||
|
||
use crate::theme::Ui;
|
||
|
||
/// 占位 demo(ASCII 文案,理由同 `selection::demo`)。
|
||
pub fn demo<'a, M: 'a>(ui: &'a Ui) -> Element<'a, M> {
|
||
let style = ui.style(TypeRole::BodySmall);
|
||
container(
|
||
text("inputs · text field / search / slider / menu — pending")
|
||
.size(style.size_px)
|
||
.font(ui.font_of(style))
|
||
.color(ui.color(Role::OnSurfaceVariant)),
|
||
)
|
||
.padding(ui.space(Space::X2))
|
||
.into()
|
||
}
|