:right-sidebar: True InlineViewSwitcher =================================================================== .. currentmodule:: gi.repository.Adw .. versionadded:: 1.7 .. class:: InlineViewSwitcher(**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`, :class:`~gi.repository.Gtk.Orientable` A view switcher that uses a toggle group. .. image:: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/inline-view-switcher.png A view switcher showing pages of an :obj:`~gi.repository.Adw.ViewStack` within an :obj:`~gi.repository.Adw.ToggleGroup`\, similar to :obj:`~gi.repository.Adw.ViewSwitcher`\. The toggles can display either an icon, a label or both. Use the :obj:`~gi.repository.Adw.InlineViewSwitcher.props.display_mode` to control this. .. image:: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/inline-view-switcher-display-modes.png CSS nodes -------------------------------------------------------------------------------- ``AdwInlineViewSwitcher`` has a single CSS node with the name ``inline-view-switcher``\. Style classes -------------------------------------------------------------------------------- Like ``AdwToggleGroup``\, it can accept the ```.flat`` `__ and ```.round`` `__ style classes. .. image:: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/inline-view-switcher-style-classes.png Accessibility -------------------------------------------------------------------------------- The internal toggle group uses the :obj:`~gi.repository.Gtk.AccessibleRole.tab-list` role. Its toggles use the :obj:`~gi.repository.Gtk.AccessibleRole.tab` role. See also: :obj:`~gi.repository.Adw.ViewSwitcher`\, :obj:`~gi.repository.Adw.ViewSwitcherBar`\, :obj:`~gi.repository.Adw.ViewSwitcherSidebar`\. Constructors ------------ .. rst-class:: interim-class .. class:: InlineViewSwitcher :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Widget Creates a new ``AdwInlineViewSwitcher``\. .. versionadded:: 1.7 Methods ------- .. rst-class:: interim-class .. class:: InlineViewSwitcher :no-index: .. method:: get_can_shrink() -> bool Gets whether the toggles can be smaller than the natural size of their contents. .. versionadded:: 1.7 .. method:: get_display_mode() -> ~gi.repository.Adw.InlineViewSwitcherDisplayMode Gets the display mode of ``self``\. .. versionadded:: 1.7 .. method:: get_homogeneous() -> bool Gets whether all toggles within ``self`` take the same size. .. versionadded:: 1.7 .. method:: get_stack() -> ~gi.repository.Adw.ViewStack | None Gets the stack ``self`` controls. .. versionadded:: 1.7 .. method:: set_can_shrink(can_shrink: bool) -> None Sets whether the toggles can be smaller than the natural size of their contents. If ``can_shrink`` is ``TRUE``\, the toggle labels will ellipsize. See :obj:`~gi.repository.Adw.ToggleGroup.props.can_shrink`\. .. versionadded:: 1.7 :param can_shrink: whether the toggles can shrink .. method:: set_display_mode(mode: ~gi.repository.Adw.InlineViewSwitcherDisplayMode) -> None Sets the display mode of ``self``\. Determines what the toggles display: a label, an icon or both. .. image:: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/inline-view-switcher-display-modes.png .. versionadded:: 1.7 :param mode: the display mode .. method:: set_homogeneous(homogeneous: bool) -> None Sets whether all toggles within ``self`` take the same size. .. versionadded:: 1.7 :param homogeneous: whether all toggles should take the same size .. method:: set_stack(stack: ~gi.repository.Adw.ViewStack | None = None) -> None Sets the stack to control. .. versionadded:: 1.7 :param stack: a stack Properties ---------- .. rst-class:: interim-class .. class:: InlineViewSwitcher :no-index: .. attribute:: props.can_shrink :type: bool The type of the None singleton. .. versionadded:: 1.7 .. attribute:: props.display_mode :type: ~gi.repository.Adw.InlineViewSwitcherDisplayMode The type of the None singleton. .. versionadded:: 1.7 .. attribute:: props.homogeneous :type: bool The type of the None singleton. .. versionadded:: 1.7 .. attribute:: props.stack :type: ~gi.repository.Adw.ViewStack The type of the None singleton. .. versionadded:: 1.7