pub struct ScrollStyle {Show 14 fields
pub floating: bool,
pub bar_width: f32,
pub handle_min_length: f32,
pub bar_inner_margin: f32,
pub bar_outer_margin: f32,
pub floating_width: f32,
pub floating_allocated_width: f32,
pub foreground_color: bool,
pub dormant_background_opacity: f32,
pub active_background_opacity: f32,
pub interact_background_opacity: f32,
pub dormant_handle_opacity: f32,
pub active_handle_opacity: f32,
pub interact_handle_opacity: f32,
}
Expand description
Controls the spacing and visuals of a crate::ScrollArea
.
There are three presets to chose from:
Fields§
§floating: bool
If true
, scroll bars float above the content, partially covering it.
If false
, the scroll bars allocate space, shrinking the area
available to the contents.
This also changes the colors of the scroll-handle to make it more promiment.
bar_width: f32
The width of the scroll bars at it largest.
handle_min_length: f32
Make sure the scroll handle is at least this big
bar_inner_margin: f32
Margin between contents and scroll bar.
bar_outer_margin: f32
Margin between scroll bar and the outer container (e.g. right of a vertical scroll bar). Only makes sense for non-floating scroll bars.
floating_width: f32
The thin width of floating scroll bars that the user is NOT hovering.
When the user hovers the scroll bars they expand to Self::bar_width
.
floating_allocated_width: f32
How much space is allocated for a floating scroll bar?
Normally this is zero, but you could set this to something small
like 4.0 and set Self::dormant_handle_opacity
and
Self::dormant_background_opacity
to e.g. 0.5
so as to always show a thin scroll bar.
foreground_color: bool
If true, use colors with more contrast. Good for floating scroll bars.
dormant_background_opacity: f32
The opaqueness of the background when the user is neither scrolling nor hovering the scroll area.
This is only for floating scroll bars. Solid scroll bars are always opaque.
active_background_opacity: f32
The opaqueness of the background when the user is hovering the scroll area, but not the scroll bar.
This is only for floating scroll bars. Solid scroll bars are always opaque.
interact_background_opacity: f32
The opaqueness of the background when the user is hovering over the scroll bars.
This is only for floating scroll bars. Solid scroll bars are always opaque.
dormant_handle_opacity: f32
The opaqueness of the handle when the user is neither scrolling nor hovering the scroll area.
This is only for floating scroll bars. Solid scroll bars are always opaque.
active_handle_opacity: f32
The opaqueness of the handle when the user is hovering the scroll area, but not the scroll bar.
This is only for floating scroll bars. Solid scroll bars are always opaque.
interact_handle_opacity: f32
The opaqueness of the handle when the user is hovering over the scroll bars.
This is only for floating scroll bars. Solid scroll bars are always opaque.
Implementations§
Source§impl ScrollStyle
impl ScrollStyle
Sourcepub fn floating() -> Self
pub fn floating() -> Self
No scroll bars until you hover the scroll area, at which time they appear faintly, and then expand when you hover the scroll bars.
Sourcepub fn allocated_width(&self) -> f32
pub fn allocated_width(&self) -> f32
Width of a solid vertical scrollbar, or height of a horizontal scroll bar, when it is at its widest.
pub fn ui(&mut self, ui: &mut Ui)
pub fn details_ui(&mut self, ui: &mut Ui)
Trait Implementations§
Source§impl Clone for ScrollStyle
impl Clone for ScrollStyle
Source§fn clone(&self) -> ScrollStyle
fn clone(&self) -> ScrollStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more