Class
AdwViewSwitcherTitle
Description [src]
final class Adw.ViewSwitcherTitle : Gtk.Widget {
/* No available fields */
}
A view switcher title.
A widget letting you switch between multiple views contained by a
AdwViewStack
via an AdwViewSwitcher
.
It is designed to be used as the title widget of a AdwHeaderBar
, 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
AdwHeaderBar:centering-policy
set to
ADW_CENTERING_POLICY_STRICT
.
AdwViewSwitcherTitle
is intended to be used together with
AdwViewSwitcherBar
.
A common use case is to bind the AdwViewSwitcherBar:reveal
property
to AdwViewSwitcherTitle:title-visible
to automatically reveal the
view switcher bar when the title label is displayed in place of the view
switcher, as follows:
<object class="GtkWindow">
<child type="titlebar">
<object class="AdwHeaderBar">
<property name="centering-policy">strict</property>
<child type="title">
<object class="AdwViewSwitcherTitle" id="title">
<property name="stack">stack</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<child>
<object class="AdwViewStack" id="stack"/>
</child>
<child>
<object class="AdwViewSwitcherBar">
<property name="stack">stack</property>
<binding name="reveal">
<lookup name="title-visible">title</lookup>
</binding>
</object>
</child>
</object>
</child>
</object>
CSS nodes
AdwViewSwitcherTitle
has a single CSS node with name viewswitchertitle
.
Available since: | 1.0 |
Instance methods
adw_view_switcher_title_get_title_visible
Gets whether the title of self
is currently visible.
Available since: 1.0
adw_view_switcher_title_get_view_switcher_enabled
Gets whether self
‘s view switcher is enabled.
Available since: 1.0
adw_view_switcher_title_set_view_switcher_enabled
Sets whether self
‘s view switcher is enabled.
Available since: 1.0
Properties
Adw.ViewSwitcherTitle:view-switcher-enabled
Whether the view switcher is enabled.
Available since: 1.0