pub struct GlassScale {
pub chrome: GlassMaterial,
pub bar: GlassMaterial,
pub control: GlassMaterial,
}Expand description
The design-token vocabulary: the Theme bundle plus its
component token tables, flat-re-exported from frust-theme so app code
never names that crate directly. A root component reads the active theme via
use_context::<Theme>(); a widget reads it during paint/layout via
PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
Includes the glass material tokens — this crate ships the opaque recipe, and a design system authors its own translucent one over the same types:
use frust::GlassScale;
let glass = GlassScale::opaque_material();
assert_eq!(glass.chrome.blur_radius_intent, 0.0);
assert!(glass.control.is_opaque());Also the composable-theming surface:
ThemeBuilder (defineTheme/copyWith analog), the no-lock-in typed
extension slot (ThemeExtensions) plus its first consumer
StatusPalette/StatusColors (success/warning/info), and the motion
vocabulary (MotionDurations/EasingSet) — all flat-re-exported so an
app (or a design-system plugin) authors a theme against frust::* alone.
The three glass tiers a Theme carries:
chrome (popovers/sheets/menus), bar (tab/nav/toolbars), and control
(buttons/toggles). See the module docs for each tier’s source recipe.
Fields§
§chrome: GlassMaterialPopovers, sheets, menus — the most opaque, highest-blur tier.
bar: GlassMaterialTab bars, nav bars, toolbars — a subtle mid-blur tier.
control: GlassMaterialButtons, toggles — a pure low-blur lens, no fill.
Implementations§
Source§impl GlassScale
impl GlassScale
Sourcepub fn opaque_material() -> GlassScale
pub fn opaque_material() -> GlassScale
The opaque scale: every tier is opaque —
blur_radius_intent == 0.0 and empty fill stacks — so a widget reading
GlassMaterial::is_opaque paints its surface-container role instead
of a translucent lens. This is the “one API on either design language”
seam: the same widget code reads theme.glass.<tier> and branches on
is_opaque().
Shadows reuse the Elevation::neutral table so the opaque path
lines up with that elevation ladder: chrome = level 3
(menus/dialogs), bar = level 2 (nav bar), control = level 1.
Trait Implementations§
Source§impl Clone for GlassScale
impl Clone for GlassScale
Source§fn clone(&self) -> GlassScale
fn clone(&self) -> GlassScale
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GlassScale
impl Debug for GlassScale
Source§impl PartialEq for GlassScale
impl PartialEq for GlassScale
impl StructuralPartialEq for GlassScale
Auto Trait Implementations§
impl Freeze for GlassScale
impl RefUnwindSafe for GlassScale
impl Send for GlassScale
impl Sync for GlassScale
impl Unpin for GlassScale
impl UnsafeUnpin for GlassScale
impl UnwindSafe for GlassScale
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.