fix(selection): Checkbox / Radio 命中区恒 48×48(复审 P2-2)
- 无标签时行宽只有状态层的 40dp(A1 的 minimumInteractiveComponentSize 是 48) - ControlGeometry::hit_padding() = (48−40)/2 = 4,view 侧左右各留这段透明内边距 - 单测钉住 40 + 2×4 == 48(checkbox 与 radio 各一遍)
This commit is contained in:
1 parent
c5765c57e7
commit
0c9d4049b3
3 files changed
+28
-5
No files matched your search
@@ -15,7 +15,7 @@
|
||||
//! 内点:独立 10×10 圆容器居中在环里(绘制半径 12/2 − 2/2 = 5,即**直径 10**,§19.2)。
|
||||
|
||||
use iced::widget::{container, row, text};
|
||||
use iced::{Alignment, Element, Length};
|
||||
use iced::{Alignment, Element, Length, Padding};
|
||||
|
||||
use unlucky_design::typography::TypeRole;
|
||||
|
||||
@@ -134,9 +134,16 @@ pub fn radio<'a, M: Clone + 'a>(ui: &'a Ui, spec: Radio<'a, M>) -> Element<'a, M
|
||||
);
|
||||
}
|
||||
|
||||
// 命中区 48×48:左右各留 `hit_padding` 透明内边距(无标签时行宽才不是 40;复审 P2-2)
|
||||
let pad = geometry.hit_padding();
|
||||
let body = container(content)
|
||||
.height(Length::Fill)
|
||||
.align_y(Alignment::Center);
|
||||
.align_y(Alignment::Center)
|
||||
.padding(Padding {
|
||||
left: pad,
|
||||
right: pad,
|
||||
..Padding::default()
|
||||
});
|
||||
|
||||
shell::shell(
|
||||
&source,
|
||||
|
||||
Reference in new issue
Block a user