audit popover and dialog
This commit is contained in:
@@ -189,6 +189,13 @@ pub struct Elevation {
|
||||
}
|
||||
|
||||
impl Elevation {
|
||||
/// No shadow: dark floating layers separate by border.
|
||||
fn none() -> Self {
|
||||
Self {
|
||||
layers: [Shadow::none(), Shadow::none()],
|
||||
}
|
||||
}
|
||||
|
||||
fn single(key: Shadow) -> Self {
|
||||
Self {
|
||||
layers: [key, Shadow::none()],
|
||||
@@ -232,8 +239,8 @@ impl Elevations {
|
||||
pub(crate) fn for_platform(source: SourceKind, variant: ThemeVariant) -> Self {
|
||||
if variant == ThemeVariant::Dark {
|
||||
return Self {
|
||||
popover: Elevation::single(Shadow::black(0., 4., 24., 0.3)),
|
||||
dialog: Elevation::single(Shadow::black(0., 8., 40., 0.35)),
|
||||
popover: Elevation::none(),
|
||||
dialog: Elevation::none(),
|
||||
control: Elevation::single(Shadow::black(0., 1., 2., 0.25)),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -545,6 +545,8 @@ mod tests {
|
||||
resolved.borders.overlays,
|
||||
"{source:?} frames floating layers in dark"
|
||||
);
|
||||
assert!(resolved.elevations.popover.shadows().is_empty());
|
||||
assert!(resolved.elevations.dialog.shadows().is_empty());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -578,7 +580,7 @@ mod tests {
|
||||
#[test]
|
||||
fn elevations_and_motion_resolve_with_defaults() {
|
||||
let resolved = resolve(
|
||||
&system(ThemeVariant::Dark, PartialPalette::default(), None),
|
||||
&system(ThemeVariant::Light, PartialPalette::default(), None),
|
||||
None,
|
||||
None,
|
||||
);
|
||||
@@ -590,7 +592,7 @@ mod tests {
|
||||
);
|
||||
assert!(resolved.motion.overlay > std::time::Duration::ZERO);
|
||||
let shadows = resolved.elevations.popover.shadows();
|
||||
assert_eq!(shadows.len(), 1);
|
||||
assert_eq!(shadows.len(), 2);
|
||||
assert!(!shadows[0].inset);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user