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 adw.flap.Flap.foldPolicy value.

adw.flap.Flap has at most three children: adw.flap.Flap.content, adw.flap.Flap.flap and adw.flap.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 adw.flap.Flap.revealFlap value, as well as via swipe gestures if adw.flap.Flap.swipeToOpen and/or adw.flap.Flap.swipeToClose 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.

adw.flap.Flap.flap is transparent by default; add the .background style class to it if this is unwanted.

If adw.flap.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 adw.flap.Flap.flapPosition value.

Folding the flap will automatically hide the flap widget, and unfolding it will automatically reveal it. If this behavior is not desired, the adw.flap.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 _getGType() static nothrow
GType _gType() @property nothrow
Flap self() nothrowReturns `this`, for use in `with` statements.
FlapGidBuilder builder() static nothrowGet builder for [adw.flap.Flap] Returns: New builder object
gtk.widget.Widget content() @property nothrowGet `content` property. Returns: The content widget.
void content(gtk.widget.Widget propval) @property nothrowSet `content` property. Params: propval = The content widget.
gtk.widget.Widget flap() @property nothrowGet `flap` property. Returns: The flap widget.
void flap(gtk.widget.Widget propval) @property nothrowSet `flap` property. Params: propval = The flap widget.
gtk.types.PackType flapPosition() @property nothrowGet `flapPosition` property. Returns: The flap position.
void flapPosition(gtk.types.PackType propval) @property nothrowSet `flapPosition` property. Params: propval = The flap position.
uint foldDuration() @property nothrowGet `foldDuration` property. Returns: The fold transition animation duration, in milliseconds.
void foldDuration(uint propval) @property nothrowSet `foldDuration` property. Params: propval = The fold transition animation duration, in milliseconds.
adw.types.FlapFoldPolicy foldPolicy() @property nothrowGet `foldPolicy` property. Returns: The fold policy for the flap.
void foldPolicy(adw.types.FlapFoldPolicy propval) @property nothrowSet `foldPolicy` property. Params: propval = The fold policy for the flap.
adw.types.FoldThresholdPolicy foldThresholdPolicy() @property nothrowGet `foldThresholdPolicy` property. Returns: Determines when the flap will fold.
void foldThresholdPolicy(adw.types.FoldThresholdPolicy propval) @property nothrowSet `foldThresholdPolicy` property. Params: propval = Determines when the flap will fold.
bool folded() @property nothrowGet `folded` property. Returns: Whether the flap is currently folded.
bool locked() @property nothrowGet `locked` property. Returns: Whether the flap is locked.
void locked(bool propval) @property nothrowSet `locked` property. Params: propval = Whether the flap is locked.
bool modal() @property nothrowGet `modal` property. Returns: Whether the flap is modal.
void modal(bool propval) @property nothrowSet `modal` property. Params: propval = Whether the flap is modal.
bool revealFlap() @property nothrowGet `revealFlap` property. Returns: Whether the flap widget is revealed.
void revealFlap(bool propval) @property nothrowSet `revealFlap` property. Params: propval = Whether the flap widget is revealed.
adw.spring_params.SpringParams revealParams() @property nothrowGet `revealParams` property. Returns: The reveal animation spring parameters.
void revealParams(adw.spring_params.SpringParams propval) @property nothrowSet `revealParams` property. Params: propval = The reveal animation spring parameters.
double revealProgress() @property nothrowGet `revealProgress` property. Returns: The current reveal transition progress.
gtk.widget.Widget separator() @property nothrowGet `separator` property. Returns: The separator widget.
void separator(gtk.widget.Widget propval) @property nothrowSet `separator` property. Params: propval = The separator widget.
bool swipeToClose() @property nothrowGet `swipeToClose` property. Returns: Whether the flap can be closed with a swipe gesture.
void swipeToClose(bool propval) @property nothrowSet `swipeToClose` property. Params: propval = Whether the flap can be closed with a swipe gesture.
bool swipeToOpen() @property nothrowGet `swipeToOpen` property. Returns: Whether the flap can be opened with a swipe gesture.
void swipeToOpen(bool propval) @property nothrowSet `swipeToOpen` property. Params: propval = Whether the flap can be opened with a swipe gesture.
adw.types.FlapTransitionType transitionType() @property nothrowGet `transitionType` property. Returns: the type of animation used for reveal and fold transitions.
void transitionType(adw.types.FlapTransitionType propval) @property nothrowSet `transitionType` property. Params: propval = the type of animation used for reveal and fold transitions.
gtk.widget.Widget getContent() nothrowGets the content widget for self. Returns: the content widget for self
gtk.widget.Widget getFlap() nothrowGets the flap widget for self. Returns: the flap widget for self
gtk.types.PackType getFlapPosition() nothrowGets the flap position for self. Returns: the flap position for self
uint getFoldDuration() nothrowGets the fold transition animation duration for self, in milliseconds. Returns: the fold transition duration
adw.types.FlapFoldPolicy getFoldPolicy() nothrowGets the fold policy for self. Returns: the fold policy for self
adw.types.FoldThresholdPolicy getFoldThresholdPolicy() nothrowGets the fold threshold policy for self. Returns: the fold threshold policy
bool getFolded() nothrowGets whether self is currently folded.
bool getLocked() nothrowGets whether self is locked. Returns: `TRUE` if self is locked
bool getModal() nothrowGets whether self is modal. Returns: `TRUE` if self is modal
bool getRevealFlap() nothrowGets whether the flap widget is revealed for self. Returns: `TRUE` if the flap widget is revealed
adw.spring_params.SpringParams getRevealParams() nothrowGets the reveal animation spring parameters for self. Returns: the reveal animation parameters
double getRevealProgress() nothrowGets the current reveal progress for self.
gtk.widget.Widget getSeparator() nothrowGets the separator widget for self. Returns: the separator widget for self
bool getSwipeToClose() nothrowGets whether self can be closed with a swipe gesture. Returns: `TRUE` if self can be closed with a swipe gesture
bool getSwipeToOpen() nothrowGets whether self can be opened with a swipe gesture. Returns: `TRUE` if self can be opened with a swipe gesture
adw.types.FlapTransitionType getTransitionType() nothrowGets 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) nothrowSets the content widget for self.
void setFlap(gtk.widget.Widget flap = null) nothrowSets the flap widget for self.
void setFlapPosition(gtk.types.PackType position) nothrowSets the flap position for self.
void setFoldDuration(uint duration) nothrowSets the fold transition animation duration for self, in milliseconds.
void setFoldPolicy(adw.types.FlapFoldPolicy policy) nothrowSets the fold policy for self.
void setFoldThresholdPolicy(adw.types.FoldThresholdPolicy policy) nothrowSets the fold threshold policy for self.
void setLocked(bool locked) nothrowSets whether self is locked.
void setModal(bool modal) nothrowSets whether self is modal.
void setRevealFlap(bool revealFlap) nothrowSets whether the flap widget is revealed for self.
void setRevealParams(adw.spring_params.SpringParams params) nothrowSets the reveal animation spring parameters for self.
void setSeparator(gtk.widget.Widget separator = null) nothrowSets the separator widget for self.
void setSwipeToClose(bool swipeToClose) nothrowSets whether self can be closed with a swipe gesture.
void setSwipeToOpen(bool swipeToOpen) nothrowSets whether self can be opened with a swipe gesture.
void setTransitionType(adw.types.FlapTransitionType transitionType) nothrowSets 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]

Fluent builder implementation template for adw.flap.Flap

Methods
T content(gtk.widget.Widget propval) nothrowSet `content` property. Params: propval = The content widget.
T flap(gtk.widget.Widget propval) nothrowSet `flap` property. Params: propval = The flap widget.
T flapPosition(gtk.types.PackType propval) nothrowSet `flapPosition` property. Params: propval = The flap position.
T foldDuration(uint propval) nothrowSet `foldDuration` property. Params: propval = The fold transition animation duration, in milliseconds. Returns: Builder instance for fluent chaining
T foldPolicy(adw.types.FlapFoldPolicy propval) nothrowSet `foldPolicy` property. Params: propval = The fold policy for the flap. Returns: Builder instance for fluent chaining
T foldThresholdPolicy(adw.types.FoldThresholdPolicy propval) nothrowSet `foldThresholdPolicy` property. Params: propval = Determines when the flap will fold.
T locked(bool propval) nothrowSet `locked` property. Params: propval = Whether the flap is locked.
T modal(bool propval) nothrowSet `modal` property. Params: propval = Whether the flap is modal.
T revealFlap(bool propval) nothrowSet `revealFlap` property. Params: propval = Whether the flap widget is revealed. Returns: Builder instance for fluent chaining
T revealParams(adw.spring_params.SpringParams propval) nothrowSet `revealParams` property. Params: propval = The reveal animation spring parameters.
T separator(gtk.widget.Widget propval) nothrowSet `separator` property. Params: propval = The separator widget.
T swipeToClose(bool propval) nothrowSet `swipeToClose` property. Params: propval = Whether the flap can be closed with a swipe gesture.
T swipeToOpen(bool propval) nothrowSet `swipeToOpen` property. Params: propval = Whether the flap can be opened with a swipe gesture.
T transitionType(adw.types.FlapTransitionType propval) nothrowSet `transitionType` property. Params: propval = the type of animation used for reveal and fold transitions.

Fluent builder for adw.flap.Flap

Methods
Flap build() nothrowCreate object from builder. Returns: New object