ScrollContentPresenter
struct · ferroui-controls · v0.5.0
struct ScrollContentPresenter
Presents a scrolling view of content inside a ScrollViewer.
Members
TYPEto_refcan_horizontally_scroll_propertycan_vertically_scroll_propertyextent_propertyoffset_propertyviewport_propertyhorizontal_snap_points_type_propertyvertical_snap_points_type_propertyhorizontal_snap_points_alignment_propertyvertical_snap_points_alignment_propertyis_scroll_chaining_enabled_propertyconstructnewcan_horizontally_scrollset_can_horizontally_scrollcan_vertically_scrollset_can_vertically_scrollextentoffsetset_offsetviewporthorizontal_snap_points_typeset_horizontal_snap_points_typevertical_snap_points_typeset_vertical_snap_points_typehorizontal_snap_points_alignmentset_horizontal_snap_points_alignmentvertical_snap_points_alignmentset_vertical_snap_points_alignmentis_scroll_chaining_enabledset_is_scroll_chaining_enabledbring_descendant_into_viewbring_descendant_into_view_alignedzoom_factorset_zoom
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<ScrollContentPresenter>
Returns a strong reference to this object.
can_horizontally_scroll_property
fn can_horizontally_scroll_property() -> &'static StyledProperty<bool>
Defines the CanHorizontallyScroll property.
can_vertically_scroll_property
fn can_vertically_scroll_property() -> &'static StyledProperty<bool>
Defines the CanVerticallyScroll property.
extent_property
fn extent_property() -> &'static DirectProperty<ScrollContentPresenter, Size>
Defines the Extent property.
offset_property
fn offset_property() -> &'static StyledProperty<Vector>
Defines the Offset property.
viewport_property
fn viewport_property() -> &'static DirectProperty<ScrollContentPresenter, Size>
Defines the Viewport property.
horizontal_snap_points_type_property
fn horizontal_snap_points_type_property() -> &'static AttachedProperty<SnapPointsType>
Defines the HorizontalSnapPointsType property.
vertical_snap_points_type_property
fn vertical_snap_points_type_property() -> &'static AttachedProperty<SnapPointsType>
Defines the VerticalSnapPointsType property.
horizontal_snap_points_alignment_property
fn horizontal_snap_points_alignment_property() -> &'static AttachedProperty<SnapPointsAlignment>
Defines the HorizontalSnapPointsAlignment property.
vertical_snap_points_alignment_property
fn vertical_snap_points_alignment_property() -> &'static AttachedProperty<SnapPointsAlignment>
Defines the VerticalSnapPointsAlignment property.
is_scroll_chaining_enabled_property
fn is_scroll_chaining_enabled_property() -> &'static AttachedProperty<bool>
Defines the IsScrollChainingEnabled property.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
Initializes a new instance of the class.
can_horizontally_scroll
fn can_horizontally_scroll(self: &Self) -> bool
Gets a value indicating whether the content can be scrolled horizontally.
set_can_horizontally_scroll
fn set_can_horizontally_scroll(self: &Self, value: bool)
Sets a value indicating whether the content can be scrolled horizontally.
can_vertically_scroll
fn can_vertically_scroll(self: &Self) -> bool
Gets a value indicating whether the content can be scrolled vertically.
set_can_vertically_scroll
fn set_can_vertically_scroll(self: &Self, value: bool)
Sets a value indicating whether the content can be scrolled vertically.
extent
fn extent(self: &Self) -> Size
Gets the extent of the scrollable content.
offset
fn offset(self: &Self) -> Vector
Gets the current scroll offset.
set_offset
fn set_offset(self: &Self, value: Vector)
Sets the current scroll offset.
viewport
fn viewport(self: &Self) -> Size
Gets the size of the viewport on the scrollable content.
horizontal_snap_points_type
fn horizontal_snap_points_type(self: &Self) -> SnapPointsType
Gets how scroll gesture reacts to the snap points along the horizontal axis.
set_horizontal_snap_points_type
fn set_horizontal_snap_points_type(self: &Self, value: SnapPointsType)
Sets how scroll gesture reacts to the snap points along the horizontal axis.
vertical_snap_points_type
fn vertical_snap_points_type(self: &Self) -> SnapPointsType
Gets how scroll gesture reacts to the snap points along the vertical axis.
set_vertical_snap_points_type
fn set_vertical_snap_points_type(self: &Self, value: SnapPointsType)
Sets how scroll gesture reacts to the snap points along the vertical axis.
horizontal_snap_points_alignment
fn horizontal_snap_points_alignment(self: &Self) -> SnapPointsAlignment
Gets how the existing snap points are horizontally aligned versus the initial viewport.
set_horizontal_snap_points_alignment
fn set_horizontal_snap_points_alignment(self: &Self, value: SnapPointsAlignment)
Sets how the existing snap points are horizontally aligned versus the initial viewport.
vertical_snap_points_alignment
fn vertical_snap_points_alignment(self: &Self) -> SnapPointsAlignment
Gets how the existing snap points are vertically aligned versus the initial viewport.
set_vertical_snap_points_alignment
fn set_vertical_snap_points_alignment(self: &Self, value: SnapPointsAlignment)
Sets how the existing snap points are vertically aligned versus the initial viewport.
is_scroll_chaining_enabled
fn is_scroll_chaining_enabled(self: &Self) -> bool
Gets if scroll chaining is enabled. The default value is true.
After a user hits a scroll limit on an element that has been nested within another scrollable element, you can specify whether that parent element should continue the scrolling operation begun in its child element. This is called scroll chaining.
set_is_scroll_chaining_enabled
fn set_is_scroll_chaining_enabled(self: &Self, value: bool)
Sets if scroll chaining is enabled.
bring_descendant_into_view
fn bring_descendant_into_view(self: &Self, target: &Visual, target_rect: Rect) -> bool
Attempts to bring a portion of the target visual into view by scrolling the content.
target is the target visual and target_rect the portion of the
target visual to bring into view. Returns true if the scroll offset
was changed; otherwise false.
bring_descendant_into_view_aligned
fn bring_descendant_into_view_aligned(self: &Self, target: &Visual, target_rect: Rect, align_to_top: bool) -> bool
Brings a descendant rectangle to the top or bottom of the viewport. This uses extent coordinates, so repeated requests remain correct before the next arrange pass applies a changed offset. Logical scrolling stays delegated to the content's own scrolling contract.
zoom_factor
fn zoom_factor(self: &Self) -> f64
The zoom of the content: 1 unless the scroll viewer was zoomed (not upstream).
set_zoom
fn set_zoom(self: &Self, zoom: f64, offset: Vector)
Zooms the content to zoom and scrolls to offset (in zoomed units), as the
ChangeView of WinUI's scroll viewer does (not upstream). The content keeps its layout:
the presenter scales it (Visual::manipulation_transform) and the extent is its zoomed
size. A content that scrolls logically (a virtualizing panel) is not zoomed.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeControlImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<ScrollContentPresenter>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleStyledElementImplInteractiveImplControlImplFerroObjectImplVisualImplLayoutableImplInputElementImplIScrollableIScrollAnchorProvider
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.