:right-sidebar: True ViewSwitcherTitle =================================================================== .. currentmodule:: gi.repository.Adw .. deprecated:: 1.4 See `the migration guide `__ .. class:: ViewSwitcherTitle(**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 title. .. image:: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/view-switcher-title.png A widget letting you switch between multiple views contained by a :obj:`~gi.repository.Adw.ViewStack` via an :obj:`~gi.repository.Adw.ViewSwitcher`\. It is designed to be used as the title widget of a :obj:`~gi.repository.Adw.HeaderBar`\, and will display the window's title when the window is too narrow to fit the view switcher e.g. on mobile phones, or if there are less than two views. In order to center the title in narrow windows, the header bar should have :obj:`~gi.repository.Adw.HeaderBar.props.centering_policy` set to ``ADW_CENTERING_POLICY_STRICT``\. ``AdwViewSwitcherTitle`` is intended to be used together with :obj:`~gi.repository.Adw.ViewSwitcherBar`\. A common use case is to bind the :obj:`~gi.repository.Adw.ViewSwitcherBar.props.reveal` property to :obj:`~gi.repository.Adw.ViewSwitcherTitle.props.title_visible` to automatically reveal the view switcher bar when the title label is displayed in place of the view switcher, as follows: .. code-block:: xml :dedent: strict stack stack title CSS nodes -------------------------------------------------------------------------------- ``AdwViewSwitcherTitle`` has a single CSS node with name ``viewswitchertitle``\. Constructors ------------ .. rst-class:: interim-class .. class:: ViewSwitcherTitle :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Widget Creates a new ``AdwViewSwitcherTitle``\. .. deprecated:: 1.4 See `the migration guide `__ Methods ------- .. rst-class:: interim-class .. class:: ViewSwitcherTitle :no-index: .. method:: get_stack() -> ~gi.repository.Adw.ViewStack | None Gets the stack controlled by ``self``\. .. deprecated:: 1.4 See `the migration guide `__ .. method:: get_subtitle() -> str Gets the subtitle of ``self``\. .. deprecated:: 1.4 See `the migration guide `__ .. method:: get_title() -> str Gets the title of ``self``\. .. deprecated:: 1.4 See `the migration guide `__ .. method:: get_title_visible() -> bool Gets whether the title of ``self`` is currently visible. If the title is visible, it means the view switcher is hidden an it may be wanted to show an alternative switcher, e.g. a :obj:`~gi.repository.Adw.ViewSwitcherBar`\. .. deprecated:: 1.4 See `the migration guide `__ .. method:: get_view_switcher_enabled() -> bool Gets whether ``self``\'s view switcher is enabled. .. deprecated:: 1.4 See `the migration guide `__ .. method:: set_stack(stack: ~gi.repository.Adw.ViewStack | None = None) -> None Sets the stack controlled by ``self``\. .. deprecated:: 1.4 See `the migration guide `__ :param stack: a stack .. method:: set_subtitle(subtitle: str) -> None Sets the subtitle of ``self``\. The subtitle should give the user additional details. .. deprecated:: 1.4 See `the migration guide `__ :param subtitle: a subtitle .. method:: set_title(title: str) -> None Sets the title of ``self``\. The title typically identifies the current view or content item, and generally does not use the application name. .. deprecated:: 1.4 See `the migration guide `__ :param title: a title .. method:: set_view_switcher_enabled(enabled: bool) -> None Sets whether ``self``\'s view switcher is enabled. If it is disabled, the title will be displayed instead. This allows to programmatically hide the view switcher even if it fits in the available space. This can be used e.g. to ensure the view switcher is hidden below a certain window width, or any other constraint you find suitable. .. deprecated:: 1.4 See `the migration guide `__ :param enabled: whether the view switcher is enabled Properties ---------- .. rst-class:: interim-class .. class:: ViewSwitcherTitle :no-index: .. attribute:: props.stack :type: ~gi.repository.Adw.ViewStack The type of the None singleton. .. deprecated:: 1.4 See `the migration guide `__ .. attribute:: props.subtitle :type: str The type of the None singleton. .. deprecated:: 1.4 See `the migration guide `__ .. attribute:: props.title :type: str The type of the None singleton. .. deprecated:: 1.4 See `the migration guide `__ .. attribute:: props.title_visible :type: bool The type of the None singleton. .. deprecated:: 1.4 See `the migration guide `__ .. attribute:: props.view_switcher_enabled :type: bool The type of the None singleton. .. deprecated:: 1.4 See `the migration guide `__