Class

AdwViewSwitcherBar

Description [src]

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

A view switcher action bar.

An action bar letting you switch between multiple views contained in a GtkStack, 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.

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

AdwViewSwitcherBar has a single CSS node with nameviewswitcherbar.

Available since:1.0

Hierarchy

hierarchy this AdwViewSwitcherBar implements_0 GtkAccessible this--implements_0 implements_1 GtkBuildable this--implements_1 implements_2 GtkConstraintTarget this--implements_2 ancestor_0 GtkWidget ancestor_0--this ancestor_1 GInitiallyUnowned ancestor_1--ancestor_0 ancestor_2 GObject ancestor_2--ancestor_1

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_policy

Gets the policy of self.

Available since: 1.0

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_policy

Sets the policy of 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:policy

The policy to determine which mode to use.

Available since: 1.0

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.