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§
§impl ScrollStyle
impl ScrollStyle
pub fn solid() -> ScrollStyle
pub fn solid() -> ScrollStyle
Solid scroll bars that always use up space
pub fn thin() -> ScrollStyle
pub fn thin() -> ScrollStyle
Thin scroll bars that expand on hover
pub fn floating() -> ScrollStyle
pub fn floating() -> ScrollStyle
No scroll bars until you hover the scroll area, at which time they appear faintly, and then expand when you hover the scroll bars.
pub 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§
§impl Clone for ScrollStyle
impl Clone for ScrollStyle
§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§impl Debug for ScrollStyle
impl Debug for ScrollStyle
§impl Default for ScrollStyle
impl Default for ScrollStyle
§fn default() -> ScrollStyle
fn default() -> ScrollStyle
§impl<'de> Deserialize<'de> for ScrollStylewhere
ScrollStyle: Default,
impl<'de> Deserialize<'de> for ScrollStylewhere
ScrollStyle: Default,
§fn deserialize<__D>(
__deserializer: __D
) -> Result<ScrollStyle, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ScrollStyle, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl PartialEq for ScrollStyle
impl PartialEq for ScrollStyle
§fn eq(&self, other: &ScrollStyle) -> bool
fn eq(&self, other: &ScrollStyle) -> bool
self
and other
values to be equal, and is used
by ==
.§impl Serialize for ScrollStyle
impl Serialize for ScrollStyle
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for ScrollStyle
impl StructuralPartialEq for ScrollStyle
Auto Trait Implementations§
impl Freeze for ScrollStyle
impl RefUnwindSafe for ScrollStyle
impl Send for ScrollStyle
impl Sync for ScrollStyle
impl Unpin for ScrollStyle
impl UnwindSafe for ScrollStyle
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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
.§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
.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request