Class Flap
- All Implemented Interfaces:
Proxy
,Swipeable
,Accessible
,Buildable
,ConstraintTarget
,Orientable
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
Modifier and TypeClassDescriptionstatic class
Flap.Builder<B extends Flap.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
ConstructorDescriptionFlap()
Deprecated.See the migration guideFlap
(MemorySegment address) Deprecated.Create a Flap proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected Flap
asParent()
Deprecated.Returns this instance as if it were its parent type.static Flap.Builder
<? extends Flap.Builder> builder()
Deprecated.AFlap.Builder
object constructs aFlap
with the specified properties.Deprecated.getFlap()
Deprecated.Deprecated.int
Deprecated.boolean
Deprecated.Deprecated.Deprecated.boolean
Deprecated.boolean
getModal()
Deprecated.boolean
Deprecated.Deprecated.double
Deprecated.Deprecated.boolean
Deprecated.boolean
Deprecated.Deprecated.static Type
getType()
Deprecated.Get the GType of the Flap classvoid
setContent
(@Nullable Widget content) Deprecated.void
Deprecated.void
setFlapPosition
(PackType position) Deprecated.void
setFoldDuration
(int duration) Deprecated.void
setFoldPolicy
(FlapFoldPolicy policy) Deprecated.void
Deprecated.void
setLocked
(boolean locked) Deprecated.void
setModal
(boolean modal) Deprecated.void
setRevealFlap
(boolean revealFlap) Deprecated.void
setRevealParams
(SpringParams params) Deprecated.void
setSeparator
(@Nullable Widget separator) Deprecated.void
setSwipeToClose
(boolean swipeToClose) Deprecated.void
setSwipeToOpen
(boolean swipeToOpen) Deprecated.void
setTransitionType
(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, 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
-
Flap
Deprecated.Create a Flap proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
Flap
-
-
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. -
getContent
Deprecated.Gets the content widget for this Flap.- Returns:
- the content widget for this Flap
-
getFlap
Deprecated.Gets the flap widget for this Flap.- Returns:
- the flap widget for this Flap
-
getFlapPosition
Deprecated.Gets the flap position for this Flap.- Returns:
- the flap position for this Flap
-
getFoldDuration
Deprecated.Gets the fold transition animation duration for this Flap, in milliseconds.- Returns:
- the fold transition duration
-
getFoldPolicy
Deprecated.Gets the fold policy for this Flap.- Returns:
- the fold policy for this Flap
-
getFoldThresholdPolicy
Deprecated.Gets the fold threshold policy for this Flap.- Returns:
- the fold threshold policy
-
getFolded
Deprecated.Gets whether this Flap is currently folded.See
Flap:fold-policy
.- Returns:
TRUE
if this Flap is currently folded
-
getLocked
Deprecated.Gets whether this Flap is locked.- Returns:
TRUE
if this Flap is locked
-
getModal
Deprecated.Gets whether this Flap is modal.- Returns:
TRUE
if this Flap is modal
-
getRevealFlap
Deprecated.Gets whether the flap widget is revealed for this Flap.- Returns:
TRUE
if the flap widget is revealed
-
getRevealParams
Deprecated.Gets the reveal animation spring parameters for this Flap.- Returns:
- the reveal animation parameters
-
getRevealProgress
Deprecated.Gets the current reveal progress for this Flap.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 for this Flap.- Returns:
- the separator widget for this Flap
-
getSwipeToClose
Deprecated.Gets whether this Flap can be closed with a swipe gesture.- Returns:
TRUE
if this Flap can be closed with a swipe gesture
-
getSwipeToOpen
Deprecated.Gets whether this Flap can be opened with a swipe gesture.- Returns:
TRUE
if this Flap can be opened with a swipe gesture
-
getTransitionType
Deprecated.Gets the type of animation used for reveal and fold transitions in this Flap.- Returns:
- the current transition type of this Flap
-
setContent
Deprecated.Sets the content widget for this Flap.It's always displayed when unfolded, and partially visible when folded.
- Parameters:
content
- the content widget
-
setFlap
Deprecated.Sets the flap widget for this Flap.It's only visible when
Flap:reveal-progress
is greater than 0.- Parameters:
flap
- the flap widget
-
setFlapPosition
Deprecated.Sets the flap position for this Flap.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 for this Flap, in milliseconds.- Parameters:
duration
- the new duration, in milliseconds
-
setFoldPolicy
Deprecated.Sets the fold policy for this Flap.- Parameters:
policy
- the fold policy
-
setFoldThresholdPolicy
Deprecated.Sets the fold threshold policy for this Flap.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-flap
value 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 theEsc
key, 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 for this Flap.- Parameters:
revealFlap
- whether to reveal the flap widget
-
setRevealParams
Deprecated.Sets the reveal animation spring parameters for this Flap.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 for this Flap.It's displayed between content and flap when there's no shadow to display. When exactly it's visible depends on the
Flap:transition-type
value.- 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-type
value.- 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-type
value.- 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 in this Flap.Flap:flap
is transparent by default, which means the content will be seen through it withADW_FLAP_TRANSITION_TYPE_OVER
transitions; add the.background
style class to it if this is unwanted.- Parameters:
transitionType
- the new transition type
-
builder
Deprecated.AFlap.Builder
object constructs aFlap
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withFlap.Builder.build()
.
-