Package ch.bailu.gtk.adw
Klasse Carousel
- Alle implementierten Schnittstellen:
PointerInterface
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`.
<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`.
https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Carousel.html
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenVon Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gtk.Widget
Widget.OnDestroy, Widget.OnDestroyNotify, Widget.OnDirectionChanged, Widget.OnHide, Widget.OnKeynavFailed, Widget.OnMap, Widget.OnMnemonicActivate, Widget.OnMoveFocus, Widget.OnQueryTooltip, Widget.OnRealize, Widget.OnShow, Widget.OnStateFlagsChanged, Widget.OnTickCallback, Widget.OnUnmap, Widget.OnUnrealizeVon Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify -
Feldübersicht
FelderVon Klasse geerbte Felder ch.bailu.gtk.gtk.Widget
SIGNAL_ON_DESTROY, SIGNAL_ON_DIRECTION_CHANGED, SIGNAL_ON_HIDE, SIGNAL_ON_KEYNAV_FAILED, SIGNAL_ON_MAP, SIGNAL_ON_MNEMONIC_ACTIVATE, SIGNAL_ON_MOVE_FOCUS, SIGNAL_ON_QUERY_TOOLTIP, SIGNAL_ON_REALIZE, SIGNAL_ON_SHOW, SIGNAL_ON_STATE_FLAGS_CHANGED, SIGNAL_ON_UNMAP, SIGNAL_ON_UNREALIZEVon Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidAppends @child to @self.Implements interfaceAccessible.Implements interfaceBuildable.Implements interfaceConstraintTarget.Implements interfaceOrientable.Implements interfaceSwipeable.booleanGets whether to allow swiping for more than one page at a time.booleanSets whether @self can be dragged with mouse pointer.booleanGets whether @self will respond to scroll wheel events.static ClassHandlerstatic intbooleanGets whether @self can be navigated.intGets the number of pages in @self.getNthPage(int n) Gets the page at position @n.static longstatic TypeSystem.TypeSizedoubleGets current scroll position in @self, unitless.intGets the page reveal duration, in milliseconds.Gets the scroll animation spring parameters for @self.intGets spacing between pages in pixels.static longstatic TypeSystem.TypeSizevoidInserts @child into @self at position @position.onPageChanged(Carousel.OnPageChanged signal) Connect to signal "page-changed".voidPrepends @child to @self.voidRemoves @child from @self.voidMoves @child into position @position.voidScrolls to @widget.voidsetAllowLongSwipes(boolean allow_long_swipes) Sets whether to allow swiping for more than one page at a time.voidsetAllowMouseDrag(boolean allow_mouse_drag) Sets whether @self can be dragged with mouse pointer.voidsetAllowScrollWheel(boolean allow_scroll_wheel) Sets whether @self will respond to scroll wheel events.voidsetInteractive(boolean interactive) Sets whether @self can be navigated.voidsetRevealDuration(int reveal_duration) Sets the page reveal duration, in milliseconds.voidsetScrollParams(SpringParams params) Sets the scroll animation spring parameters for @self.voidsetSpacing(int spacing) Sets spacing between pages in pixels.Von Klasse geerbte Methoden ch.bailu.gtk.gtk.Widget
actionSetEnabled, actionSetEnabled, activate, activateAction, activateAction, activateActionVariant, activateActionVariant, activateDefault, addController, addCssClass, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBaseline, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getDefaultDirection, getDirection, getDisplay, getFirstChild, getFocusable, getFocusChild, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getLimitEvents, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeCssClass, removeMnemonicLabel, removeTickCallback, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setCursorFromName, setDefaultDirection, setDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipMarkup, setTooltipText, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, snapshotChild, triggerTooltipQuery, unmap, unparent, unrealize, unsetStateFlagsVon Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrPropertyVon Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnrefVon Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacksVon Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNullVon Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitVon Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
SIGNAL_ON_PAGE_CHANGED
- Siehe auch:
-
-
Konstruktordetails
-
Carousel
-
Carousel
public Carousel()Creates a new `AdwCarousel`.
-
-
Methodendetails
-
getClassHandler
-
append
Appends @child to @self.- Parameter:
child- a widget to add
-
getAllowLongSwipes
public boolean getAllowLongSwipes()Gets whether to allow swiping for more than one page at a time.- Gibt zurück:
- `TRUE` if long swipes are allowed
-
getAllowMouseDrag
public boolean getAllowMouseDrag()Sets whether @self can be dragged with mouse pointer.- Gibt zurück:
- whether @self can be dragged with mouse pointer
-
getAllowScrollWheel
public boolean getAllowScrollWheel()Gets whether @self will respond to scroll wheel events.- Gibt zurück:
- `TRUE` if @self will respond to scroll wheel events
-
getInteractive
public boolean getInteractive()Gets whether @self can be navigated.- Gibt zurück:
- whether @self can be navigated
-
getNPages
public int getNPages()Gets the number of pages in @self.- Gibt zurück:
- the number of pages in @self
-
getNthPage
Gets the page at position @n.- Parameter:
n- index of the page- Gibt zurück:
- the page
-
getPosition
public double getPosition()Gets current scroll position in @self, unitless.
1 matches 1 page. Use [method@Carousel.scroll_to] for changing it.- Gibt zurück:
- the scroll position
-
getRevealDuration
public int getRevealDuration()Gets the page reveal duration, in milliseconds.- Gibt zurück:
- the duration
-
getScrollParams
Gets the scroll animation spring parameters for @self.- Gibt zurück:
- the animation parameters
-
getSpacing
public int getSpacing()Gets spacing between pages in pixels.- Gibt zurück:
- spacing between pages
-
insert
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.- Parameter:
child- a widget to addposition- the position to insert @child at
-
prepend
Prepends @child to @self.- Parameter:
child- a widget to add
-
remove
Removes @child from @self.- Parameter:
child- a widget to remove
-
reorder
Moves @child into position @position.
If position is -1, or larger than the number of pages, @child will be moved
at the end.- Parameter:
child- a widget to addposition- the position to move @child to
-
scrollTo
Scrolls to @widget.
If @animate is `TRUE`, the transition will be animated.- Parameter:
widget- a child of @selfanimate- whether to animate the transition
-
setAllowLongSwipes
public void setAllowLongSwipes(boolean allow_long_swipes) Sets whether to allow swiping for more than one page at a time.
If @allow_long_swipes is `FALSE`, each swipe can only move to the adjacent
pages.- Parameter:
allow_long_swipes- whether to allow long swipes
-
setAllowMouseDrag
public void setAllowMouseDrag(boolean allow_mouse_drag) Sets whether @self can be dragged with mouse pointer.
If @allow_mouse_drag is `FALSE`, dragging is only available on touch.- Parameter:
allow_mouse_drag- whether @self can be dragged with mouse pointer
-
setAllowScrollWheel
public void setAllowScrollWheel(boolean allow_scroll_wheel) Sets whether @self will respond to scroll wheel events.
If @allow_scroll_wheel is `FALSE`, wheel events will be ignored.- Parameter:
allow_scroll_wheel- whether @self will respond to scroll wheel events
-
setInteractive
public void setInteractive(boolean interactive) Sets whether @self can be navigated.
This can be used to temporarily disable the carousel to only allow navigating
it in a certain state.- Parameter:
interactive- whether @self can be navigated
-
setRevealDuration
public void setRevealDuration(int reveal_duration) Sets the page reveal duration, in milliseconds.
Reveal duration is used when animating adding or removing pages.- Parameter:
reveal_duration- the new reveal duration value
-
setScrollParams
Sets the scroll animation spring parameters for @self.
The default value is equivalent to:
```c
adw_spring_params_new (1, 0.5, 500)
```- Parameter:
params- the new parameters
-
setSpacing
public void setSpacing(int spacing) Sets spacing between pages in pixels.- Parameter:
spacing- the new spacing value
-
onPageChanged
Connect to signal "page-changed".
SeeCarousel.OnPageChanged.onPageChanged(int)for signal description.
FieldSIGNAL_ON_PAGE_CHANGEDcontains original signal name and can be used as resource reference.- Parameter:
signal- callback function (lambda).- Gibt zurück:
SignalHandler. Can be used to disconnect signal and to release callback function.
-
asSwipeable
Implements interfaceSwipeable. Call this to get access to interface functions.- Gibt zurück:
Swipeable
-
asAccessible
Implements interfaceAccessible. Call this to get access to interface functions.- Setzt außer Kraft:
asAccessiblein KlasseWidget- Gibt zurück:
Accessible
-
asBuildable
Implements interfaceBuildable. Call this to get access to interface functions.- Setzt außer Kraft:
asBuildablein KlasseWidget- Gibt zurück:
Buildable
-
asConstraintTarget
Implements interfaceConstraintTarget. Call this to get access to interface functions.- Setzt außer Kraft:
asConstraintTargetin KlasseWidget- Gibt zurück:
ConstraintTarget
-
asOrientable
Implements interfaceOrientable. Call this to get access to interface functions.- Gibt zurück:
Orientable
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-