Adw.ViewSwitcherTitle
Description: Reference for Adw.ViewSwitcherTitle

### 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.

You can conveniently 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.

An example of the UI definition for a common use case:

    <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

#### Hierarchy

#### Ancestors

- GtkWidget
- GInitiallyUnowned
- GObject

#### Implements

- GtkAccessible
- GtkBuildable
- GtkConstraintTarget

#### Constructors

###### adw_view_switcher_title_new

Creates a new `AdwViewSwitcherTitle`.

Available since: 1.0

#### Instance methods

###### adw_view_switcher_title_get_policy

Gets the policy of `self`.

Available since: 1.0

###### adw_view_switcher_title_get_stack

Gets the stack controlled by `self`.

Available since: 1.0

###### adw_view_switcher_title_get_subtitle

Gets the subtitle of `self`.

Available since: 1.0

###### adw_view_switcher_title_get_title

Gets the title of `self`.

Available since: 1.0

###### 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_policy

Sets the policy of `self`.

Available since: 1.0

###### adw_view_switcher_title_set_stack

Sets the stack controlled by `self`.

Available since: 1.0

###### adw_view_switcher_title_set_subtitle

Sets the subtitle of `self`.

Available since: 1.0

###### adw_view_switcher_title_set_title

Sets the title of `self`.

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:policy

The policy to determine which mode to use.

Available since: 1.0

###### Adw.ViewSwitcherTitle:stack

The stack the view switcher controls.

Available since: 1.0

###### Adw.ViewSwitcherTitle:subtitle

The subtitle to display.

Available since: 1.0

###### Adw.ViewSwitcherTitle:title

The title to display.

Available since: 1.0

###### Adw.ViewSwitcherTitle:title-visible

Whether the title is currently visible.

Available since: 1.0

###### Adw.ViewSwitcherTitle:view-switcher-enabled

Whether the view switcher is enabled.

Available since: 1.0

#### Class structure

    struct AdwViewSwitcherTitleClass {
      GtkWidgetClass parent_class;

    }

###### Class members

`parent_class` |
    GtkWidgetClass
| No description available.