Adw.PreferencesDialog

g Adw.Dialog Adw.Dialog Adw.PreferencesDialog Adw.PreferencesDialog Adw.Dialog->Adw.PreferencesDialog GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.Widget->Adw.Dialog

Subclasses:

None

Methods

Inherited:

Adw.Dialog (24), Gtk.Widget (183), GObject.Object (37), Gtk.Accessible (17), Gtk.Buildable (1)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new ()

add (page)

add_toast (toast)

get_search_enabled ()

get_visible_page ()

get_visible_page_name ()

pop_subpage ()

push_subpage (page)

remove (page)

set_search_enabled (search_enabled)

set_visible_page (page)

set_visible_page_name (name)

Virtual Methods

Inherited:

Adw.Dialog (2), Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

Properties

Inherited:

Adw.Dialog (10), Gtk.Widget (35), Gtk.Accessible (1)

Name

Type

Flags

Short Description

search-enabled

bool

r/w/en

visible-page

Gtk.Widget

r/w/en

visible-page-name

str

r/w/en

Signals

Inherited:

Adw.Dialog (2), Gtk.Widget (13), GObject.Object (1)

Fields

Inherited:

Adw.Dialog (2), Gtk.Widget (13), GObject.Object (1)

Name

Type

Access

Description

parent_instance

Adw.Dialog

r

Class Details

class Adw.PreferencesDialog(**kwargs)
Bases:

Adw.Dialog

Abstract:

No

Structure:

Adw.PreferencesDialogClass

A dialog showing application’s preferences.

<picture> <source srcset=”preferences-dialog-dark.png” media=”(prefers-color-scheme: dark)”> <img src=”preferences-dialog.png” alt=”preferences-dialog”> </picture>

The AdwPreferencesDialog widget presents an application’s preferences gathered into pages and groups. The preferences are searchable by the user.

Actions

AdwPrefencesDialog defines the navigation.pop action, it doesn’t take any parameters and pops the current subpage from the navigation stack, equivalent to calling [method`PreferencesDialog`.pop_subpage].

CSS nodes

AdwPreferencesDialog has a main CSS node with the name dialog and the style class .preferences.

New in version 1.5.

classmethod new()
Returns:

the newly created AdwPreferencesDialog

Return type:

Adw.Dialog

Creates a new AdwPreferencesDialog.

New in version 1.5.

add(page)
Parameters:

page (Adw.PreferencesPage) – the page to add

Adds a preferences page to self.

New in version 1.5.

add_toast(toast)
Parameters:

toast (Adw.Toast) – a toast

Displays toast.

See [method`ToastOverlay`.add_toast].

New in version 1.5.

get_search_enabled()
Returns:

whether search is enabled for self.

Return type:

bool

Gets whether search is enabled for self.

New in version 1.5.

get_visible_page()
Returns:

the visible page

Return type:

Adw.PreferencesPage or None

Gets the currently visible page of self.

New in version 1.5.

get_visible_page_name()
Returns:

the name of the visible page

Return type:

str or None

Gets the name of currently visible page of self.

New in version 1.5.

pop_subpage()
Returns:

TRUE if a page has been popped

Return type:

bool

Pop the visible page from the subpage stack of self.

New in version 1.5.

push_subpage(page)
Parameters:

page (Adw.NavigationPage) – the subpage

Pushes page onto the subpage stack of self.

The page will be automatically removed when popped.

New in version 1.5.

remove(page)
Parameters:

page (Adw.PreferencesPage) – the page to remove

Removes a page from self.

New in version 1.5.

set_search_enabled(search_enabled)
Parameters:

search_enabled (bool) – whether search is enabled

Sets whether search is enabled for self.

New in version 1.5.

set_visible_page(page)
Parameters:

page (Adw.PreferencesPage) – a page of self

Makes page the visible page of self.

New in version 1.5.

set_visible_page_name(name)
Parameters:

name (str) – the name of the page to make visible

Makes the page with the given name visible.

See [property`PreferencesDialog`:py:data::visible-page<Adw.PreferencesDialog.props.visible_page>].

New in version 1.5.

Property Details

Adw.PreferencesDialog.props.search_enabled
Name:

search-enabled

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether search is enabled.

New in version 1.5.

Adw.PreferencesDialog.props.visible_page
Name:

visible-page

Type:

Gtk.Widget

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The currently visible page.

New in version 1.5.

Adw.PreferencesDialog.props.visible_page_name
Name:

visible-page-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The name of the currently visible page.

See [property`AdwPreferencesDialog`:py:data::visible-page<Adw.PreferencesDialog.props.visible_page>].

New in version 1.5.