mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-24 11:31:28 +01:00
Quiet check box: white mark, small corners
This commit is contained in:
2 files changed
+3
-3
No files matched your search
@@ -65,7 +65,7 @@ impl Component for Checkbox<'_> {
|
||||
return CheckboxStyle {
|
||||
metrics: Metrics::new().min_size(Vec2::new(0.0, control.icon * QUIET_SIDE)),
|
||||
focus: cx.focus_look(),
|
||||
well: super::quiet_indicator(cx, cx.surface(SurfaceKind::Well).radius),
|
||||
well: super::quiet_indicator(cx, egui::CornerRadius::same(2)),
|
||||
mark: super::quiet_mark(cx),
|
||||
side: control.icon * QUIET_SIDE,
|
||||
};
|
||||
|
||||
@@ -44,9 +44,9 @@ fn quiet_indicator(cx: &crate::style::StyleCx<'_>, radius: egui::CornerRadius) -
|
||||
SurfaceLook::new(fill).kind(SurfaceKind::Sunken).radius(radius).border(Stateful::new(edge), cx.tokens.stroke.thin)
|
||||
}
|
||||
|
||||
/// The mark of a quiet check box: the ink that reads on an accent, in both states.
|
||||
/// The mark of a quiet check box: white in both states: the well under it is the scrim, dark in every theme.
|
||||
fn quiet_mark(cx: &crate::style::StyleCx<'_>) -> craft_theme::Stateful<crate::style::StyleColor> {
|
||||
craft_theme::Stateful::new(cx.color(cx.tokens.color.text.on_accent))
|
||||
craft_theme::Stateful::new(cx.color(craft_theme::Rgba::WHITE))
|
||||
}
|
||||
|
||||
/// The fill of a check box, radio button or switch track while off: the sunken well, the state layer's press fill while
|
||||
|
||||
Reference in new issue
Block a user