:right-sidebar: True TabBar =================================================================== .. currentmodule:: gi.repository.Adw .. class:: TabBar(**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 tab bar for :obj:`~gi.repository.Adw.TabView`\. .. image:: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/tab-bar.png The ``AdwTabBar`` widget is a tab bar that can be used with conjunction with ``AdwTabView``\. It is typically used as a top bar within :obj:`~gi.repository.Adw.ToolbarView`\. ``AdwTabBar`` can autohide and can optionally contain action widgets on both sides of the tabs. When there's not enough space to show all the tabs, ``AdwTabBar`` will scroll them. Pinned tabs always stay visible and aren't a part of the scrollable area. CSS nodes -------------------------------------------------------------------------------- ``AdwTabBar`` has a single CSS node with name ``tabbar``\. Style classes -------------------------------------------------------------------------------- By default ``AdwTabBar`` look like a part of an ``AdwHeaderBar`` and is intended to be used directly attached to one or used as a :obj:`~gi.repository.Adw.ToolbarView` toolbar. The ```.inline`` `__ style class removes its background, so that it can be used in different contexts instead. .. image:: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/tab-bar-inline.png Constructors ------------ .. rst-class:: interim-class .. class:: TabBar :no-index: .. classmethod:: new() -> ~gi.repository.Adw.TabBar Creates a new ``AdwTabBar``\. Methods ------- .. rst-class:: interim-class .. class:: TabBar :no-index: .. method:: get_autohide() -> bool Gets whether the tabs automatically hide. .. method:: get_end_action_widget() -> ~gi.repository.Gtk.Widget | None Gets the widget shown after the tabs. .. method:: get_expand_tabs() -> bool Gets whether tabs expand to full width. .. method:: get_extra_drag_preferred_action() -> ~gi.repository.Gdk.DragAction Gets the current action during a drop on the extra_drop_target. .. versionadded:: 1.4 .. method:: get_extra_drag_preload() -> bool Gets whether drop data should be preloaded on hover. .. versionadded:: 1.3 .. method:: get_inverted() -> bool Gets whether tabs use inverted layout. .. method:: get_is_overflowing() -> bool Gets whether ``self`` is overflowing. If ``TRUE``\, all tabs cannot be displayed at once and require scrolling. .. method:: get_start_action_widget() -> ~gi.repository.Gtk.Widget | None Gets the widget shown before the tabs. .. method:: get_tabs_revealed() -> bool Gets whether the tabs are currently revealed. See :obj:`~gi.repository.Adw.TabBar.props.autohide`\. .. method:: get_view() -> ~gi.repository.Adw.TabView | None Gets the tab view ``self`` controls. .. method:: set_autohide(autohide: bool) -> None Sets whether the tabs automatically hide. If set to ``TRUE``\, the tab bar disappears when :obj:`~gi.repository.Adw.TabBar.props.view` has 0 or 1 tab, no pinned tabs, and no tab is being transferred. See :obj:`~gi.repository.Adw.TabBar.props.tabs_revealed`\. :param autohide: whether the tabs automatically hide .. method:: set_end_action_widget(widget: ~gi.repository.Gtk.Widget | None = None) -> None Sets the widget to show after the tabs. :param widget: the widget to show after the tabs .. method:: set_expand_tabs(expand_tabs: bool) -> None Sets whether tabs expand to full width. If set to ``TRUE``\, the tabs will always vary width filling the whole width when possible, otherwise tabs will always have the minimum possible size. :param expand_tabs: whether to expand tabs .. method:: set_extra_drag_preload(preload: bool) -> None Sets whether drop data should be preloaded on hover. See :obj:`~gi.repository.Gtk.DropTarget.props.preload`\. .. versionadded:: 1.3 :param preload: whether to preload drop data .. method:: set_inverted(inverted: bool) -> None Sets whether tabs tabs use inverted layout. If set to ``TRUE``\, non-pinned tabs will have the close button at the beginning and the indicator at the end rather than the opposite. :param inverted: whether tabs use inverted layout .. method:: set_start_action_widget(widget: ~gi.repository.Gtk.Widget | None = None) -> None Sets the widget to show before the tabs. :param widget: the widget to show before the tabs .. method:: set_view(view: ~gi.repository.Adw.TabView | None = None) -> None Sets the tab view ``self`` controls. :param view: a tab view .. method:: setup_extra_drop_target(actions: ~gi.repository.Gdk.DragAction, types: list[~gobject.GType] | None = None) -> None Sets the supported types for this drop target. Sets up an extra drop target on tabs. This allows to drag arbitrary content onto tabs, for example URLs in a web browser. If a tab is hovered for a certain period of time while dragging the content, it will be automatically selected. The :obj:`~gi.repository.Adw.TabBar.signals.extra_drag_drop` signal can be used to handle the drop. :param actions: the supported actions :param types: all supported ``GType``\s that can be dropped Properties ---------- .. rst-class:: interim-class .. class:: TabBar :no-index: .. attribute:: props.autohide :type: bool The type of the None singleton. .. attribute:: props.end_action_widget :type: ~gi.repository.Gtk.Widget The type of the None singleton. .. attribute:: props.expand_tabs :type: bool The type of the None singleton. .. attribute:: props.extra_drag_preferred_action :type: ~gi.repository.Gdk.DragAction The type of the None singleton. .. versionadded:: 1.4 .. attribute:: props.extra_drag_preload :type: bool The type of the None singleton. .. versionadded:: 1.3 .. attribute:: props.inverted :type: bool The type of the None singleton. .. attribute:: props.is_overflowing :type: bool The type of the None singleton. .. attribute:: props.start_action_widget :type: ~gi.repository.Gtk.Widget The type of the None singleton. .. attribute:: props.tabs_revealed :type: bool The type of the None singleton. .. attribute:: props.view :type: ~gi.repository.Adw.TabView The type of the None singleton. Signals ------- .. rst-class:: interim-class .. class:: TabBar.signals :no-index: .. method:: extra_drag_drop(page: ~gi.repository.Adw.TabPage, value: ~gi.repository.GObject.Value) -> bool The type of the None singleton. :param page: the page matching the tab the content was dropped onto :param value: the ``GValue`` being dropped .. method:: extra_drag_value(page: ~gi.repository.Adw.TabPage, value: ~gi.repository.GObject.Value) -> ~gi.repository.Gdk.DragAction The type of the None singleton. .. versionadded:: 1.3 :param page: the page matching the tab the content was dropped onto :param value: the ``GValue`` being dropped