:right-sidebar: True ViewSwitcherBar =================================================================== .. currentmodule:: gi.repository.Adw .. class:: ViewSwitcherBar(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget` A view switcher action bar. .. image:: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/view-switcher-bar.png An action bar letting you switch between multiple views contained in a :obj:`~gi.repository.Adw.ViewStack`\, via an :obj:`~gi.repository.Adw.ViewSwitcher`\. 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 ``AdwViewSwitcher`` in a header bar, and a :obj:`~gi.repository.Adw.Breakpoint` showing the view switcher bar on narrow sizes, while removing the view switcher from the header bar, as follows: .. code-block:: xml :dedent: max-width: 550sp True stack wide stack It's recommended to set :obj:`~gi.repository.Adw.ViewSwitcher.props.policy` to ``ADW_VIEW_SWITCHER_POLICY_WIDE`` in this case. You may have to adjust the breakpoint condition for your specific pages. CSS nodes -------------------------------------------------------------------------------- ``AdwViewSwitcherBar`` has a single CSS node with name``viewswitcherbar``\. Constructors ------------ .. rst-class:: interim-class .. class:: ViewSwitcherBar :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Widget Creates a new ``AdwViewSwitcherBar``\. Methods ------- .. rst-class:: interim-class .. class:: ViewSwitcherBar :no-index: .. method:: get_reveal() -> bool Gets whether ``self`` should be revealed or hidden. .. method:: get_stack() -> ~gi.repository.Adw.ViewStack | None Gets the stack controlled by ``self``\. .. method:: set_reveal(reveal: bool) -> None Sets whether ``self`` should be revealed or hidden. :param reveal: whether to reveal ``self`` .. method:: set_stack(stack: ~gi.repository.Adw.ViewStack | None = None) -> None Sets the stack controlled by ``self``\. :param stack: a stack Properties ---------- .. rst-class:: interim-class .. class:: ViewSwitcherBar :no-index: .. attribute:: props.reveal :type: bool The type of the None singleton. .. attribute:: props.stack :type: ~gi.repository.Adw.ViewStack The type of the None singleton.