Expand description
Scroll widgets, properties and nodes.
§Crate
This crate is part of the zng
project.
§Cargo Features
This crate provides 2 feature flags, 1 enabled by default.
§"debug_default"
Enables the "dyn_closure"
in debug builds.
Enabled by default.
§"dyn_closure"
Box closures at opportune places, such as Var::map
, reducing the number of monomorphised types.
This speeds-up compilation time at the cost of runtime.
Modules§
- cmd
- Commands that control the scoped scroll widget.
- node
- UI nodes used for building the scroll widget.
- scrollbar
- Scrollbar widget, properties and nodes..
- thumb
- Thumb widget, properties and nodes..
Macros§
Structs§
- Auto
Scroll Args - Arguments for the
auto_scroll_indicator
closure. - SCROLL
- Controls the parent scroll.
- Scroll
W
A container that can pan and zoom a child of any size.- Scroll
BarArgs - Arguments for scrollbar widget functions.
- Scroll
Info - Shared reference to the viewport bounds of a scroll.
- Scroll
Mode - What dimensions are scrollable in a widget.
- Scroll
Units Mix m
Properties that define scroll units.- Scrollbar
W
Scrollbar widget.- Scrollbar
FnMix m
Properties that defines the scrollbar widget used in scrolls.- Smooth
Scrolling - Smooth scrolling config.
- Thumb
W
Scrollbar thumb widget.
Enums§
- Lazy
Mode - Lazy loading mode of a widget.
- Scroll
From - Defines a scroll delta and to what value source it is applied.
Statics§
- ALT_
FACTOR_ VAR - Scroll unit multiplier used when alternate scrolling.
- AUTO_
HIDE_ EXTRA_ VAR - Extra space added to the viewport auto-hide rectangle.
- AUTO_
SCROLL_ INDICATOR_ VAR - Auto scroll icon/indicator node. The node is child of the auto scroll indicator widget, the full
SCROLL
context can be used in the indicator. - AUTO_
SCROLL_ VAR - If auto-scrolling on middle click is enabled.
- DEFINE_
VIEWPORT_ UNIT_ VAR - If a scroll widget defines its viewport size as the
LayoutMetrics::viewport
for the scroll content. - HORIZONTAL_
LINE_ UNIT_ VAR - Horizontal offset added when the
SCROLL_RIGHT_CMD
runs and removed when theSCROLL_LEFT_CMD
runs. - HORIZONTAL_
PAGE_ UNIT_ VAR - Horizontal offset added when the
PAGE_RIGHT_CMD
runs and removed when thePAGE_LEFT_CMD
runs. - HORIZONTAL_
SCROLLBAR_ FN_ VAR - Widget function for creating the vertical scrollbar of an scroll widget.
- HORIZONTAL_
WHEEL_ UNIT_ VAR - Horizontal offset multiplied by the
MouseScrollDelta::LineDelta
x. - MAX_
ZOOM_ VAR - Maximum scale allowed when
ScrollMode::ZOOM
is enabled. - MIN_
ZOOM_ VAR - Minimum scale allowed when
ScrollMode::ZOOM
is enabled. - OVERSCROLL_
COLOR_ VAR - Color of the overscroll indicator.
- SCROLLBAR_
JOINER_ FN_ VAR - Widget function for the little square that joins the two scrollbars when both are visible.
- SCROLL_
TO_ FOCUSED_ MODE_ VAR - Scroll to mode used when scrolling to make the focused child visible.
- SMOOTH_
SCROLLING_ VAR - Smooth scrolling config for an scroll widget.
- VERTICAL_
LINE_ UNIT_ VAR - Vertical offset added when the
SCROLL_DOWN_CMD
runs and removed when theSCROLL_UP_CMD
runs. - VERTICAL_
PAGE_ UNIT_ VAR - Vertical offset added when the
PAGE_DOWN_CMD
runs and removed when thePAGE_UP_CMD
runs. - VERTICAL_
SCROLLBAR_ FN_ VAR - Widget function for creating the vertical scrollbar of an scroll widget.
- VERTICAL_
WHEEL_ UNIT_ VAR - Vertical offset multiplied by the
MouseScrollDelta::LineDelta
y. - ZOOM_
TOUCH_ ORIGIN_ VAR - Center point of zoom scaling done using the touch pinch gesture.
- ZOOM_
WHEEL_ ORIGIN_ VAR - Center point of zoom scaling done using the mouse scroll wheel.
- ZOOM_
WHEEL_ UNIT_ VAR - Scale delta added or removed from the zoom scale by
MouseScrollDelta::LineDelta
used in zoom operations.
Traits§
- Widget
Info Ext - Scroll extensions for
WidgetInfo
.
Functions§
- alt_
factor P
Scroll unit multiplier used when alternate scrolling.- auto_
hide_ extra P
Extra space added to the viewport auto-hide rectangle.- auto_
scroll P
Enables or disables auto scroll on mouse middle click.- auto_
scroll_ indicator P
Auto scroll icon/indicator node.- clip_
to_ viewport c
Clip content to only be visible within the viewport, not under scrollbars.- define_
viewport_ unit P
If the scroll defines its viewport size as theLayoutMetrics::viewport
for the scroll content.- h_
line_ unit P
Horizontal offset added when theSCROLL_RIGHT_CMD
runs and removed when theSCROLL_LEFT_CMD
runs.- h_
page_ unit P
Horizontal offset added when thePAGE_RIGHT_CMD
runs and removed when thePAGE_LEFT_CMD
runs.- h_
scrollbar_ fn P
Horizontal scrollbar function for all scroll widget descendants.- h_
wheel_ unit P
Horizontal offset added when the mouse wheel is scrolling by lines.- horizontal_
offset P
Binds thehorizontal_offset
scroll var to the property value.- lazy
P
Enables lazy init for the widget.- line_
units P
Horizontal and vertical offsets used when scrolling.- max_
zoom P
Maximum scale allowed whenScrollMode::ZOOM
is enabled.- min_
zoom P
Minimum scale allowed whenScrollMode::ZOOM
is enabled.- mode
c
Scroll mode.- mouse_
pan P
Scroll by grabbing and dragging the content with the mouse primary button.- overscroll_
color P
Color of the overscroll indicator.- page_
units P
Horizontal and vertical offsets used when page-scrolling.- scroll_
to_ focused_ mode P
Scroll-to mode used by scroll widgets when scrolling to make the focused child visible.- scrollbar_
fn P
Scrollbar function for both orientations applicable to all scroll widget descendants.- scrollbar_
joiner_ fn P
Widget function for the little square in the corner that joins the two scrollbars when both are visible.- smooth_
scrolling P
Smooth scrolling config.- v_
line_ unit P
Vertical offset added when theSCROLL_DOWN_CMD
runs and removed when theSCROLL_UP_CMD
runs.- v_
page_ unit P
Vertical offset added when thePAGE_DOWN_CMD
runs and removed when thePAGE_UP_CMD
runs.- v_
scrollbar_ fn P
Vertical scrollbar function for all scroll widget descendants.- v_
wheel_ unit P
Vertical offset added when the mouse wheel is scrolling by lines.- vertical_
offset P
Binds thevertical_offset
scroll var to the property value.- wheel_
units P
Horizontal and vertical offsets used when mouse wheel scrolling.- zoom_
origin P
Center point of zoom scaling done using mouse scroll wheel and touch gesture.- zoom_
scale P
Binds thezoom_scale
scroll var to the property value.- zoom_
size_ only P
Set on an descendant ofScroll!
to resize the widget instead of scaling it with the scroll zoom.- zoom_
touch_ origin P
Center point of zoom scaling done using the touch pinch gesture.- zoom_
wheel_ origin P
Center point of zoom scaling done using the mouse scroll wheel.- zoom_
wheel_ unit P
Scale delta added when the mouse wheel is zooming by lines.