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 class@Window and class@ApplicationWindow, use [adw.dialog.Dialog.present] to show it.
[adw.dialog.Dialog] is not resizable. Use the property@Dialog:content-width and property@Dialog:content-height properties to set its size, or set property@Dialog:follows-content-size 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. property@Dialog:presentation-mode 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 property@Dialog:can-close can be used to prevent closing. In that case, signal@Dialog::close-attempt 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], class@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 property@HeaderBar:show-start-title-buttons and property@HeaderBar:show-end-title-buttons to FALSE to remove it if it's unwanted.
Breakpoints
[adw.dialog.Dialog] can be used with class@Breakpoint the same way as class@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 property@Gtk.Widget:width-request and property@Gtk.Widget:height-request properties must be set manually.
DialogGidBuilder builder()Get builder for [adw.dialog.Dialog] Returns: New builder objectvoid canClose(bool propval) @propertySet `canClose` property. Params: propval = Whether the dialog can be closed.gtk.widget.Widget child() @propertyGet `child` property. Returns: The child widget of the [adw.dialog.Dialog].void child(gtk.widget.Widget propval) @propertySet `child` property. Params: propval = The child widget of the [adw.dialog.Dialog].int contentHeight() @propertyGet `contentHeight` property. Returns: The height of the dialog's contents.void contentHeight(int propval) @propertySet `contentHeight` property. Params: propval = The height of the dialog's contents.int contentWidth() @propertyGet `contentWidth` property. Returns: The width of the dialog's contents.void contentWidth(int propval) @propertySet `contentWidth` property. Params: propval = The width of the dialog's contents.adw.breakpoint.Breakpoint currentBreakpoint() @propertyGet `currentBreakpoint` property. Returns: The current breakpoint.gtk.widget.Widget defaultWidget() @propertyGet `defaultWidget` property. Returns: The default widget.void defaultWidget(gtk.widget.Widget propval) @propertySet `defaultWidget` property. Params: propval = The default widget.void focusWidget(gtk.widget.Widget propval) @propertySet `focusWidget` property. Params: propval = The focus widget.bool followsContentSize() @propertyGet `followsContentSize` property. Returns: Whether to size content automatically.void followsContentSize(bool propval) @propertySet `followsContentSize` property. Params: propval = Whether to size content automatically.adw.types.DialogPresentationMode presentationMode() @propertyGet `presentationMode` property. Returns: The dialog's presentation mode.void presentationMode(adw.types.DialogPresentationMode propval) @propertySet `presentationMode` property. Params: propval = The dialog's presentation mode.void title(string propval) @propertySet `title` property. Params: propval = The title of the dialog.void addBreakpoint(adw.breakpoint.Breakpoint breakpoint)Adds breakpoint to self.bool close()Attempts to close self.void forceClose()Closes self.bool getCanClose()Gets whether self can be closed. Returns: whether the dialog can be closedgtk.widget.Widget getChild()Gets the child widget of self. Returns: the child widget of selfint getContentHeight()Gets the height of the dialog's contents. Returns: the content heightint getContentWidth()Gets the width of the dialog's contents. Returns: the content widthadw.breakpoint.Breakpoint getCurrentBreakpoint()Gets the current breakpoint. Returns: the current breakpointgtk.widget.Widget getDefaultWidget()Gets the default widget for self. Returns: the default widgetgtk.widget.Widget getFocus()Gets the focus widget for self. Returns: the focus widgetbool getFollowsContentSize()Gets whether to size content of self automatically. Returns: whether to size content automaticallyadw.types.DialogPresentationMode getPresentationMode()Gets presentation mode for self. Returns: the presentation modestring getTitle()Gets the title of self. Returns: the titlevoid present(gtk.widget.Widget parent = null)Presents self within parent's window.void setCanClose(bool canClose)Sets whether self can be closed.void setChild(gtk.widget.Widget child = null)Sets the child widget of self.void setContentHeight(int contentHeight)Sets the height of the dialog's contents.void setContentWidth(int contentWidth)Sets the width of the dialog's contents.void setDefaultWidget(gtk.widget.Widget defaultWidget = null)Sets the default widget for self.void setFocus(gtk.widget.Widget focus = null)Sets the focus widget for self.void setFollowsContentSize(bool followsContentSize)Sets whether to size content of self automatically.void setPresentationMode(adw.types.DialogPresentationMode presentationMode)Sets presentation mode for self.void setTitle(string title)Sets 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)Connect 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)Connect to `Closed` signal.T canClose(bool propval)Set `canClose` property. Params: propval = Whether the dialog can be closed.T child(gtk.widget.Widget propval)Set `child` property. Params: propval = The child widget of the [adw.dialog.Dialog]. Returns: Builder instance for fluent chainingT contentHeight(int propval)Set `contentHeight` property. Params: propval = The height of the dialog's contents.T contentWidth(int propval)Set `contentWidth` property. Params: propval = The width of the dialog's contents.T defaultWidget(gtk.widget.Widget propval)Set `defaultWidget` property. Params: propval = The default widget.T focusWidget(gtk.widget.Widget propval)Set `focusWidget` property. Params: propval = The focus widget. Returns: Builder instance for fluent chainingT followsContentSize(bool propval)Set `followsContentSize` property. Params: propval = Whether to size content automatically.T presentationMode(adw.types.DialogPresentationMode propval)Set `presentationMode` property. Params: propval = The dialog's presentation mode.T title(string propval)Set `title` property. Params: propval = The title of the dialog. Returns: Builder instance for fluent chaining