Class
Adw.ViewSwitcherBar
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
.
Constructors
adw_view_switcher_bar_new
Creates a new AdwViewSwitcherBar
.
Instance methods
adw_view_switcher_bar_get_policy
Gets the policy of self
.
adw_view_switcher_bar_get_reveal
Gets whether self
should be revealed or hidden.
adw_view_switcher_bar_get_stack
Gets the stack controlled by self
.
adw_view_switcher_bar_set_policy
Sets the policy of self
.
adw_view_switcher_bar_set_reveal
Sets whether self
should be revealed or hidden.
adw_view_switcher_bar_set_stack
Sets the stack controlled by self
.
Properties
Adw.ViewSwitcherBar:policy
The policy to determine which mode to use.
Adw.ViewSwitcherBar:reveal
Whether the bar should be revealed or hidden.
Adw.ViewSwitcherBar:stack
The stack the view switcher controls.