PreferencesWindow
- class PreferencesWindow(*args, **kwargs)
Superclasses: Window
, Window
, Widget
, InitiallyUnowned
, Object
Implemented Interfaces: Accessible
, Buildable
, ConstraintTarget
, Native
, Root
, ShortcutManager
A window to present an application’s preferences.
The AdwPreferencesWindow
widget presents an application’s preferences
gathered into pages and groups. The preferences are searchable by the user.
CSS nodes
AdwPreferencesWindow
has a main CSS node with the name window
and the
style class .preferences
.
Constructors
Methods
- class PreferencesWindow
- add(page: PreferencesPage) None
Adds a preferences page to
self
.- Parameters:
page – the page to add
- close_subpage() None
Closes the current subpage.
If there is no presented subpage, this does nothing.
Deprecated since version 1.4: Use
pop_subpage
instead.
Gets whether gestures and shortcuts for closing subpages are enabled.
Deprecated since version 1.4: Use
get_can_pop
instead.
- get_visible_page() PreferencesPage | None
Gets the currently visible page of
self
.
- present_subpage(subpage: Widget) None
Sets
subpage
as the window’s subpage and opens it.The transition can be cancelled by the user, in which case visible child will change back to the previously visible child.
Deprecated since version 1.4: Use
push_subpage
instead.- Parameters:
subpage – the subpage
- push_subpage(page: NavigationPage) None
Pushes
page
onto the subpage stack ofself
.The page will be automatically removed when popped.
Added in version 1.4.
- Parameters:
page – the subpage
- remove(page: PreferencesPage) None
Removes a page from
self
.- Parameters:
page – the page to remove
Sets whether gestures and shortcuts for closing subpages are enabled.
The supported gestures are:
One-finger swipe on touchscreens
Horizontal scrolling on touchpads (usually two-finger swipe)
Back mouse button
The keyboard back key is also supported, as well as the Alt`+:kbd:`← shortcut.
For right-to-left locales, gestures and shortcuts are reversed.
Deprecated since version 1.4: Use
set_can_pop
instead.Has no effect for subpages added with
push_subpage
.- Parameters:
can_navigate_back – the new value
- set_search_enabled(search_enabled: bool) None
Sets whether search is enabled for
self
.- Parameters:
search_enabled – whether search is enabled
- set_visible_page(page: PreferencesPage) None
Makes
page
the visible page ofself
.- Parameters:
page – a page of
self
- set_visible_page_name(name: str) None
Makes the page with the given name visible.
See
visible_page
.- Parameters:
name – the name of the page to make visible
Properties
- class PreferencesWindow
Whether gestures and shortcuts for closing subpages are enabled.
The supported gestures are:
One-finger swipe on touchscreens
Horizontal scrolling on touchpads (usually two-finger swipe)
Back mouse button
The keyboard back key is also supported, as well as the Alt`+:kbd:`← shortcut.
For right-to-left locales, gestures and shortcuts are reversed.
Deprecated since version 1.4: Use
can_pop
instead.Has no effect for subpages added with
push_subpage
.
- props.visible_page_name: str
The name of the currently visible page.
See
visible_page
.
Fields
- class PreferencesWindow
- parent_instance