Class

AdwViewSwitcherTitle

Description [src]

final class Adw.ViewSwitcherTitle : Gtk.Widget {
  /* No available fields */
}

A view switcher title.

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="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 name viewswitchertitle.

Deprecated since:1.4

See the migration guide

Ancestors

  • GtkWidget
  • GInitiallyUnowned
  • GObject

Implements

  • GtkAccessible
  • GtkBuildable
  • GtkConstraintTarget

Constructors

adw_view_switcher_title_new

Creates a new AdwViewSwitcherTitle.

Deprecated since: 1.4

Instance methods

adw_view_switcher_title_get_stack

Gets the stack controlled by self.

Deprecated since: 1.4

adw_view_switcher_title_get_subtitle

Gets the subtitle of self.

Deprecated since: 1.4

adw_view_switcher_title_get_title

Gets the title of self.

Deprecated since: 1.4

adw_view_switcher_title_get_title_visible

Gets whether the title of self is currently visible.

Deprecated since: 1.4

adw_view_switcher_title_get_view_switcher_enabled

Gets whether selfs view switcher is enabled.

Deprecated since: 1.4

adw_view_switcher_title_set_stack

Sets the stack controlled by self.

Deprecated since: 1.4

adw_view_switcher_title_set_subtitle

Sets the subtitle of self.

Deprecated since: 1.4

adw_view_switcher_title_set_title

Sets the title of self.

Deprecated since: 1.4

adw_view_switcher_title_set_view_switcher_enabled

Sets whether selfs view switcher is enabled.

Deprecated since: 1.4

Properties

Adw.ViewSwitcherTitle:stack

The stack the view switcher controls.

Deprecated since: 1.4

Adw.ViewSwitcherTitle:subtitle

The subtitle to display.

Deprecated since: 1.4

Adw.ViewSwitcherTitle:title

The title to display.

Deprecated since: 1.4

Adw.ViewSwitcherTitle:title-visible

Whether the title is currently visible.

Deprecated since: 1.4

Adw.ViewSwitcherTitle:view-switcher-enabled

Whether the view switcher is enabled.

Deprecated since: 1.4

Class structure

struct AdwViewSwitcherTitleClass {
  GtkWidgetClass parent_class;
  
}
Class members
parent_class
GtkWidgetClass
  No description available.