adw.dialog
Module for [Dialog] class
Types 3
An adaptive dialog container.
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.
DialogGidBuilder builder() static nothrowGet builder for [adw.dialog.Dialog] Returns: New builder objectbool 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.void title(string propval) @property nothrowSet `title` property. Params: propval = The title of the dialog.bool getCanClose() nothrowGets whether self can be closed. Returns: whether the dialog can be closedgtk.widget.Widget getChild() nothrowGets the child widget of self. Returns: the child widget of selfadw.breakpoint.Breakpoint getCurrentBreakpoint() nothrowGets the current breakpoint. Returns: the current breakpointgtk.widget.Widget getDefaultWidget() nothrowGets the default widget for self. Returns: the default widgetbool getFollowsContentSize() nothrowGets whether to size content of self automatically. Returns: whether to size content automaticallyadw.types.DialogPresentationMode getPresentationMode() nothrowGets presentation mode for self. Returns: the presentation modevoid setDefaultWidget(gtk.widget.Widget defaultWidget = null) nothrowSets the default 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.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.Fluent builder implementation template for adw.dialog.Dialog
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 chainingT 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 chainingT 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 chainingFluent builder for adw.dialog.Dialog