Carousel
Object Hierarchy:
Description:
[
CCode ( type_id =
"adw_carousel_get_type ()" ) ]
[
Version ( since =
"1.0" ) ]
public sealed class Carousel :
Widget,
Swipeable,
Accessible,
Buildable,
ConstraintTarget,
Orientable
A paginated scrolling widget.
<picture> <source srcset="carousel-dark.png" media="(prefers-color-scheme: dark)"> <img src="carousel.png"
alt="carousel"> </picture>
The `AdwCarousel` widget can be used to display a set of pages with swipe-based navigation between them.
[class@CarouselIndicatorDots] and [class@CarouselIndicatorLines] can be used to provide page indicators for `AdwCarousel`.
CSS nodes
`AdwCarousel` has a single CSS node with name `carousel`.
Content:
Properties:
- public bool allow_long_swipes { get; set; }
Whether to allow swiping for more than one page at a time.
- public bool allow_mouse_drag { get; set; }
Sets whether the `AdwCarousel` can be dragged with mouse pointer.
- public bool allow_scroll_wheel { get; set; }
Whether the widget will respond to scroll wheel events.
- public bool interactive { get; set; }
Whether the carousel can be navigated.
- public uint n_pages { get; }
The number of pages in a `AdwCarousel`.
- public double position { get; }
Current scrolling position, unitless.
- public uint reveal_duration { get; set; }
Page reveal duration, in milliseconds.
- public SpringParams scroll_params { owned get; set; }
Scroll animation spring parameters.
- public uint spacing { get; set; }
Spacing between pages in pixels.
Creation methods:
Methods:
- public void append (Widget child)
Appends child
to this.
- public bool get_allow_long_swipes ()
Gets whether to allow swiping for more than one page at a time.
- public bool get_allow_mouse_drag ()
Sets whether this can be dragged
with mouse pointer.
- public bool get_allow_scroll_wheel ()
Gets whether this will respond to
scroll wheel events.
- public bool get_interactive ()
Gets whether this can be navigated.
- public uint get_n_pages ()
Gets the number of pages in this.
- public unowned Widget get_nth_page (uint n)
Gets the page at position n
.
- public double get_position ()
Gets current scroll position in this
.
- public uint get_reveal_duration ()
Gets duration of the animation used when adding or removing pages.
- public SpringParams get_scroll_params ()
Gets the scroll animation spring parameters for
this.
- public uint get_spacing ()
Gets spacing between pages in pixels.
- public void insert (Widget child, int position)
Inserts child
into this
at position position
.
- public void prepend (Widget child)
Prepends child
to this.
- public void remove (Widget child)
Removes child
from this
.
- public void reorder (Widget child, int position)
Moves child
into position position
.
- public void scroll_to (Widget widget, bool animate)
Scrolls to widget
.
- public void set_allow_long_swipes (bool allow_long_swipes)
Sets whether to allow swiping for more than one page at a time.
- public void set_allow_mouse_drag (bool allow_mouse_drag)
Sets whether this can be dragged
with mouse pointer.
- public void set_allow_scroll_wheel (bool allow_scroll_wheel)
Sets whether this will respond to
scroll wheel events.
- public void set_interactive (bool interactive)
Sets whether this can be navigated.
- public void set_reveal_duration (uint reveal_duration)
Sets duration of the animation used when adding or removing pages.
- public void set_scroll_params (SpringParams @params)
Sets the scroll animation spring parameters for
this.
- public void set_spacing (uint spacing)
Sets spacing between pages in pixels.
Signals:
Inherited Members:
All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref
All known members inherited from interface Adw.Swipeable
All known members inherited from interface Gtk.Accessible
- accessible_role
- get_accessible_role
- reset_property
- reset_relation
- reset_state
- update_property
- update_property_value
- update_relation
- update_relation_value
- update_state
- update_state_value
All known members inherited from interface Gtk.Buildable
- add_child
- custom_finished
- custom_tag_end
- custom_tag_start
- get_buildable_id
- get_id
- get_internal_child
- parser_finished
- set_buildable_property
- set_id
All known members inherited from interface Gtk.Orientable