pub struct ScrollbarStyle {
pub thumb: Color,
pub track: Option<Color>,
pub width: ScrollbarWidthMode,
pub thickness: f32,
pub thickness_thin: f32,
pub hover_boost: f32,
pub hover_track: Color,
pub min_thumb: f32,
pub margin: f32,
pub fade_delay_secs: f32,
pub fade_secs: f32,
}Expand description
Overlay-scrollbar styling for one scroll container - the runtime
mirror of the standard CSS properties scrollbar-color: <thumb> [<track>] and scrollbar-width: auto | thin | none (CSS Scrollbars
Styling Level 1; both transpile 1:1 to the web backend). Set from
the stylesheet by lumenc; the skin defaults live in
skins/default.css via the --lumen-scrollbar-* tokens.
This component’s Default is the only place fallback visuals are
defined (the blank-no-css contract): when no stylesheet rule matches,
both the paint extract and the interaction FSM read these values.
Fields without a real-CSS spelling today (minimum thumb length, fade
timings) still live here - one struct a per-OS skin layer or future
custom property can override without touching the FSM or the paint
code.
Fields§
§thumb: ColorThumb fill (scrollbar-color first value).
track: Option<Color>Track fill (scrollbar-color second value). Some = painted
whenever the bar is visible (CSS semantics); None = the
fallback translucent track shown only while the bar is hovered
(overlay convention).
width: ScrollbarWidthModescrollbar-width keyword.
thickness: f32Bar thickness in logical pixels at scrollbar-width: auto
(scrollbar-thickness CSS property).
thickness_thin: f32Bar thickness in logical pixels at scrollbar-width: thin
(scrollbar-thickness-thin CSS property).
hover_boost: f32Thumb alpha multiplier while the bar is hovered / dragged
(scrollbar-hover-boost CSS property).
hover_track: ColorFallback hover-only track fill used when Self::track is
None (scrollbar-track-hover CSS property).
min_thumb: f32Minimum thumb length in logical pixels (theme minimum;
scrollbar-min-thumb CSS property).
margin: f32Inset from the viewport edges in logical pixels
(scrollbar-margin CSS property).
fade_delay_secs: f32Seconds of inactivity before the bars start fading out
(scrollbar-fade-delay CSS property).
fade_secs: f32Fade-out ramp length in seconds (scrollbar-fade-duration CSS
property).
Implementations§
Source§impl ScrollbarStyle
impl ScrollbarStyle
Sourcepub fn thickness(&self) -> Option<f32>
pub fn thickness(&self) -> Option<f32>
Resolved bar thickness in logical pixels; None = bars hidden
(scrollbar-width: none).
Sourcepub fn metrics(&self) -> Option<ScrollbarMetrics>
pub fn metrics(&self) -> Option<ScrollbarMetrics>
Geometry inputs for vertical_scrollbar / horizontal_scrollbar;
None when bars are disabled.
Trait Implementations§
Source§impl Clone for ScrollbarStyle
impl Clone for ScrollbarStyle
Source§fn clone(&self) -> ScrollbarStyle
fn clone(&self) -> ScrollbarStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Component for ScrollbarStyle
impl Component for ScrollbarStyle
Source§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
Source§type Mutability = Mutable
type Mutability = Mutable
Component<Mutability = Mutable>,
while immutable components will instead have Component<Mutability = Immutable>. Read moreSource§fn register_required_components(
_requiree: ComponentId,
required_components: &mut RequiredComponentsRegistrator<'_, '_>,
)
fn register_required_components( _requiree: ComponentId, required_components: &mut RequiredComponentsRegistrator<'_, '_>, )
Source§fn clone_behavior() -> ComponentCloneBehavior
fn clone_behavior() -> ComponentCloneBehavior
Source§fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
ComponentRelationshipAccessor] required for working with relationships in dynamic contexts. Read more§fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
§fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
§fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
EntityMapper. This is used to remap entities in contexts like scenes and entity cloning.
When deriving Component, this is populated by annotating fields containing entities with #[entities] Read moreSource§impl Debug for ScrollbarStyle
impl Debug for ScrollbarStyle
Source§impl Default for ScrollbarStyle
impl Default for ScrollbarStyle
Source§impl PartialEq for ScrollbarStyle
impl PartialEq for ScrollbarStyle
Source§fn eq(&self, other: &ScrollbarStyle) -> bool
fn eq(&self, other: &ScrollbarStyle) -> bool
self and other values to be equal, and is used by ==.impl Copy for ScrollbarStyle
impl StructuralPartialEq for ScrollbarStyle
Auto Trait Implementations§
impl Freeze for ScrollbarStyle
impl RefUnwindSafe for ScrollbarStyle
impl Send for ScrollbarStyle
impl Sync for ScrollbarStyle
impl Unpin for ScrollbarStyle
impl UnsafeUnpin for ScrollbarStyle
impl UnwindSafe for ScrollbarStyle
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<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut ComponentsRegistrator<'_>, ) -> impl Iterator<Item = ComponentId> + use<C>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
§unsafe fn get_components(
ptr: MovingPtr<'_, C>,
func: &mut impl FnMut(StorageType, OwningPtr<'_>),
) -> <C as DynamicBundle>::Effect
unsafe fn get_components( ptr: MovingPtr<'_, C>, func: &mut impl FnMut(StorageType, OwningPtr<'_>), ) -> <C as DynamicBundle>::Effect
§unsafe fn apply_effect(
_ptr: MovingPtr<'_, MaybeUninit<C>>,
_entity: &mut EntityWorldMut<'_>,
)
unsafe fn apply_effect( _ptr: MovingPtr<'_, MaybeUninit<C>>, _entity: &mut EntityWorldMut<'_>, )
§impl<T> FromTemplate for T
impl<T> FromTemplate for T
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
§impl<T> Template for T
impl<T> Template for T
§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a Template::Output.§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.