Dialog

open class Dialog(pointer: <Error class: unknown class><<Error class: unknown class>>)

An adaptive dialog container.

dialog-floating dialog-bottom

AdwDialog is similar to a window, but is shown within another window. It can be used with class@Window and class@ApplicationWindow, use method@Dialog.present to show it.

AdwDialog 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. 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. property@Dialog:presentation-mode can be used to change that.

AdwDialog can be closed via method@Dialog.close.

When presented as a bottom sheet, AdwDialog 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 method@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 class@BottomSheet for persistent and more tightly integrated bottom sheets.

Header Bar Integration

When placed inside an AdwDialog, 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

AdwDialog can be used with class@Breakpoint the same way as class@BreakpointBin. Refer to that widget's documentation for details.

Like AdwBreakpointBin, if breakpoints are used, AdwDialog doesn't have a minimum size, and property@Gtk.Widget:width-request and property@Gtk.Widget:height-request properties must be set manually.

Since

1.5

Inheritors

Constructors

Link copied to clipboard
constructor()

Creates a new AdwDialog.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val adwDialogPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open var canClose: Boolean

Whether the dialog can be closed.

Link copied to clipboard
open var child: <Error class: unknown class>?

The child widget of the AdwDialog.

Link copied to clipboard
open var contentHeight: <Error class: unknown class>

The height of the dialog's contents.

Link copied to clipboard
open var contentWidth: <Error class: unknown class>

The width of the dialog's contents.

Link copied to clipboard

The current breakpoint.

Link copied to clipboard
open var defaultWidget: <Error class: unknown class>?

The default widget.

Link copied to clipboard
open var focusWidget: <Error class: unknown class>?

The focus widget.

Link copied to clipboard

Whether to size content automatically.

Link copied to clipboard
open val gtkAccessiblePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val gtkBuildablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val gtkConstraintTargetPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

The dialog's presentation mode.

Link copied to clipboard
open var title: String

The title of the dialog.

Functions

Link copied to clipboard
open fun addBreakpoint(breakpoint: Breakpoint)

Adds @breakpoint to @self.

Link copied to clipboard
open fun close(): Boolean

Attempts to close @self.

Link copied to clipboard
fun connectCloseAttempt(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted when the close button or shortcut is used, or method@Dialog.close is called while property@Dialog:can-close is set to FALSE.

Link copied to clipboard
fun connectClosed(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted when the dialog is successfully closed.

Link copied to clipboard
open fun forceClose()

Closes @self.

Link copied to clipboard
open fun present(parent: <Error class: unknown class>? = null)

Presents @self within @parent's window.