Top |
gboolean | allow-mouse-drag | Read / Write |
guint | animation-duration | Read / Write |
gboolean | center-content | Read / Write |
guint | indicator-spacing | Read / Write |
HdyPaginatorIndicatorStyle | indicator-style | Read / Write |
gboolean | interactive | Read / Write |
guint | n-pages | Read |
gdouble | position | Read |
guint | spacing | Read / Write |
GEnum ╰── HdyPaginatorIndicatorStyle GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── GtkEventBox ╰── HdyPaginator
HdyPaginator implements AtkImplementorIface, GtkBuildable, GtkOrientable and HdySwipeable.
The HdyPaginator widget can be used to display a set of pages with swipe-based navigation between them and optional indicators.
HdyPaginator *
hdy_paginator_new (void
);
Create a new HdyPaginator widget.
Since: 0.0.11
void hdy_paginator_prepend (HdyPaginator *self
,GtkWidget *child
);
Prepends child
to self
Since: 0.0.11
void hdy_paginator_insert (HdyPaginator *self
,GtkWidget *child
,gint position
);
Inserts child
into self
at position position
.
If position is -1, or larger than the number of pages,
child
will be appended to the end.
Since: 0.0.11
void hdy_paginator_reorder (HdyPaginator *self
,GtkWidget *child
,gint position
);
Moves child
into position position
.
If position is -1, or larger than the number of pages, child
will be moved
to the end.
Since: 0.0.11
void hdy_paginator_scroll_to (HdyPaginator *self
,GtkWidget *widget
);
Scrolls to widget
position with an animation.
“animation-duration” property can be used for controlling the
duration.
Since: 0.0.11
void hdy_paginator_scroll_to_full (HdyPaginator *self
,GtkWidget *widget
,gint64 duration
);
Scrolls to widget
position with an animation.
Since: 0.0.11
guint
hdy_paginator_get_n_pages (HdyPaginator *self
);
Gets the number of pages in self
.
Since: 0.0.11
gdouble
hdy_paginator_get_position (HdyPaginator *self
);
Gets current scroll position in self
. It's unitless, 1 matches 1 page.
Since: 0.0.11
gboolean
hdy_paginator_get_interactive (HdyPaginator *self
);
Gets whether self
can be navigated.
Since: 0.0.11
void hdy_paginator_set_interactive (HdyPaginator *self
,gboolean interactive
);
Sets whether self
can be navigated. This can be used to temporarily disable
a HdyPaginator to only allow swiping in a certain state.
Since: 0.0.11
HdyPaginatorIndicatorStyle
hdy_paginator_get_indicator_style (HdyPaginator *self
);
Gets the current page indicator style.
Since: 0.0.11
void hdy_paginator_set_indicator_style (HdyPaginator *self
,HdyPaginatorIndicatorStyle style
);
Sets style of page indicators. Depending on orientation, they are displayed below or besides the pages. If the pages are meant to be centered, “center-content” can be used to compensate for that.
Since: 0.0.11
guint
hdy_paginator_get_indicator_spacing (HdyPaginator *self
);
Gets spacing between content and page indicators.
Since: 0.0.11
void hdy_paginator_set_indicator_spacing (HdyPaginator *self
,guint spacing
);
Sets spacing between content and page indicators. Does nothing if
“indicator-style” is HDY_PAGINATOR_INDICATOR_STYLE_NONE
.
Since: 0.0.11
gboolean
hdy_paginator_get_center_content (HdyPaginator *self
);
Sets whether self
is centering pages.
Since: 0.0.11
void hdy_paginator_set_center_content (HdyPaginator *self
,gboolean center_content
);
Sets whether self
is centering content. If “indicator-style” is
HDY_PAGINATOR_INDICATOR_STYLE_NONE
, centering does nothing, otherwise it
adds whitespace to the left or above the pages to compensate for the
indicators.
Since: 0.0.11
guint
hdy_paginator_get_spacing (HdyPaginator *self
);
Gets spacing between pages in pixels.
Since: 0.0.11
void hdy_paginator_set_spacing (HdyPaginator *self
,guint spacing
);
Sets spacing between pages in pixels.
Since: 0.0.11
guint
hdy_paginator_get_animation_duration (HdyPaginator *self
);
Gets animation duration used by hdy_paginator_scroll_to()
.
Since: 0.0.11
void hdy_paginator_set_animation_duration (HdyPaginator *self
,guint duration
);
Sets animation duration used by hdy_paginator_scroll_to()
.
Since: 0.0.11
gboolean
hdy_paginator_get_allow_mouse_drag (HdyPaginator *self
);
Sets whether self
can be dragged with mouse pointer
Since: 0.0.12
void hdy_paginator_set_allow_mouse_drag (HdyPaginator *self
,gboolean allow_mouse_drag
);
Sets whether self
can be dragged with mouse pointer. If allow_mouse_drag
is FALSE
, dragging is only available on touch.
This should usually be FALSE
.
Since: 0.0.12
These enumeration values describe the possible page indicator styles in a HdyPaginator widget.
New values may be added to this enumeration over time.
“allow-mouse-drag”
property“allow-mouse-drag” gboolean
Sets whether the HdyPaginator can be dragged with mouse pointer. If the
value is FALSE
, dragging is only available on touch.
This should usually be FALSE
.
Flags: Read / Write
Default value: FALSE
Since: 0.0.12
“animation-duration”
property“animation-duration” guint
Animation duration in milliseconds, used by hdy_paginator_scroll_to()
.
Flags: Read / Write
Default value: 250
Since: 0.0.11
“center-content”
property“center-content” gboolean
Whether the HdyPaginator is centering pages. If
“indicator-style” is HDY_PAGINATOR_INDICATOR_STYLE_NONE
,
centering does nothing, otherwise it adds whitespace to the left or above
the pages to compensate for the indicators.
Flags: Read / Write
Default value: FALSE
Since: 0.0.11
“indicator-spacing”
property“indicator-spacing” guint
Spacing between content and page indicators. Does nothing if
“indicator-style” is HDY_PAGINATOR_INDICATOR_STYLE_NONE
.
Flags: Read / Write
Default value: 0
Since: 0.0.11
“indicator-style”
property“indicator-style” HdyPaginatorIndicatorStyle
The style of page indicators. Depending on orientation, they are displayed below or besides the pages. If the pages are meant to be centered, “center-content” can be used to compensate for that.
Flags: Read / Write
Default value: HDY_PAGINATOR_INDICATOR_STYLE_NONE
Since: 0.0.11
“interactive”
property“interactive” gboolean
Whether self
can be navigated. This can be used to temporarily disable
a HdyPaginator to only allow navigating it in a certain state.
Flags: Read / Write
Default value: TRUE
Since: 0.0.11
“n-pages”
property“n-pages” guint
The number of pages in a HdyPaginator
Flags: Read
Default value: 0
Since: 0.0.11
“position”
property“position” gdouble
Current scrolling position, unitless. 1 matches 1 page. Use
hdy_paginator_scroll_to()
for changing it.
Flags: Read
Allowed values: >= 0
Default value: 0
Since: 0.0.11
“page-changed”
signalvoid user_function (HdyPaginator *self, guint index, gpointer user_data)
This signal is emitted after a page has been changed. This can be used to implement "infinite scrolling" by connecting to this signal and amending the pages.
self |
The HdyPaginator instance |
|
index |
Current page |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 0.0.12