Class Leaflet
- All Implemented Interfaces:
Proxy
,Swipeable
,Accessible
,Buildable
,ConstraintTarget
,Orientable
The AdwLeaflet
widget can display its children like a Box
does
or like a Stack
does, adapting to size changes by switching
between the two modes.
When there is enough space the children are displayed side by side, otherwise only one is displayed and the leaflet is said to be “folded”. The threshold is dictated by the preferred minimum sizes of the children. When a leaflet is folded, the children can be navigated using swipe gestures.
The “over” and “under” transition types stack the children one on top of the other, while the “slide” transition puts the children side by side. While navigating to a child on the side or below can be performed by swiping the current child away, navigating to an upper child requires dragging it from the edge where it resides. This doesn't affect non-dragging swipes.
CSS nodes
AdwLeaflet
has a single CSS node with name leaflet
. The node will get the
style classes .folded
when it is folded, .unfolded
when it's not, or none
if it hasn't computed its fold yet.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Leaflet.Builder<B extends Leaflet.Builder<B>>
Deprecated.Inner class implementing a builder pattern to construct a GObject with properties.static class
Deprecated.Nested classes/interfaces inherited from class org.gnome.gtk.Widget
Widget.DestroyCallback, Widget.DirectionChangedCallback, Widget.HideCallback, Widget.KeynavFailedCallback, Widget.MapCallback, Widget.MnemonicActivateCallback, Widget.MoveFocusCallback, Widget.QueryTooltipCallback, Widget.RealizeCallback, Widget.ShowCallback, Widget.StateFlagsChangedCallback, Widget.UnmapCallback, Widget.UnrealizeCallback, Widget.WidgetClass, Widget.WidgetImpl
Nested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClass
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.gtk.Accessible
Accessible.AccessibleImpl, Accessible.AccessibleInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.Buildable
Buildable.BuildableIface, Buildable.BuildableImpl
Nested classes/interfaces inherited from interface org.gnome.gtk.ConstraintTarget
ConstraintTarget.ConstraintTargetImpl, ConstraintTarget.ConstraintTargetInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.Orientable
Orientable.OrientableIface, Orientable.OrientableImpl
Nested classes/interfaces inherited from interface org.gnome.adw.Swipeable
Swipeable.SwipeableImpl, Swipeable.SwipeableInterface
-
Constructor Summary
ConstructorDescriptionLeaflet()
Deprecated.See the migration guideLeaflet
(MemorySegment address) Deprecated.Create a Leaflet proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.protected Leaflet
asParent()
Deprecated.Returns this instance as if it were its parent type.static Leaflet.Builder
<? extends Leaflet.Builder> builder()
Deprecated.ALeaflet.Builder
object constructs aLeaflet
with the specified properties.getAdjacentChild
(NavigationDirection direction) Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.getChildByName
(String name) Deprecated.Deprecated.boolean
Deprecated.boolean
Deprecated.Deprecated.boolean
Deprecated.int
Deprecated.Deprecated.getPages()
Deprecated.Deprecated.static Type
getType()
Deprecated.Get the GType of the Leaflet classDeprecated.Deprecated.insertChildAfter
(Widget child, @Nullable Widget sibling) Deprecated.boolean
navigate
(NavigationDirection direction) Deprecated.Deprecated.void
Deprecated.void
reorderChildAfter
(Widget child, @Nullable Widget sibling) Deprecated.void
setCanNavigateBack
(boolean canNavigateBack) Deprecated.void
setCanNavigateForward
(boolean canNavigateForward) Deprecated.void
setCanUnfold
(boolean canUnfold) Deprecated.void
setChildTransitionParams
(SpringParams params) Deprecated.void
Deprecated.void
setHomogeneous
(boolean homogeneous) Deprecated.void
setModeTransitionDuration
(int duration) Deprecated.void
setTransitionType
(LeafletTransitionType transition) Deprecated.void
setVisibleChild
(Widget visibleChild) Deprecated.void
setVisibleChildName
(String name) Deprecated.Methods inherited from class org.gnome.gtk.Widget
actionSetEnabled, activateActionIfExists, activateDefault, activateWidget, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, cssChanged, directionChanged, disposeTemplate, dragCheckThreshold, emitDestroy, emitDirectionChanged, emitHide, emitKeynavFailed, emitMap, emitMnemonicActivate, emitMoveFocus, emitQueryTooltip, emitRealize, emitShow, emitStateFlagsChanged, emitUnmap, emitUnrealize, errorBell, focus, 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, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getMemoryLayout, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, moveFocus, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, pick, queryTooltip, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, root, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setDefaultDirection, setDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, sizeAllocate, snapshot, snapshotChild, stateFlagsChanged, systemSettingChanged, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unroot, unsetStateFlags, unsetStateFlags
Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gnome.gtk.Accessible
announce, getAccessibleParent, getAccessibleRole, getAtContext, getBounds, getFirstAccessibleChild, getNextAccessibleSibling, getPlatformState, resetProperty, resetRelation, resetState, setAccessibleParent, updateNextAccessibleSibling, updateProperty, updateRelation, updateState
Methods inherited from interface org.gnome.gtk.Buildable
getBuildableId
Methods inherited from interface org.gnome.gtk.Orientable
getOrientation, setOrientation
Methods inherited from interface org.gnome.adw.Swipeable
getCancelProgress, getDistance, getProgress, getSnapPoints, getSwipeArea
-
Constructor Details
-
Leaflet
Deprecated.Create a Leaflet proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
Leaflet
-
-
Method Details
-
getType
-
asParent
Deprecated.Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
append
Deprecated.Adds a child to this Leaflet.- Parameters:
child
- the widget to add- Returns:
- the
LeafletPage
forchild
-
getCanUnfold
Deprecated.Gets whether this Leaflet can unfold.- Returns:
- whether this Leaflet can unfold
-
getChildByName
Deprecated.Finds the child of this Leaflet withname
.Returns
NULL
if there is no child with this name.See
LeafletPage:name
.- Parameters:
name
- the name of the child to find- Returns:
- the requested child of this Leaflet
-
getChildTransitionParams
Deprecated.Gets the child transition spring parameters for this Leaflet.- Returns:
- the child transition parameters
-
getChildTransitionRunning
Deprecated.Gets whether a child transition is currently running for this Leaflet.- Returns:
- whether a transition is currently running
-
getFoldThresholdPolicy
Deprecated.Gets the fold threshold policy for this Leaflet.- Returns:
- the fold threshold policy
-
getFolded
Deprecated.Gets whether this Leaflet is folded.The leaflet will be folded if the size allocated to it is smaller than the sum of the minimum or natural sizes of the children (see
Leaflet:fold-threshold-policy
), it will be unfolded otherwise.- Returns:
- whether this Leaflet is folded.
-
getHomogeneous
Deprecated.Gets whether this Leaflet is homogeneous.- Returns:
- whether this Leaflet is homogeneous
-
getModeTransitionDuration
Deprecated.Gets the mode transition animation duration for this Leaflet.- Returns:
- the mode transition duration, in milliseconds.
-
getPage
Deprecated.Returns theLeafletPage
object forchild
.- Parameters:
child
- a child of this Leaflet- Returns:
- the page object for
child
-
getPages
Deprecated.Returns aListModel
that contains the pages of the leaflet.This can be used to keep an up-to-date view. The model also implements
SelectionModel
and can be used to track and change the visible page.- Returns:
- a
GtkSelectionModel
for the leaflet's children
-
getTransitionType
Deprecated.Gets the type of animation used for transitions between modes and children.- Returns:
- the current transition type of this Leaflet
-
getVisibleChild
Deprecated.Gets the widget currently visible when the leaflet is folded.- Returns:
- the visible child
-
getVisibleChildName
Deprecated.Gets the name of the currently visible child widget.- Returns:
- the name of the visible child
-
insertChildAfter
Deprecated.Insertschild
in the position aftersibling
in the list of children.If
sibling
isNULL
, insertschild
at the first position.- Parameters:
child
- the widget to insertsibling
- the sibling after which to insertchild
- Returns:
- the
LeafletPage
forchild
-
prepend
Deprecated.Insertschild
at the first position in this Leaflet.- Parameters:
child
- the widget to prepend- Returns:
- the
LeafletPage
forchild
-
remove
Deprecated.Removes a child widget from this Leaflet.- Parameters:
child
- the child to remove
-
reorderChildAfter
Deprecated.Moveschild
to the position aftersibling
in the list of children.If
sibling
isNULL
, moveschild
to the first position.- Parameters:
child
- the widget to move, must be a child of this Leafletsibling
- the sibling to movechild
after
-
setCanUnfold
Deprecated.Sets whether this Leaflet can unfold.- Parameters:
canUnfold
- whether this Leaflet can unfold
-
setChildTransitionParams
Deprecated.Sets the child transition spring parameters for this Leaflet.The default value is equivalent to:
adw_spring_params_new (1, 0.5, 500)
- Parameters:
params
- the new parameters
-
setFoldThresholdPolicy
Deprecated.Sets the fold threshold policy for this Leaflet.If set to
ADW_FOLD_THRESHOLD_POLICY_MINIMUM
, it will only fold when the children cannot fit anymore. WithADW_FOLD_THRESHOLD_POLICY_NATURAL
, it will fold as soon as children don't get their natural size.This can be useful if you have a long ellipsizing label and want to let it ellipsize instead of immediately folding.
- Parameters:
policy
- the policy to use
-
setHomogeneous
Deprecated.Sets this Leaflet to be homogeneous or not.If set to
FALSE
, different children can have different size along the opposite orientation.- Parameters:
homogeneous
- whether to make this Leaflet homogeneous
-
setModeTransitionDuration
Deprecated.Sets the mode transition animation duration for this Leaflet.- Parameters:
duration
- the new duration, in milliseconds
-
setTransitionType
Deprecated.Sets the type of animation used for transitions between modes and children.The transition type can be changed without problems at runtime, so it is possible to change the animation based on the mode or child that is about to become current.
- Parameters:
transition
- the new transition type
-
setVisibleChild
Deprecated.Sets the widget currently visible when the leaflet is folded.The transition is determined by
Leaflet:transition-type
andLeaflet:child-transition-params
. The transition can be cancelled by the user, in which case visible child will change back to the previously visible child.- Parameters:
visibleChild
- the new child
-
setVisibleChildName
Deprecated.Makes the child with the namename
visible.See
Leaflet:visible-child
.- Parameters:
name
- the name of a child
-
builder
Deprecated.ALeaflet.Builder
object constructs aLeaflet
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withLeaflet.Builder.build()
.
-