pub struct ScrollBarKit {
pub placement: Placement,
pub visibility: Visibility,
pub width: f32,
pub width_rest: f32,
pub opacity_rest: f32,
pub room: f32,
pub min_length: f32,
pub margin: f32,
pub margin_track: f32,
pub track: Color32,
}Expand description
The scroll bars’ terms of a kit.
Fields§
§placement: Placement§visibility: Visibility§width: f32Points: the bar at its widest (scroll-bar.width).
width_rest: f32Points: the bar at rest, under Visibility::Rest
(scroll-bar.width-rest). It is sensed at width all the same.
opacity_rest: f32The thumb’s opacity at rest, 0 to 1, under Visibility::Rest
(scroll-bar.opacity-rest).
room: f32Points of the content’s width kept for the bar while it shows, under
Visibility::Rest (scroll-bar.room).
min_length: f32Points: the thumb’s least length (scroll-bar.min-length).
margin: f32Points between the bar and the scroll area’s edge
(scroll-bar.margin).
margin_track: f32Points kept free at both ends of the track, along the bar
(scroll-bar.margin-track): the thumb’s range is that much shorter
at each end. egui’s ScrollStyle has none: UiPop::scroll_area
gives it to egui as the bar’s rectangle (ScrollBarKit::track_rect).
track: Color32The track behind the thumb (scroll-bar.track-fill); none when
transparent.
Implementations§
Source§impl ScrollBarKit
impl ScrollBarKit
Sourcepub fn track_rect(&self, inner: Rect) -> Option<Rect>
pub fn track_rect(&self, inner: Rect) -> Option<Rect>
The rectangle egui draws a scroll area’s bars along
(ScrollArea::scroll_bar_rect), for an area whose content is shown
in inner: shorter by margin-track at both ends of each axis;
None without a margin, egui’s own then.
Sourcepub fn seen_at_rest(self) -> ScrollBarKit
pub fn seen_at_rest(self) -> ScrollBarKit
These terms for a bar that must be seen as soon as its content
overflows, whatever the theme does for the others: quiet at rest,
unless the theme’s bars are already always.
Sourcepub fn style(&self, base: &ScrollStyle) -> ScrollStyle
pub fn style(&self, base: &ScrollStyle) -> ScrollStyle
egui’s ScrollStyle for these terms, over base (what the kit
does not decide is kept: the content margin, the gap between a bar beside the content and the content,
the fades). The thumb is drawn in the widget states’ foreground
colour (foreground_color), which a ScrollBar scope sets to the
kit’s thumb fills. With hover and egui’s min-length, this is
egui’s own ScrollStyle::floating().
Trait Implementations§
Source§impl Clone for ScrollBarKit
impl Clone for ScrollBarKit
Source§fn clone(&self) -> ScrollBarKit
fn clone(&self) -> ScrollBarKit
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScrollBarKit
impl Debug for ScrollBarKit
Source§impl PartialEq for ScrollBarKit
impl PartialEq for ScrollBarKit
impl Copy for ScrollBarKit
impl StructuralPartialEq for ScrollBarKit
Auto Trait Implementations§
impl Freeze for ScrollBarKit
impl RefUnwindSafe for ScrollBarKit
impl Send for ScrollBarKit
impl Sync for ScrollBarKit
impl Unpin for ScrollBarKit
impl UnsafeUnpin for ScrollBarKit
impl UnwindSafe for ScrollBarKit
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more