Struct kas_widgets::ScrollBars [−][src]
pub struct ScrollBars<W: Scrollable> { /* fields omitted */ }
Expand description
Scrollbar controls
This is a wrapper adding scrollbar controls around a child. Note that this
widget does not enable scrolling; see ScrollBarRegion
for that.
Scrollbar positioning does not respect the inner widgets margins, since
the result looks poor when content is scrolled. Instead the content should
force internal margins by wrapping contents with a (zero-sized) frame.
ScrollRegion
already does this.
Implementations
Construct
By default scrollbars are automatically enabled based on requirements.
See ScrollBars::with_auto_bars
and ScrollBars::with_bars
.
Auto-enable bars
If enabled (default), this automatically enables/disables scroll bars as required when resized.
This has the side-effect of reserving enough space for scroll bars even when not required.
Set which scroll bars are visible
Calling this method also disables automatic scroll bars.
Set which scroll bars are visible
Calling this method also disables automatic scroll bars. A resize is required to update the child and scrollbar widgets.
Query which scroll bars are visible
Returns (horiz, vert)
tuple.
Trait Implementations
Returns the “default value” for a type. Read more
Set accel string
Get the number of child widgets
Get a reference to a child widget by index, or None
if the index is
out of bounds. Read more
Mutable variant of get Read more
Record first identifier Read more
Check whether id
is a descendant Read more
Find the child which is an ancestor of this id
, if any Read more
Find the leaf (lowest descendant) with this id
, if any Read more
Find the leaf (lowest descendant) with this id
, if any Read more
Walk through all widgets, calling f
once on each. Read more
Walk through all widgets, calling f
once on each. Read more
Get self as type Any
(mutable)
Get the name of the widget struct
Erase type
Erase type
Get whether the widget is disabled
Set the disabled state of a widget Read more
Set disabled state (chaining) Read more
Construct InputState
Read more
Auto Trait Implementations
impl<W> RefUnwindSafe for ScrollBars<W> where
W: RefUnwindSafe,
impl<W> Send for ScrollBars<W> where
W: Send,
impl<W> Sync for ScrollBars<W> where
W: Sync,
impl<W> Unpin for ScrollBars<W> where
W: Unpin,
impl<W> UnwindSafe for ScrollBars<W> where
W: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn cast_trunc(self) -> T
pub fn cast_trunc(self) -> T
Cast to integer, truncating Read more
pub fn cast_nearest(self) -> T
pub fn cast_nearest(self) -> T
Cast to the nearest integer Read more
pub fn cast_floor(self) -> T
pub fn cast_floor(self) -> T
Cast the floor to an integer Read more
pub fn try_cast_trunc(self) -> Result<T, Error>
pub fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
pub fn try_cast_nearest(self) -> Result<T, Error>
pub fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
pub fn try_cast_floor(self) -> Result<T, Error>
pub fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
pub fn try_cast_ceil(self) -> Result<T, Error>
pub fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more
Get the scale (DPI) factor Read more
Convert a size in font Points to physical pixels
Convert a size in font Em to physical pixels Read more
Size of a frame around child widget(s) Read more
Frame/margin around a menu entry
Size of a navigation highlight margin around a child widget
The margin around content within a widget Read more
The margin between UI elements, where desired Read more
The margin around frames and separators
The margin around text elements Read more
The height of a line of text
pub fn text_bound(
&self,
text: &mut dyn TextApi,
class: TextClass,
axis: AxisInfo
) -> SizeRules
pub fn text_bound(
&self,
text: &mut dyn TextApi,
class: TextClass,
axis: AxisInfo
) -> SizeRules
Update a [Text
] and get a size bound Read more
Width of an edit marker
Size of the sides of a button.
Size of the frame around an edit box, including margin Read more
Size of the element drawn by DrawHandle::checkbox
.
Size of the element drawn by DrawHandle::radiobox
.
Dimensions for a progress bar Read more
Convert a size in virtual pixels to physical pixels