Skip to main content

AppChooserButtonExt

Trait AppChooserButtonExt 

Source
pub trait AppChooserButtonExt: IsA<AppChooserButton> + 'static {
Show 13 methods // Provided methods fn append_custom_item(&self, name: &str, label: &str, icon: &impl IsA<Icon>) { ... } fn append_separator(&self) { ... } fn heading(&self) -> Option<GString> { ... } fn shows_default_item(&self) -> bool { ... } fn shows_dialog_item(&self) -> bool { ... } fn set_active_custom_item(&self, name: &str) { ... } fn set_heading(&self, heading: &str) { ... } fn set_show_default_item(&self, setting: bool) { ... } fn set_show_dialog_item(&self, setting: bool) { ... } fn connect_custom_item_activated<F: Fn(&Self, &str) + 'static>( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId { ... } fn connect_heading_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_show_default_item_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_show_dialog_item_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all AppChooserButton methods.

§Implementors

AppChooserButton

Provided Methods§

Source

fn append_custom_item(&self, name: &str, label: &str, icon: &impl IsA<Icon>)

Appends a custom item to the list of applications that is shown in the popup; the item name must be unique per-widget. Clients can use the provided name as a detail for the custom-item-activated signal, to add a callback for the activation of a particular custom item in the list. See also append_separator().

§name

the name of the custom item

§label

the label for the custom item

§icon

the icon for the custom item

Source

fn append_separator(&self)

Appends a separator to the list of applications that is shown in the popup.

Source

fn heading(&self) -> Option<GString>

Returns the text to display at the top of the dialog.

§Returns

the text to display at the top of the dialog, or None, in which case a default text is displayed

Source

fn shows_default_item(&self) -> bool

Returns the current value of the show-default-item property.

§Returns

the value of show-default-item

Source

fn shows_dialog_item(&self) -> bool

Returns the current value of the show-dialog-item property.

§Returns

the value of show-dialog-item

Source

fn set_active_custom_item(&self, name: &str)

Selects a custom item previously added with append_custom_item().

Use [AppChooserExtManual::refresh()][crate::prelude::AppChooserExtManual::refresh()] to bring the selection to its initial state.

§name

the name of the custom item

Source

fn set_heading(&self, heading: &str)

Sets the text to display at the top of the dialog. If the heading is not set, the dialog displays a default text.

§heading

a string containing Pango markup

Source

fn set_show_default_item(&self, setting: bool)

Sets whether the dropdown menu of this button should show the default application for the given content type at top.

§setting

the new value for show-default-item

Source

fn set_show_dialog_item(&self, setting: bool)

Sets whether the dropdown menu of this button should show an entry to trigger a AppChooserDialog.

§setting

the new value for show-dialog-item

Source

fn connect_custom_item_activated<F: Fn(&Self, &str) + 'static>( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId

Emitted when a custom item, previously added with append_custom_item(), is activated from the dropdown menu.

§item_name

the name of the activated item

Source

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

Source

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

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§