Class

AdwViewSwitcherBar

Description [src]

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

A view switcher action bar.

view-switcher-bar

An action bar letting you switch between multiple views contained in a AdwViewStack, via an AdwViewSwitcher. It is designed to be put at the bottom of a window and to be revealed only on really narrow windows, e.g. on mobile phones. It can’t be revealed if there are less than two pages.

AdwViewSwitcherBar is intended to be used together with AdwViewSwitcherTitle.

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

AdwViewSwitcherBar has a single CSS node with nameviewswitcherbar.

Available since:1.0

Ancestors

  • GtkWidget
  • GInitiallyUnowned
  • GObject

Implements

  • GtkAccessible
  • GtkBuildable
  • GtkConstraintTarget

Constructors

adw_view_switcher_bar_new

Creates a new AdwViewSwitcherBar.

Available since: 1.0

Instance methods

adw_view_switcher_bar_get_reveal

Gets whether self should be revealed or hidden.

Available since: 1.0

adw_view_switcher_bar_get_stack

Gets the stack controlled by self.

Available since: 1.0

adw_view_switcher_bar_set_reveal

Sets whether self should be revealed or hidden.

Available since: 1.0

adw_view_switcher_bar_set_stack

Sets the stack controlled by self.

Available since: 1.0

Properties

Adw.ViewSwitcherBar:reveal

Whether the bar should be revealed or hidden.

Available since: 1.0

Adw.ViewSwitcherBar:stack

The stack the view switcher controls.

Available since: 1.0

Class structure

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