Flap

class Flap(pointer: <Error class: unknown class><<Error class: unknown class>>) : Swipeable

An adaptive container acting like a box or an overlay.

flap-wide flap-narrow

The AdwFlap widget can display its children like a class@Gtk.Box does or like a class@Gtk.Overlay does, according to the property@Flap:fold-policy value.

AdwFlap has at most three children: property@Flap:content, property@Flap:flap and property@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 property@Flap:reveal-flap value, as well as via swipe gestures if property@Flap:swipe-to-open and/or property@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.

property@Flap:flap is transparent by default; add the style-classes.html#background style class to it if this is unwanted.

If property@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 property@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 property@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 iface@Gtk.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.

Constructors

Link copied to clipboard
constructor()

Creates a new AdwFlap.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val adwFlapPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val adwSwipeablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
var content: <Error class: unknown class>?

The content widget.

Link copied to clipboard
var flap: <Error class: unknown class>?

The flap widget.

Link copied to clipboard
var flapPosition: <Error class: unknown class>

The flap position.

Link copied to clipboard
var foldDuration: <Error class: unknown class>

The fold transition animation duration, in milliseconds.

Link copied to clipboard

Whether the flap is currently folded.

Link copied to clipboard

The fold policy for the flap.

Link copied to clipboard

Determines when the flap will fold.

Link copied to clipboard
open val gtkAccessiblePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val gtkBuildablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val gtkConstraintTargetPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val gtkOrientablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

Whether the flap is locked.

Link copied to clipboard

Whether the flap is modal.

Link copied to clipboard

Whether the flap widget is revealed.

Link copied to clipboard

The reveal animation spring parameters.

Link copied to clipboard

The current reveal transition progress.

Link copied to clipboard
var separator: <Error class: unknown class>?

The separator widget.

Link copied to clipboard

Whether the flap can be closed with a swipe gesture.

Link copied to clipboard

Whether the flap can be opened with a swipe gesture.

Link copied to clipboard

the type of animation used for reveal and fold transitions.

Functions

Link copied to clipboard

Gets the progress @self will snap back to after the gesture is canceled.

Link copied to clipboard
fun getContent(): <Error class: unknown class>?

Gets the content widget for @self.

Link copied to clipboard
open fun getDistance(): Double

Gets the swipe distance of @self.

Link copied to clipboard
fun getFlap(): <Error class: unknown class>?

Gets the flap widget for @self.

Link copied to clipboard
fun getFlapPosition(): <Error class: unknown class>

Gets the flap position for @self.

Link copied to clipboard
fun getFoldDuration(): <Error class: unknown class>

Gets the fold transition animation duration for @self, in milliseconds.

Link copied to clipboard

Gets whether @self is currently folded.

Link copied to clipboard

Gets the fold policy for @self.

Link copied to clipboard

Gets the fold threshold policy for @self.

Link copied to clipboard

Gets whether @self is locked.

Link copied to clipboard

Gets whether @self is modal.

Link copied to clipboard
open fun getProgress(): Double

Gets the current progress of @self.

Link copied to clipboard

Gets whether the flap widget is revealed for @self.

Link copied to clipboard

Gets the reveal animation spring parameters for @self.

Link copied to clipboard

Gets the current reveal progress for @self.

Link copied to clipboard
fun getSeparator(): <Error class: unknown class>?

Gets the separator widget for @self.

Link copied to clipboard
open fun getSwipeArea(navigationDirection: NavigationDirection, isDrag: Boolean, rect: <Error class: unknown class>)

Gets the area @self can start a swipe from for the given direction and gesture type.

Link copied to clipboard

Gets whether @self can be closed with a swipe gesture.

Link copied to clipboard

Gets whether @self can be opened with a swipe gesture.

Link copied to clipboard

Gets the type of animation used for reveal and fold transitions in @self.

Link copied to clipboard
fun setContent(content: <Error class: unknown class>? = null)

Sets the content widget for @self.

Link copied to clipboard
fun setFlap(flap: <Error class: unknown class>? = null)

Sets the flap widget for @self.

Link copied to clipboard
fun setFlapPosition(position: <Error class: unknown class>)

Sets the flap position for @self.

Link copied to clipboard
fun setFoldDuration(duration: <Error class: unknown class>)

Sets the fold transition animation duration for @self, in milliseconds.

Link copied to clipboard

Sets the fold policy for @self.

Link copied to clipboard

Sets the fold threshold policy for @self.

Link copied to clipboard
fun setLocked(locked: Boolean)

Sets whether @self is locked.

Link copied to clipboard
fun setModal(modal: Boolean)

Sets whether @self is modal.

Link copied to clipboard
fun setRevealFlap(revealFlap: Boolean)

Sets whether the flap widget is revealed for @self.

Link copied to clipboard

Sets the reveal animation spring parameters for @self.

Link copied to clipboard
fun setSeparator(separator: <Error class: unknown class>? = null)

Sets the separator widget for @self.

Link copied to clipboard
fun setSwipeToClose(swipeToClose: Boolean)

Sets whether @self can be closed with a swipe gesture.

Link copied to clipboard
fun setSwipeToOpen(swipeToOpen: Boolean)

Sets whether @self can be opened with a swipe gesture.

Link copied to clipboard

Sets the type of animation used for reveal and fold transitions in @self.