It derives from <GtkWidget>.
An adaptive dialog container.
<AdwDialog> is similar to a window, but is shown
within another window. It can be used with Window and
ApplicationWindow, use Dialog.present to show it.
<AdwDialog> is not resizable. Use the
Dialog:content-width and Dialog:content-height properties
to set its size, or set Dialog:follows-content-size to
TRUE to make the dialog track the content’s size as it changes.
<AdwDialog> can never be larger than its parent
window.
<AdwDialog> can be presented as a centered floating
window or a bottom sheet. By default it’s automatic depending on the
available size. Dialog:presentation-mode can be used to change
that.
<AdwDialog> can be closed via Dialog.close.
When presented as a bottom sheet, <AdwDialog> can
also be closed via swiping it down.
The Dialog:can-close can be used to prevent closing. In that
case, "close-attempt" gets emitted instead.
Use Dialog.force_close to close the dialog even when
can-close is set to FALSE.
<AdwDialog> is transient and doesn’t integrate with
the window below it, for example it’s not possible to collapse it into a
bottom bar. See BottomSheet for persistent and more tightly
integrated bottom sheets.
When placed inside an <AdwDialog>, 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 HeaderBar:show-start-title-buttons and
HeaderBar:show-end-title-buttons to FALSE to remove it if
it’s unwanted.
<AdwDialog> can be used with Breakpoint the
same way as BreakpointBin. Refer to that widget’s documentation
for details.
Like <AdwBreakpointBin>, if breakpoints are
used, <AdwDialog> doesn’t have a minimum size, and
widget:width-request and
widget:height-request
properties must be set manually.
parent-instanceWhether the dialog can be closed.
If set to FALSE, the close button, shortcuts and
Dialog.close will result in "close-attempt" being emitted
instead, and bottom sheet close swipe will be disabled.
Dialog.force_close still works.
Its value is a boolean.
Set it with (set! (dialog:can-close self) value).
The child widget of the <AdwDialog>.
Its value is a <GtkWidget>, or #f.
Set it with (set! (dialog:child self) value).
The height of the dialog’s contents.
Set it to -1 to reset it to the content’s natural height.
See also: window:default-height
Its value is a 32-bit integer.
Set it with (set! (dialog:content-height self) value).
The width of the dialog’s contents.
Set it to -1 to reset it to the content’s natural width.
See also: window:default-width
Its value is a 32-bit integer.
Set it with (set! (dialog:content-width self) value).
The current breakpoint.
Its value is a <AdwBreakpoint>, or #f.
It is read only.
The default widget.
It’s activated when the user presses Enter.
Its value is a <GtkWidget>, or #f.
Set it with (set! (dialog:default-widget self) value).
The focus widget.
Its value is a <GtkWidget>, or #f.
Set it with (set! (dialog:focus-widget self) value).
Whether to size content automatically.
If set to TRUE, always use the content’s natural size instead of
Dialog:content-width and Dialog:content-height. If the
content resizes, the dialog will immediately resize as well.
See also: window:resizable
Its value is a boolean.
Set it with (set! (dialog:follows-content-size self) value).
The dialog’s presentation mode.
When set to Adw.DialogPresentationMode.auto, the dialog appears
as a bottom sheet when the following condition is met: max-width:
450px or max-height: 360px, and as a floating window otherwise.
Set it to Adw.DialogPresentationMode.floating or
Adw.DialogPresentationMode.bottom-sheet to always present it a
floating window or a bottom sheet respectively, regardless of available
size.
Presentation mode does nothing for dialogs presented as a window.
Its value is a
<AdwDialogPresentationMode> (or, to
set it, one of its symbols).
Set it with (set! (dialog:presentation-mode self) value).
The title of the dialog.
Its value is a string, or #f.
Set it with (set! (dialog:title self) value).
Adds breakpoint to self.
Passed: a <AdwDialog>.
a dialog
Passed: a <AdwBreakpoint>.
the breakpoint to add
Attempts to close self.
If the Dialog:can-close property is set to FALSE, the
"close-attempt" signal is emitted.
See also: Dialog.force_close.
Passed: a <AdwDialog>.
a dialog
Returned: a boolean.
whether self was successfully closed
Closes self.
Unlike Dialog.close, it succeeds even if Dialog:can-close
is set to FALSE.
Passed: a <AdwDialog>.
a dialog
Gets whether self can be closed.
Passed: a <AdwDialog>.
a dialog
Returned: a boolean.
whether the dialog can be closed
Gets the child widget of self.
Passed: a <AdwDialog>.
a dialog
Returned: a <GtkWidget>, or #f.
the child widget of self
Gets the height of the dialog’s contents.
Passed: a <AdwDialog>.
a dialog
Returned: a 32-bit integer.
the content height
Gets the width of the dialog’s contents.
Passed: a <AdwDialog>.
a dialog
Returned: a 32-bit integer.
the content width
Gets the current breakpoint.
Passed: a <AdwDialog>.
a dialog
Returned: a <AdwBreakpoint>, or #f.
the current breakpoint
Gets the default widget for self.
Passed: a <AdwDialog>.
a dialog
Returned: a <GtkWidget>, or #f.
the default widget
Gets the focus widget for self.
Passed: a <AdwDialog>.
a dialog
Returned: a <GtkWidget>, or #f.
the focus widget
Gets whether to size content of self automatically.
Passed: a <AdwDialog>.
a dialog
Returned: a boolean.
whether to size content automatically
Gets presentation mode for self.
Passed: a <AdwDialog>.
a dialog
Returned: a
<AdwDialogPresentationMode>.
the presentation mode
Gets the title of self.
Passed: a <AdwDialog>.
a dialog
Returned: a string.
the title
Creates a new <AdwDialog>.
Returned: a <AdwDialog>.
the new created <AdwDialog>
Presents self within parent’s window.
If self is already shown, raises it to the top instead.
If the window is an Window or ApplicationWindow, the
dialog will be shown within it. Otherwise, it will be a separate
window.
Passed: a <AdwDialog>.
a dialog
Passed, or left out: a <GtkWidget>, or
#f.
a widget within the toplevel
Sets whether self can be closed.
If set to FALSE, the close button, shortcuts and
Dialog.close will result in "close-attempt" being emitted
instead, and bottom sheet close swipe will be disabled.
Dialog.force_close still works.
Passed: a <AdwDialog>.
a dialog
Passed: a boolean.
whether to allow closing
Sets the child widget of self.
Passed: a <AdwDialog>.
a dialog
Passed, or left out: a <GtkWidget>, or
#f.
the child widget
Sets the height of the dialog’s contents.
Set it to -1 to reset it to the content’s natural height.
See also: window:default-height
Passed: a <AdwDialog>.
a dialog
Passed: a 32-bit integer.
the content height
Sets the width of the dialog’s contents.
Set it to -1 to reset it to the content’s natural width.
See also: window:default-width
Passed: a <AdwDialog>.
a dialog
Passed: a 32-bit integer.
the content width
Sets the default widget for self.
It’s activated when the user presses Enter.
Passed: a <AdwDialog>.
a dialog
Passed, or left out: a <GtkWidget>, or
#f.
the default widget
Sets the focus widget for self.
If focus is not the current focus widget, and is focusable, sets it as the focus widget for the dialog.
If focus is NULL, unsets the focus widget for this dialog. To
set the focus to a particular widget in the dialog, it is usually more
convenient to use widget:grab-focus?
instead of this function.
Passed: a <AdwDialog>.
a dialog
Passed, or left out: a <GtkWidget>, or
#f.
the focus widget
Sets whether to size content of self automatically.
If set to TRUE, always use the content’s natural size instead of
Dialog:content-width and Dialog:content-height. If the
content resizes, the dialog will immediately resize as well.
See also: window:resizable
Passed: a <AdwDialog>.
a dialog
Passed: a boolean.
whether to size content automatically
Sets presentation mode for self.
When set to Adw.DialogPresentationMode.auto, the dialog appears
as a bottom sheet when the following condition is met: max-width:
450px or max-height: 360px, and as a floating window otherwise.
Set it to Adw.DialogPresentationMode.floating or
Adw.DialogPresentationMode.bottom-sheet to always present it a
floating window or a bottom sheet respectively, regardless of available
size.
Presentation mode does nothing for dialogs presented as a window.
Passed: a <AdwDialog>.
a dialog
Passed: a
<AdwDialogPresentationMode>, or one
of its symbols.
the new presentation mode
Sets the title of self.
Passed: a <AdwDialog>.
a dialog
Passed: a string.
the new title
Connect a handler with (connect object dialog:close-attempt
handler). It is called as (handler self).
Emitted when the close button or shortcut is used, or
Dialog.close is called while Dialog:can-close is set to
FALSE.
Passed: a <AdwDialog>.
Connect a handler with (connect object dialog:closed handler). It
is called as (handler self).
Emitted when the dialog is successfully closed.
Passed: a <AdwDialog>.
To override it in a new class, give register-type #:vfuncs
`((close-attempt . ,procedure)). The procedure is called as
(procedure self).
Passed: the class whose implementation to call:
<AdwDialog>, or a class that derives from it, or
its GType number.
Passed: a <AdwDialog>.
To override it in a new class, give register-type #:vfuncs
`((closed . ,procedure)). The procedure is called as (procedure
self).
Passed: the class whose implementation to call:
<AdwDialog>, or a class that derives from it, or
its GType number.
Passed: a <AdwDialog>.