Class

Adw.ViewSwitcherTitle

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 GtkStack 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="GtkStack" 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.

Hierarchy

Hierarchy for Adw.ViewSwitcherTitle

Ancestors

  • GtkWidget
  • GInitiallyUnowned
  • GObject

Implements

  • GtkAccessible
  • GtkBuildable
  • GtkConstraintTarget

Constructors

adw_view_switcher_title_new

Creates a new AdwViewSwitcherTitle.

Instance methods

adw_view_switcher_title_get_policy

Gets the policy of self.

adw_view_switcher_title_get_stack

Gets the stack controlled by self.

adw_view_switcher_title_get_subtitle

Gets the subtitle of self.

adw_view_switcher_title_get_title

Gets the title of self.

adw_view_switcher_title_get_title_visible

Gets whether the title of self is currently visible.

adw_view_switcher_title_get_view_switcher_enabled

Gets whether selfs view switcher is enabled.

adw_view_switcher_title_set_policy

Sets the policy of self.

adw_view_switcher_title_set_stack

Sets the stack controlled by self.

adw_view_switcher_title_set_subtitle

Sets the subtitle of self.

adw_view_switcher_title_set_title

Sets the title of self.

adw_view_switcher_title_set_view_switcher_enabled

Sets whether selfs view switcher is enabled.

Properties

Adw.ViewSwitcherTitle:policy

The policy to determine which mode to use.

Adw.ViewSwitcherTitle:stack

The stack the view switcher controls.

Adw.ViewSwitcherTitle:subtitle

The subtitle to display.

Adw.ViewSwitcherTitle:title

The title to display.

Adw.ViewSwitcherTitle:title-visible

Whether the title is currently visible.

Adw.ViewSwitcherTitle:view-switcher-enabled

Whether the view switcher is enabled.

Class structure

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