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.

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">
          <property name="orientation">vertical</property>
          <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_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_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

##### Methods inherited from GtkWidget (159)

##### Methods inherited from GObject (43)

#### Properties

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

##### Properties inherited from GtkWidget (34)

#### Signals

##### Signals inherited from GtkWidget (13)

##### Signals inherited from GObject (1)

#### Class structure

    struct AdwViewSwitcherTitleClass {
      GtkWidgetClass parent_class;

    }

###### Class members

`parent_class` |
    GtkWidgetClass
| No description available.