Class Leaflet
- All Implemented Interfaces:
Swipeable,Accessible,Buildable,ConstraintTarget,Orientable,Proxy
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
Nested ClassesModifier and TypeClassDescriptionstatic classLeaflet.Builder<B extends Leaflet.Builder<B>>Deprecated.Inner class implementing a builder pattern to construct a GObject with properties.static classDeprecated.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.Widget$Impl, Widget.WidgetClassNested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClassNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface org.gnome.gtk.Accessible
Accessible.Accessible$Impl, Accessible.AccessibleInterfaceNested classes/interfaces inherited from interface org.gnome.gtk.Buildable
Buildable.Buildable$Impl, Buildable.BuildableIfaceNested classes/interfaces inherited from interface org.gnome.gtk.ConstraintTarget
ConstraintTarget.ConstraintTarget$Impl, ConstraintTarget.ConstraintTargetInterfaceNested classes/interfaces inherited from interface org.gnome.gtk.Orientable
Orientable.Orientable$Impl, Orientable.OrientableIfaceNested classes/interfaces inherited from interface org.gnome.adw.Swipeable
Swipeable.Swipeable$Impl, Swipeable.SwipeableInterface -
Constructor Summary
ConstructorsConstructorDescriptionLeaflet()Deprecated.Creates a new Leaflet.Leaflet(MemorySegment address) Deprecated.Create a Leaflet proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.protected LeafletasParent()Deprecated.Returns this instance as if it were its parent type.static Leaflet.Builder<? extends Leaflet.Builder> builder()Deprecated.ALeaflet.Builderobject constructs aLeafletwith the specified properties.@Nullable WidgetgetAdjacentChild(NavigationDirection direction) Deprecated.booleanDeprecated.booleanDeprecated.booleanDeprecated.@Nullable WidgetgetChildByName(String name) Deprecated.Deprecated.booleanDeprecated.booleanDeprecated.Deprecated.booleanDeprecated.intDeprecated.Deprecated.getPages()Deprecated.Deprecated.static @Nullable TypegetType()Deprecated.Get the GType of the Leaflet class@Nullable WidgetDeprecated.@Nullable StringDeprecated.insertChildAfter(Widget child, @Nullable Widget sibling) Deprecated.booleannavigate(NavigationDirection direction) Deprecated.Deprecated.voidDeprecated.voidreorderChildAfter(Widget child, @Nullable Widget sibling) Deprecated.voidsetCanNavigateBack(boolean canNavigateBack) Deprecated.voidsetCanNavigateForward(boolean canNavigateForward) Deprecated.voidsetCanUnfold(boolean canUnfold) Deprecated.voidsetChildTransitionParams(SpringParams params) Deprecated.voidDeprecated.voidsetHomogeneous(boolean homogeneous) Deprecated.voidsetModeTransitionDuration(int duration) Deprecated.voidsetTransitionType(LeafletTransitionType transition) Deprecated.voidsetVisibleChild(Widget visibleChild) Deprecated.voidsetVisibleChildName(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, getLimitEvents, 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, setLimitEvents, 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, unsetStateFlagsMethods 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, 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, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gnome.gtk.Accessible
announce, getAccessibleParent, getAccessibleRole, getAtContext, getBounds, getFirstAccessibleChild, getNextAccessibleSibling, getPlatformState, resetProperty, resetRelation, resetState, setAccessibleParent, updateNextAccessibleSibling, updatePlatformState, updateProperty, updateRelation, updateStateMethods inherited from interface org.gnome.gtk.Buildable
getBuildableIdMethods inherited from interface org.gnome.gtk.Orientable
getOrientation, setOrientationMethods 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
public Leaflet()Deprecated.Creates a new Leaflet.
-
-
Method Details
-
getType
Deprecated.Get the GType of the Leaflet class- Returns:
- the GType
-
asParent
Deprecated.Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, 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 toself.- Parameters:
child- the widget to add- Returns:
- the
LeafletPageforchild
-
getCanUnfold
Deprecated.Gets whether this Leaflet can unfold.- Returns:
- whether this Leaflet can unfold
-
getChildByName
Deprecated.Finds the child of this Leaflet withname.Returns
NULLif 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 forself.- Returns:
- the child transition parameters
-
getChildTransitionRunning
Deprecated.Gets whether a child transition is currently running forself.- Returns:
- whether a transition is currently running
-
getFoldThresholdPolicy
Deprecated.Gets the fold threshold policy forself.- 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 forself.- Returns:
- the mode transition duration, in milliseconds.
-
getPage
Deprecated.Returns theLeafletPageobject forchild.- Parameters:
child- a child of this Leaflet- Returns:
- the page object for
child
-
getPages
Deprecated.Returns aListModelthat contains the pages of the leaflet.This can be used to keep an up-to-date view. The model also implements
SelectionModeland can be used to track and change the visible page.- Returns:
- a
GtkSelectionModelfor 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.Insertschildin the position aftersiblingin the list of children.If
siblingisNULL, insertschildat the first position.- Parameters:
child- the widget to insertsibling- the sibling after which to insertchild- Returns:
- the
LeafletPageforchild
-
prepend
Deprecated.Insertschildat the first position inself.- Parameters:
child- the widget to prepend- Returns:
- the
LeafletPageforchild
-
remove
Deprecated.Removes a child widget fromself.- Parameters:
child- the child to remove
-
reorderChildAfter
Deprecated.Moveschildto the position aftersiblingin the list of children.If
siblingisNULL, moveschildto the first position.- Parameters:
child- the widget to move, must be a child of this Leafletsibling- the sibling to movechildafter
-
setCanUnfold
Deprecated.Sets whether this Leaflet can unfold.- Parameters:
canUnfold- whether this Leaflet can unfold
-
setChildTransitionParams
Deprecated.Sets the child transition spring parameters forself.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 forself.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 forself.- 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-typeandLeaflet: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 namenamevisible.See
Leaflet:visible-child.- Parameters:
name- the name of a child
-
builder
Deprecated.ALeaflet.Builderobject constructs aLeafletwith the specified properties. Use the variousset...()methods to set properties, and finish construction withLeaflet.Builder.build().- Returns:
- the builder object
-