Adw.ViewSwitcherTitle¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
d/r/w/en |
|
||
d/r/w/en |
|
||
d/r/w/en |
|
||
d/r |
|
||
d/r/w/en |
|
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Adw.ViewSwitcherTitle(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A view switcher title.
<picture> <source srcset=”view-switcher-title-dark.png” media=”(prefers-color-scheme: dark)”> <img src=”view-switcher-title.png” alt=”view-switcher-title”> </picture>
A widget letting you switch between multiple views contained by a [class`ViewStack`] via an [class`ViewSwitcher`].
It is designed to be used as the title widget of a [class`HeaderBar`], and will display the window’s title when the window is too narrow to fit the view switcher e.g. on mobile phones, or if there are less than two views.
In order to center the title in narrow windows, the header bar should have [property`HeaderBar`:py:data::centering-policy<Adw.ViewSwitcherTitle.props.centering_policy>] set to
ADW_CENTERING_POLICY_STRICT
.AdwViewSwitcherTitle
is intended to be used together with [class`ViewSwitcherBar`].A common use case is to bind the [property`ViewSwitcherBar`:py:data::reveal<Adw.ViewSwitcherTitle.props.reveal>] property to [property`ViewSwitcherTitle`:py:data::title-visible<Adw.ViewSwitcherTitle.props.title_visible>] to automatically reveal the view switcher bar when the title label is displayed in place of the view switcher, as follows:
``xml <object class=”AdwWindow”>
- <property name=”content”>
- <object class=”AdwToolbarView”>
- <child type=”top”>
- <object class=”AdwHeaderBar”>
<property name=”centering-policy”>strict</property> <property name=”title-widget”>
- <object class=”AdwViewSwitcherTitle” id=”title”>
<property name=”stack”>stack</property>
</object>
</property>
</object>
</child> <property name=”content”>
<object class=”AdwViewStack” id=”stack”/>
</property> <child type=”bottom”>
- <object class=”AdwViewSwitcherBar”>
<property name=”stack”>stack</property> <binding name=”reveal”>
<lookup name=”title-visible”>title</lookup>
</binding>
</object>
</child>
</object>
</property>
</object> ``
- CSS nodes
AdwViewSwitcherTitle
has a single CSS node with nameviewswitchertitle
.Deprecated since version 1.4: See the migration guide
- classmethod new()¶
- Returns:
the newly created
AdwViewSwitcherTitle
- Return type:
Creates a new
AdwViewSwitcherTitle
.Deprecated since version 1.4: See the migration guide
- get_stack()¶
- Returns:
the stack
- Return type:
Gets the stack controlled by self.
Deprecated since version 1.4: See the migration guide
- get_subtitle()¶
- Returns:
the subtitle
- Return type:
Gets the subtitle of self.
Deprecated since version 1.4: See the migration guide
- get_title()¶
- Returns:
the title
- Return type:
Gets the title of self.
Deprecated since version 1.4: See the migration guide
- get_title_visible()¶
- Returns:
whether the title of self is currently visible
- Return type:
Gets whether the title of self is currently visible.
If the title is visible, it means the view switcher is hidden an it may be wanted to show an alternative switcher, e.g. a [class`ViewSwitcherBar`].
Deprecated since version 1.4: See the migration guide
- get_view_switcher_enabled()¶
- Returns:
whether the view switcher is enabled
- Return type:
Gets whether self's view switcher is enabled.
Deprecated since version 1.4: See the migration guide
- set_stack(stack)¶
- Parameters:
stack (
Adw.ViewStack
orNone
) – a stack
Sets the stack controlled by self.
Deprecated since version 1.4: See the migration guide
- set_subtitle(subtitle)¶
- Parameters:
subtitle (
str
) – a subtitle
Sets the subtitle of self.
The subtitle should give the user additional details.
Deprecated since version 1.4: See the migration guide
- set_title(title)¶
- Parameters:
title (
str
) – a title
Sets the title of self.
The title typically identifies the current view or content item, and generally does not use the application name.
Deprecated since version 1.4: See the migration guide
- set_view_switcher_enabled(enabled)¶
- Parameters:
enabled (
bool
) – whether the view switcher is enabled
Sets whether self's view switcher is enabled.
If it is disabled, the title will be displayed instead. This allows to programmatically hide the view switcher even if it fits in the available space.
This can be used e.g. to ensure the view switcher is hidden below a certain window width, or any other constraint you find suitable.
Deprecated since version 1.4: See the migration guide
Property Details¶
- Adw.ViewSwitcherTitle.props.stack¶
- Name:
stack
- Type:
- Default Value:
- Flags:
The stack the view switcher controls.
Deprecated since version 1.4: See the migration guide
- Adw.ViewSwitcherTitle.props.subtitle¶
- Name:
subtitle
- Type:
- Default Value:
''
- Flags:
The subtitle to display.
The subtitle should give the user additional details.
Deprecated since version 1.4: See the migration guide
- Adw.ViewSwitcherTitle.props.title¶
- Name:
title
- Type:
- Default Value:
''
- Flags:
The title to display.
The title typically identifies the current view or content item, and generally does not use the application name.
Deprecated since version 1.4: See the migration guide
- Adw.ViewSwitcherTitle.props.title_visible¶
- Name:
title-visible
- Type:
- Default Value:
- Flags:
Whether the title is currently visible.
If the title is visible, it means the view switcher is hidden an it may be wanted to show an alternative switcher, e.g. a [class`ViewSwitcherBar`].
Deprecated since version 1.4: See the migration guide
- Adw.ViewSwitcherTitle.props.view_switcher_enabled¶
- Name:
view-switcher-enabled
- Type:
- Default Value:
- Flags:
Whether the view switcher is enabled.
If it is disabled, the title will be displayed instead. This allows to programmatically hide the view switcher even if it fits in the available space.
This can be used e.g. to ensure the view switcher is hidden below a certain window width, or any other constraint you find suitable.
Deprecated since version 1.4: See the migration guide