adw.flap

Module for [Flap] class

Types 3

An adaptive container acting like a box or an overlay.

flap-wide flap-narrow

The [adw.flap.Flap] widget can display its children like a [gtk.box.Box] does or like a [gtk.overlay.Overlay] does, according to the property@Flap:fold-policy value.

[adw.flap.Flap] 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

.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 [adw.flap.Flap] implementation of the [gtk.buildable.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

[adw.flap.Flap] 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.

Deprecated

Methods
GType _gType() @property
Flap self()Returns `this`, for use in `with` statements.
FlapGidBuilder builder()Get builder for [adw.flap.Flap] Returns: New builder object
gtk.widget.Widget content() @propertyGet `content` property. Returns: The content widget.
void content(gtk.widget.Widget propval) @propertySet `content` property. Params: propval = The content widget.
gtk.widget.Widget flap() @propertyGet `flap` property. Returns: The flap widget.
void flap(gtk.widget.Widget propval) @propertySet `flap` property. Params: propval = The flap widget.
gtk.types.PackType flapPosition() @propertyGet `flapPosition` property. Returns: The flap position.
void flapPosition(gtk.types.PackType propval) @propertySet `flapPosition` property. Params: propval = The flap position.
uint foldDuration() @propertyGet `foldDuration` property. Returns: The fold transition animation duration, in milliseconds.
void foldDuration(uint propval) @propertySet `foldDuration` property. Params: propval = The fold transition animation duration, in milliseconds.
adw.types.FlapFoldPolicy foldPolicy() @propertyGet `foldPolicy` property. Returns: The fold policy for the flap.
void foldPolicy(adw.types.FlapFoldPolicy propval) @propertySet `foldPolicy` property. Params: propval = The fold policy for the flap.
adw.types.FoldThresholdPolicy foldThresholdPolicy() @propertyGet `foldThresholdPolicy` property. Returns: Determines when the flap will fold.
void foldThresholdPolicy(adw.types.FoldThresholdPolicy propval) @propertySet `foldThresholdPolicy` property. Params: propval = Determines when the flap will fold.
bool folded() @propertyGet `folded` property. Returns: Whether the flap is currently folded.
bool locked() @propertyGet `locked` property. Returns: Whether the flap is locked.
void locked(bool propval) @propertySet `locked` property. Params: propval = Whether the flap is locked.
bool modal() @propertyGet `modal` property. Returns: Whether the flap is modal.
void modal(bool propval) @propertySet `modal` property. Params: propval = Whether the flap is modal.
bool revealFlap() @propertyGet `revealFlap` property. Returns: Whether the flap widget is revealed.
void revealFlap(bool propval) @propertySet `revealFlap` property. Params: propval = Whether the flap widget is revealed.
adw.spring_params.SpringParams revealParams() @propertyGet `revealParams` property. Returns: The reveal animation spring parameters.
void revealParams(adw.spring_params.SpringParams propval) @propertySet `revealParams` property. Params: propval = The reveal animation spring parameters.
double revealProgress() @propertyGet `revealProgress` property. Returns: The current reveal transition progress.
gtk.widget.Widget separator() @propertyGet `separator` property. Returns: The separator widget.
void separator(gtk.widget.Widget propval) @propertySet `separator` property. Params: propval = The separator widget.
bool swipeToClose() @propertyGet `swipeToClose` property. Returns: Whether the flap can be closed with a swipe gesture.
void swipeToClose(bool propval) @propertySet `swipeToClose` property. Params: propval = Whether the flap can be closed with a swipe gesture.
bool swipeToOpen() @propertyGet `swipeToOpen` property. Returns: Whether the flap can be opened with a swipe gesture.
void swipeToOpen(bool propval) @propertySet `swipeToOpen` property. Params: propval = Whether the flap can be opened with a swipe gesture.
adw.types.FlapTransitionType transitionType() @propertyGet `transitionType` property. Returns: the type of animation used for reveal and fold transitions.
void transitionType(adw.types.FlapTransitionType propval) @propertySet `transitionType` property. Params: propval = the type of animation used for reveal and fold transitions.
gtk.widget.Widget getContent()Gets the content widget for self. Returns: the content widget for self
gtk.widget.Widget getFlap()Gets the flap widget for self. Returns: the flap widget for self
gtk.types.PackType getFlapPosition()Gets the flap position for self. Returns: the flap position for self
uint getFoldDuration()Gets the fold transition animation duration for self, in milliseconds. Returns: the fold transition duration
adw.types.FlapFoldPolicy getFoldPolicy()Gets the fold policy for self. Returns: the fold policy for self
adw.types.FoldThresholdPolicy getFoldThresholdPolicy()Gets the fold threshold policy for self. Returns: the fold threshold policy
bool getFolded()Gets whether self is currently folded.
bool getLocked()Gets whether self is locked. Returns: `TRUE` if self is locked
bool getModal()Gets whether self is modal. Returns: `TRUE` if self is modal
bool getRevealFlap()Gets whether the flap widget is revealed for self. Returns: `TRUE` if the flap widget is revealed
adw.spring_params.SpringParams getRevealParams()Gets the reveal animation spring parameters for self. Returns: the reveal animation parameters
double getRevealProgress()Gets the current reveal progress for self.
gtk.widget.Widget getSeparator()Gets the separator widget for self. Returns: the separator widget for self
bool getSwipeToClose()Gets whether self can be closed with a swipe gesture. Returns: `TRUE` if self can be closed with a swipe gesture
bool getSwipeToOpen()Gets whether self can be opened with a swipe gesture. Returns: `TRUE` if self can be opened with a swipe gesture
adw.types.FlapTransitionType getTransitionType()Gets the type of animation used for reveal and fold transitions in self. Returns: the current transition type of self
void setContent(gtk.widget.Widget content = null)Sets the content widget for self.
void setFlap(gtk.widget.Widget flap = null)Sets the flap widget for self.
void setFlapPosition(gtk.types.PackType position)Sets the flap position for self.
void setFoldDuration(uint duration)Sets the fold transition animation duration for self, in milliseconds.
void setFoldPolicy(adw.types.FlapFoldPolicy policy)Sets the fold policy for self.
void setFoldThresholdPolicy(adw.types.FoldThresholdPolicy policy)Sets the fold threshold policy for self.
void setLocked(bool locked)Sets whether self is locked.
void setModal(bool modal)Sets whether self is modal.
void setRevealFlap(bool revealFlap)Sets whether the flap widget is revealed for self.
void setRevealParams(adw.spring_params.SpringParams params)Sets the reveal animation spring parameters for self.
void setSeparator(gtk.widget.Widget separator = null)Sets the separator widget for self.
void setSwipeToClose(bool swipeToClose)Sets whether self can be closed with a swipe gesture.
void setSwipeToOpen(bool swipeToOpen)Sets whether self can be opened with a swipe gesture.
void setTransitionType(adw.types.FlapTransitionType transitionType)Sets the type of animation used for reveal and fold transitions in self.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new [adw.flap.Flap]. Returns: the newly created [adw.flap.Flap]
Methods
T content(gtk.widget.Widget propval)Set `content` property. Params: propval = The content widget.
T flap(gtk.widget.Widget propval)Set `flap` property. Params: propval = The flap widget.
T flapPosition(gtk.types.PackType propval)Set `flapPosition` property. Params: propval = The flap position.
T foldDuration(uint propval)Set `foldDuration` property. Params: propval = The fold transition animation duration, in milliseconds. Returns: Builder instance for fluent chaining
T foldPolicy(adw.types.FlapFoldPolicy propval)Set `foldPolicy` property. Params: propval = The fold policy for the flap. Returns: Builder instance for fluent chaining
T foldThresholdPolicy(adw.types.FoldThresholdPolicy propval)Set `foldThresholdPolicy` property. Params: propval = Determines when the flap will fold.
T locked(bool propval)Set `locked` property. Params: propval = Whether the flap is locked.
T modal(bool propval)Set `modal` property. Params: propval = Whether the flap is modal.
T revealFlap(bool propval)Set `revealFlap` property. Params: propval = Whether the flap widget is revealed. Returns: Builder instance for fluent chaining
T revealParams(adw.spring_params.SpringParams propval)Set `revealParams` property. Params: propval = The reveal animation spring parameters.
T separator(gtk.widget.Widget propval)Set `separator` property. Params: propval = The separator widget.
T swipeToClose(bool propval)Set `swipeToClose` property. Params: propval = Whether the flap can be closed with a swipe gesture.
T swipeToOpen(bool propval)Set `swipeToOpen` property. Params: propval = Whether the flap can be opened with a swipe gesture.
T transitionType(adw.types.FlapTransitionType propval)Set `transitionType` property. Params: propval = the type of animation used for reveal and fold transitions.

Fluent builder for [adw.flap.Flap]

Methods