adw.dialog

Module for [Dialog] class

Types 3

An adaptive dialog container.

dialog-floating dialog-bottom

adw.dialog.Dialog is similar to a window, but is shown within another window. It can be used with adw.window.Window and adw.application_window.ApplicationWindow, use adw.dialog.Dialog.present to show it.

adw.dialog.Dialog is not resizable. Use the adw.dialog.Dialog.contentWidth and adw.dialog.Dialog.contentHeight properties to set its size, or set adw.dialog.Dialog.followsContentSize to TRUE to make the dialog track the content's size as it changes. adw.dialog.Dialog can never be larger than its parent window.

adw.dialog.Dialog can be presented as a centered floating window or a bottom sheet. By default it's automatic depending on the available size. adw.dialog.Dialog.presentationMode can be used to change that.

adw.dialog.Dialog can be closed via adw.dialog.Dialog.close.

When presented as a bottom sheet, adw.dialog.Dialog can also be closed via swiping it down.

The adw.dialog.Dialog.canClose can be used to prevent closing. In that case, adw.dialog.Dialog.closeAttempt gets emitted instead.

Use adw.dialog.Dialog.forceClose to close the dialog even when can-close is set to FALSE.

Header Bar Integration

When placed inside an adw.dialog.Dialog, adw.header_bar.HeaderBar will display the dialog title instead of window title. It will also adjust the decoration layout to ensure it always has a close button and nothing else. Set adw.header_bar.HeaderBar.showStartTitleButtons and adw.header_bar.HeaderBar.showEndTitleButtons to FALSE to remove it if it's unwanted.

Breakpoints

adw.dialog.Dialog can be used with adw.breakpoint.Breakpoint the same way as adw.breakpoint_bin.BreakpointBin. Refer to that widget's documentation for details.

Like adw.breakpoint_bin.BreakpointBin, if breakpoints are used, adw.dialog.Dialog doesn't have a minimum size, and gtk.widget.Widget.widthRequest and gtk.widget.Widget.heightRequest properties must be set manually.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
Dialog self() nothrowReturns `this`, for use in `with` statements.
DialogGidBuilder builder() static nothrowGet builder for [adw.dialog.Dialog] Returns: New builder object
bool canClose() @property nothrowGet `canClose` property. Returns: Whether the dialog can be closed.
void canClose(bool propval) @property nothrowSet `canClose` property. Params: propval = Whether the dialog can be closed.
gtk.widget.Widget child() @property nothrowGet `child` property. Returns: The child widget of the [adw.dialog.Dialog].
void child(gtk.widget.Widget propval) @property nothrowSet `child` property. Params: propval = The child widget of the [adw.dialog.Dialog].
int contentHeight() @property nothrowGet `contentHeight` property. Returns: The height of the dialog's contents.
void contentHeight(int propval) @property nothrowSet `contentHeight` property. Params: propval = The height of the dialog's contents.
int contentWidth() @property nothrowGet `contentWidth` property. Returns: The width of the dialog's contents.
void contentWidth(int propval) @property nothrowSet `contentWidth` property. Params: propval = The width of the dialog's contents.
adw.breakpoint.Breakpoint currentBreakpoint() @property nothrowGet `currentBreakpoint` property. Returns: The current breakpoint.
gtk.widget.Widget defaultWidget() @property nothrowGet `defaultWidget` property. Returns: The default widget.
void defaultWidget(gtk.widget.Widget propval) @property nothrowSet `defaultWidget` property. Params: propval = The default widget.
gtk.widget.Widget focusWidget() @property nothrowGet `focusWidget` property. Returns: The focus widget.
void focusWidget(gtk.widget.Widget propval) @property nothrowSet `focusWidget` property. Params: propval = The focus widget.
bool followsContentSize() @property nothrowGet `followsContentSize` property. Returns: Whether to size content automatically.
void followsContentSize(bool propval) @property nothrowSet `followsContentSize` property. Params: propval = Whether to size content automatically.
adw.types.DialogPresentationMode presentationMode() @property nothrowGet `presentationMode` property. Returns: The dialog's presentation mode.
void presentationMode(adw.types.DialogPresentationMode propval) @property nothrowSet `presentationMode` property. Params: propval = The dialog's presentation mode.
string title() @property nothrowGet `title` property. Returns: The title of the dialog.
void title(string propval) @property nothrowSet `title` property. Params: propval = The title of the dialog.
void addBreakpoint(adw.breakpoint.Breakpoint breakpoint) nothrowAdds breakpoint to self.
bool close() nothrowAttempts to close self.
void forceClose() nothrowCloses self.
bool getCanClose() nothrowGets whether self can be closed. Returns: whether the dialog can be closed
gtk.widget.Widget getChild() nothrowGets the child widget of self. Returns: the child widget of self
int getContentHeight() nothrowGets the height of the dialog's contents. Returns: the content height
int getContentWidth() nothrowGets the width of the dialog's contents. Returns: the content width
adw.breakpoint.Breakpoint getCurrentBreakpoint() nothrowGets the current breakpoint. Returns: the current breakpoint
gtk.widget.Widget getDefaultWidget() nothrowGets the default widget for self. Returns: the default widget
gtk.widget.Widget getFocus() nothrowGets the focus widget for self. Returns: the focus widget
bool getFollowsContentSize() nothrowGets whether to size content of self automatically. Returns: whether to size content automatically
adw.types.DialogPresentationMode getPresentationMode() nothrowGets presentation mode for self. Returns: the presentation mode
string getTitle() nothrowGets the title of self. Returns: the title
void present(gtk.widget.Widget parent = null) nothrowPresents self within parent's window.
void setCanClose(bool canClose) nothrowSets whether self can be closed.
void setChild(gtk.widget.Widget child = null) nothrowSets the child widget of self.
void setContentHeight(int contentHeight) nothrowSets the height of the dialog's contents.
void setContentWidth(int contentWidth) nothrowSets the width of the dialog's contents.
void setDefaultWidget(gtk.widget.Widget defaultWidget = null) nothrowSets the default widget for self.
void setFocus(gtk.widget.Widget focus = null) nothrowSets the focus widget for self.
void setFollowsContentSize(bool followsContentSize) nothrowSets whether to size content of self automatically.
void setPresentationMode(adw.types.DialogPresentationMode presentationMode) nothrowSets presentation mode for self.
void setTitle(string title) nothrowSets the title of self.
gulong connectCloseAttempt(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : adw.dialog.Dialog))) && Parameters!T.length < 2) nothrowConnect to `CloseAttempt` signal.
gulong connectClosed(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : adw.dialog.Dialog))) && Parameters!T.length < 2) nothrowConnect to `Closed` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new [adw.dialog.Dialog]. Returns: the new created [adw.dialog.Dialog]

Fluent builder implementation template for adw.dialog.Dialog

Methods
T canClose(bool propval) nothrowSet `canClose` property. Params: propval = Whether the dialog can be closed.
T child(gtk.widget.Widget propval) nothrowSet `child` property. Params: propval = The child widget of the [adw.dialog.Dialog]. Returns: Builder instance for fluent chaining
T contentHeight(int propval) nothrowSet `contentHeight` property. Params: propval = The height of the dialog's contents.
T contentWidth(int propval) nothrowSet `contentWidth` property. Params: propval = The width of the dialog's contents.
T defaultWidget(gtk.widget.Widget propval) nothrowSet `defaultWidget` property. Params: propval = The default widget.
T focusWidget(gtk.widget.Widget propval) nothrowSet `focusWidget` property. Params: propval = The focus widget. Returns: Builder instance for fluent chaining
T followsContentSize(bool propval) nothrowSet `followsContentSize` property. Params: propval = Whether to size content automatically.
T presentationMode(adw.types.DialogPresentationMode propval) nothrowSet `presentationMode` property. Params: propval = The dialog's presentation mode.
T title(string propval) nothrowSet `title` property. Params: propval = The title of the dialog. Returns: Builder instance for fluent chaining

Fluent builder for adw.dialog.Dialog

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