Trait libadwaita::prelude::AdwDialogExt

source ·
pub trait AdwDialogExt: IsA<Dialog> + Sealed + 'static {
Show 35 methods // Provided methods fn add_breakpoint(&self, breakpoint: Breakpoint) { ... } fn close(&self) -> bool { ... } fn force_close(&self) { ... } fn can_close(&self) -> bool { ... } fn child(&self) -> Option<Widget> { ... } fn content_height(&self) -> i32 { ... } fn content_width(&self) -> i32 { ... } fn current_breakpoint(&self) -> Option<Breakpoint> { ... } fn default_widget(&self) -> Option<Widget> { ... } fn focus(&self) -> Option<Widget> { ... } fn follows_content_size(&self) -> bool { ... } fn presentation_mode(&self) -> DialogPresentationMode { ... } fn title(&self) -> GString { ... } fn present(&self, parent: Option<&impl IsA<Widget>>) { ... } fn set_can_close(&self, can_close: bool) { ... } fn set_child(&self, child: Option<&impl IsA<Widget>>) { ... } fn set_content_height(&self, content_height: i32) { ... } fn set_content_width(&self, content_width: i32) { ... } fn set_default_widget(&self, default_widget: Option<&impl IsA<Widget>>) { ... } fn set_focus(&self, focus: Option<&impl IsA<Widget>>) { ... } fn set_follows_content_size(&self, follows_content_size: bool) { ... } fn set_presentation_mode(&self, presentation_mode: DialogPresentationMode) { ... } fn set_title(&self, title: &str) { ... } fn connect_close_attempt<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_closed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... } fn connect_can_close_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_child_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_content_height_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_content_width_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_current_breakpoint_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_default_widget_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_focus_widget_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_follows_content_size_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_presentation_mode_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_title_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Available on crate feature v1_5 only.
Expand description

Trait containing all Dialog methods.

§Implementors

AboutDialog, AlertDialog, Dialog, PreferencesDialog

Provided Methods§

source

fn add_breakpoint(&self, breakpoint: Breakpoint)

Adds @breakpoint to @self.

§breakpoint

the breakpoint to add

source

fn close(&self) -> bool

Attempts to close @self.

If the can-close property is set to FALSE, the close-attempt signal is emitted.

See also: force_close().

§Returns

whether @self was successfully closed

source

fn force_close(&self)

Closes @self.

Unlike close(), it succeeds even if can-close is set to FALSE.

source

fn can_close(&self) -> bool

Gets whether @self can be closed.

§Returns

whether the dialog can be closed

source

fn child(&self) -> Option<Widget>

Gets the child widget of @self.

§Returns

the child widget of @self

source

fn content_height(&self) -> i32

Gets the height of the dialog’s contents.

§Returns

the content height

source

fn content_width(&self) -> i32

Gets the width of the dialog’s contents.

§Returns

the content width

source

fn current_breakpoint(&self) -> Option<Breakpoint>

Gets the current breakpoint.

§Returns

the current breakpoint

source

fn default_widget(&self) -> Option<Widget>

Gets the default widget for @self.

§Returns

the default widget

source

fn focus(&self) -> Option<Widget>

Gets the focus widget for @self.

§Returns

the focus widget

source

fn follows_content_size(&self) -> bool

Gets whether to size content of @self automatically.

§Returns

whether to size content automatically

source

fn presentation_mode(&self) -> DialogPresentationMode

Gets presentation mode for @self.

§Returns

the presentation mode

source

fn title(&self) -> GString

Gets the title of @self.

§Returns

the title

source

fn present(&self, parent: Option<&impl IsA<Widget>>)

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.

§parent

a widget within the toplevel

source

fn set_can_close(&self, can_close: bool)

Sets whether @self can be closed.

If set to FALSE, the close button, shortcuts and close() will result in close-attempt being emitted instead, and bottom sheet close swipe will be disabled. force_close() still works.

§can_close

whether to allow closing

source

fn set_child(&self, child: Option<&impl IsA<Widget>>)

Sets the child widget of @self.

§child

the child widget

source

fn set_content_height(&self, content_height: i32)

Sets the height of the dialog’s contents.

Set it to -1 to reset it to the content’s natural height.

See also: default-height

§content_height

the content height

source

fn set_content_width(&self, content_width: i32)

Sets the width of the dialog’s contents.

Set it to -1 to reset it to the content’s natural width.

See also: default-width

§content_width

the content width

source

fn set_default_widget(&self, default_widget: Option<&impl IsA<Widget>>)

Sets the default widget for @self.

It’s activated when the user presses Enter.

§default_widget

the default widget

source

fn set_focus(&self, focus: Option<&impl IsA<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 [WidgetExtManual::grab_focus()][crate::gtk::prelude::WidgetExtManual::grab_focus()] instead of this function.

§focus

the focus widget

source

fn set_follows_content_size(&self, follows_content_size: bool)

Sets whether to size content of @self automatically.

If set to TRUE, always use the content’s natural size instead of content-width and content-height. If the content resizes, the dialog will immediately resize as well.

See also: resizable

§follows_content_size

whether to size content automatically

source

fn set_presentation_mode(&self, presentation_mode: DialogPresentationMode)

Sets presentation mode for @self.

When set to ADW_DIALOG_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_DIALOG_FLOATING or ADW_DIALOG_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.

§presentation_mode

the new presentation mode

source

fn set_title(&self, title: &str)

Sets the title of @self.

§title

the new title

source

fn connect_close_attempt<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Emitted when the close button or shortcut is used, or close() is called while can-close is set to FALSE.

source

fn connect_closed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Emitted when the dialog is successfully closed.

source

fn connect_can_close_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source

fn connect_content_height_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_content_width_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_current_breakpoint_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_default_widget_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_focus_widget_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_follows_content_size_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_presentation_mode_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Object Safety§

This trait is not object safe.

Implementors§