Class

HandyViewSwitcherTitle

Description [src]

final class Handy.ViewSwitcherTitle : Gtk.Bin {
  /* No available fields */
}

A view switcher title.

A widget letting you switch between multiple views contained by a GtkStack, via an HdyViewSwitcher.

It is designed to be used as the title widget of a HdyHeaderBar, 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.

HdyViewSwitcherTitle is intended to be used together with HdyViewSwitcherBar.

A common use case is to bind the HdyViewSwitcherBar:reveal property to HdyViewSwitcherTitle: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="HdyHeaderBar">
      <property name="centering-policy">strict</property>
      <child type="title">
        <object class="HdyViewSwitcherTitle"
                id="view_switcher_title">
          <property name="stack">stack</property>
        </object>
      </child>
    </object>
  </child>
  <child>
    <object class="GtkBox">
      <child>
        <object class="GtkStack" id="stack"/>
      </child>
      <child>
        <object class="HdyViewSwitcherBar">
          <property name="stack">stack</property>
          <property name="reveal"
                    bind-source="view_switcher_title"
                    bind-property="title-visible"
                    bind-flags="sync-create"/>
        </object>
      </child>
    </object>
  </child>
</object>

CSS nodes

HdyViewSwitcherTitle has a single CSS node with name viewswitchertitle.

Available since:1.0

Ancestors

  • GtkBin
  • GtkContainer
  • GtkWidget
  • GInitiallyUnowned
  • GObject

Implements

  • AtkImplementorIface
  • GtkBuildable

Constructors

hdy_view_switcher_title_new

Creates a new HdyViewSwitcherTitle.

Available since: 1.0

Instance methods

hdy_view_switcher_title_get_policy

Gets the policy of self.

Available since: 1.0

hdy_view_switcher_title_get_stack

Gets the stack controlled by self.

Available since: 1.0

hdy_view_switcher_title_get_subtitle

Gets the subtitle of self.

Available since: 1.0

hdy_view_switcher_title_get_title

Gets the title of self.

Available since: 1.0

hdy_view_switcher_title_get_title_visible

Gets whether the title of self is currently visible.

Available since: 1.0

hdy_view_switcher_title_get_view_switcher_enabled

Gets whether selfs view switcher is enabled.

Available since: 1.0

hdy_view_switcher_title_set_policy

Sets the policy of self.

Available since: 1.0

hdy_view_switcher_title_set_stack

Sets the GtkStack to control.

Available since: 1.0

hdy_view_switcher_title_set_subtitle

Sets the subtitle of self.

Available since: 1.0

hdy_view_switcher_title_set_title

Sets the title of self.

Available since: 1.0

hdy_view_switcher_title_set_view_switcher_enabled

Sets whether selfs view switcher is enabled.

Available since: 1.0

Properties

Handy.ViewSwitcherTitle:policy

The policy used to determine which mode to use.

Available since: 1.0

Handy.ViewSwitcherTitle:stack

The GtkStack the HdyViewSwitcher controls.

Available since: 1.0

Handy.ViewSwitcherTitle:subtitle

The subtitle of the HdyViewSwitcher.

Available since: 1.0

Handy.ViewSwitcherTitle:title

The title of the HdyViewSwitcher.

Available since: 1.0

Handy.ViewSwitcherTitle:title-visible

Whether the bar should be revealed or hidden.

Available since: 1.0

Handy.ViewSwitcherTitle:view-switcher-enabled

Whether the bar should be revealed or hidden.

Available since: 1.0

Class structure

struct HandyViewSwitcherTitleClass {
  GtkBinClass parent_class;
  
}
Class members
parent_class
GtkBinClass
  No description available.