Class Flap
- All Implemented Interfaces:
Swipeable,Accessible,Buildable,ConstraintTarget,Orientable,Proxy
The AdwFlap widget can display its children like a Box does or
like a Overlay does, according to the
Flap:fold-policy value.
AdwFlap has at most three children: Flap:content,
Flap:flap and Flap:separator. Content is the primary
child, flap is displayed next to it when unfolded, or overlays it when
folded. Flap can be shown or hidden by changing the
Flap:reveal-flap value, as well as via swipe gestures if
Flap:swipe-to-open and/or Flap:swipe-to-close are set
to TRUE.
Optionally, a separator can be provided, which would be displayed between the content and the flap when there's no shadow to separate them, depending on the transition type.
Flap:flap is transparent by default; add the
.background style class to it if this is
unwanted.
If Flap:modal is set to TRUE, content becomes completely
inaccessible when the flap is revealed while folded.
The position of the flap and separator children relative to the content is
determined by orientation, as well as the Flap:flap-position
value.
Folding the flap will automatically hide the flap widget, and unfolding it
will automatically reveal it. If this behavior is not desired, the
Flap:locked property can be used to override it.
Common use cases include sidebars, header bars that need to be able to overlap the window content (for example, in fullscreen mode) and bottom sheets.
AdwFlap as GtkBuildable
The AdwFlap implementation of the Buildable interface supports
setting the flap child by specifying “flap” as the “type” attribute of a
<child> element, and separator by specifying “separator”. Specifying
“content” child type or omitting it results in setting the content child.
CSS nodes
AdwFlap has a single CSS node with name flap. The node will get the style
classes .folded when it is folded, and .unfolded when it's not.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFlap.Builder<B extends Flap.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
ConstructorsConstructorDescriptionFlap()Deprecated.Creates a new Flap.Flap(MemorySegment address) Deprecated.Create a Flap proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected FlapasParent()Deprecated.Returns this instance as if it were its parent type.static Flap.Builder<? extends Flap.Builder> builder()Deprecated.AFlap.Builderobject constructs aFlapwith the specified properties.@Nullable WidgetDeprecated.@Nullable WidgetgetFlap()Deprecated.Deprecated.intDeprecated.booleanDeprecated.Deprecated.Deprecated.booleanDeprecated.booleangetModal()Deprecated.booleanDeprecated.Deprecated.doubleDeprecated.@Nullable WidgetDeprecated.booleanDeprecated.booleanDeprecated.Deprecated.static @Nullable TypegetType()Deprecated.Get the GType of the Flap classvoidsetContent(@Nullable Widget content) Deprecated.voidDeprecated.voidsetFlapPosition(PackType position) Deprecated.voidsetFoldDuration(int duration) Deprecated.voidsetFoldPolicy(FlapFoldPolicy policy) Deprecated.voidDeprecated.voidsetLocked(boolean locked) Deprecated.voidsetModal(boolean modal) Deprecated.voidsetRevealFlap(boolean revealFlap) Deprecated.voidsetRevealParams(SpringParams params) Deprecated.voidsetSeparator(@Nullable Widget separator) Deprecated.voidsetSwipeToClose(boolean swipeToClose) Deprecated.voidsetSwipeToOpen(boolean swipeToOpen) Deprecated.voidsetTransitionType(FlapTransitionType transitionType) 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
-
Flap
Deprecated.Create a Flap proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
Flap
public Flap()Deprecated.Creates a new Flap.
-
-
Method Details
-
getType
Deprecated.Get the GType of the Flap 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. -
getContent
Deprecated.Gets the content widget forself.- Returns:
- the content widget for this Flap
-
getFlap
Deprecated.Gets the flap widget forself.- Returns:
- the flap widget for this Flap
-
getFlapPosition
Deprecated.Gets the flap position forself.- Returns:
- the flap position for this Flap
-
getFoldDuration
Deprecated.Gets the fold transition animation duration forself,in milliseconds.- Returns:
- the fold transition duration
-
getFoldPolicy
Deprecated.Gets the fold policy forself.- Returns:
- the fold policy for this Flap
-
getFoldThresholdPolicy
Deprecated.Gets the fold threshold policy forself.- Returns:
- the fold threshold policy
-
getFolded
Deprecated.Gets whether this Flap is currently folded.See
Flap:fold-policy.- Returns:
TRUEif this Flap is currently folded
-
getLocked
Deprecated.Gets whether this Flap is locked.- Returns:
TRUEif this Flap is locked
-
getModal
Deprecated.Gets whether this Flap is modal.- Returns:
TRUEif this Flap is modal
-
getRevealFlap
Deprecated.Gets whether the flap widget is revealed forself.- Returns:
TRUEif the flap widget is revealed
-
getRevealParams
Deprecated.Gets the reveal animation spring parameters forself.- Returns:
- the reveal animation parameters
-
getRevealProgress
Deprecated.Gets the current reveal progress forself.0 means fully hidden, 1 means fully revealed.
See
Flap:reveal-flap.- Returns:
- the current reveal progress for this Flap
-
getSeparator
Deprecated.Gets the separator widget forself.- Returns:
- the separator widget for this Flap
-
getSwipeToClose
Deprecated.Gets whether this Flap can be closed with a swipe gesture.- Returns:
TRUEif this Flap can be closed with a swipe gesture
-
getSwipeToOpen
Deprecated.Gets whether this Flap can be opened with a swipe gesture.- Returns:
TRUEif this Flap can be opened with a swipe gesture
-
getTransitionType
Deprecated.Gets the type of animation used for reveal and fold transitions inself.- Returns:
- the current transition type of this Flap
-
setContent
Deprecated.Sets the content widget forself.It's always displayed when unfolded, and partially visible when folded.
- Parameters:
content- the content widget
-
setFlap
Deprecated.Sets the flap widget forself.It's only visible when
Flap:reveal-progressis greater than 0.- Parameters:
flap- the flap widget
-
setFlapPosition
Deprecated.Sets the flap position forself.If it's set to
GTK_PACK_START, the flap is displayed before the content, ifGTK_PACK_END, it's displayed after the content.- Parameters:
position- the new value
-
setFoldDuration
Deprecated.Sets the fold transition animation duration forself,in milliseconds.- Parameters:
duration- the new duration, in milliseconds
-
setFoldPolicy
Deprecated.Sets the fold policy forself.- Parameters:
policy- the fold policy
-
setFoldThresholdPolicy
Deprecated.Sets the fold threshold policy forself.If set to
ADW_FOLD_THRESHOLD_POLICY_MINIMUM, flap 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
-
setLocked
Deprecated.Sets whether this Flap is locked.If
FALSE, folding when the flap is revealed automatically closes it, and unfolding it when the flap is not revealed opens it. IfTRUE,Flap:reveal-flapvalue never changes on its own.- Parameters:
locked- the new value
-
setModal
Deprecated.Sets whether this Flap is modal.If
TRUE, clicking the content widget while flap is revealed, as well as pressing theEsckey, will close the flap. IfFALSE, clicks are passed through to the content widget.- Parameters:
modal- whether this Flap is modal
-
setRevealFlap
Deprecated.Sets whether the flap widget is revealed forself.- Parameters:
revealFlap- whether to reveal the flap widget
-
setRevealParams
Deprecated.Sets the reveal animation spring parameters forself.The default value is equivalent to:
adw_spring_params_new (1, 0.5, 500)- Parameters:
params- the new parameters
-
setSeparator
Deprecated.Sets the separator widget forself.It's displayed between content and flap when there's no shadow to display. When exactly it's visible depends on the
Flap:transition-typevalue.- Parameters:
separator- the separator widget
-
setSwipeToClose
Deprecated.Sets whether this Flap can be closed with a swipe gesture.The area that can be swiped depends on the
Flap:transition-typevalue.- Parameters:
swipeToClose- whether this Flap can be closed with a swipe gesture
-
setSwipeToOpen
Deprecated.Sets whether this Flap can be opened with a swipe gesture.The area that can be swiped depends on the
Flap:transition-typevalue.- Parameters:
swipeToOpen- whether this Flap can be opened with a swipe gesture
-
setTransitionType
Deprecated.Sets the type of animation used for reveal and fold transitions inself.Flap:flapis transparent by default, which means the content will be seen through it withADW_FLAP_TRANSITION_TYPE_OVERtransitions; add the.backgroundstyle class to it if this is unwanted.- Parameters:
transitionType- the new transition type
-
builder
Deprecated.AFlap.Builderobject constructs aFlapwith the specified properties. Use the variousset...()methods to set properties, and finish construction withFlap.Builder.build().- Returns:
- the builder object
-