: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` :Constructors: :: TabBar(**properties) new() -> Adw.TabBar 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: ~typing.Sequence[type] | 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 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`. .. attribute:: props.end_action_widget :type: ~gi.repository.Gtk.Widget The widget shown after the tabs. .. attribute:: props.expand_tabs :type: bool 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. .. attribute:: props.extra_drag_preferred_action :type: ~gi.repository.Gdk.DragAction The unique action on the ``current-drop`` of the :obj:`~gi.repository.Adw.TabBar.signals.extra_drag_drop`. This property should only be used during a :obj:`~gi.repository.Adw.TabBar.signals.extra_drag_drop` and is always a subset of what was originally passed to :obj:`~gi.repository.TabBar.setup_extra_drop_target`. .. versionadded:: 1.4 .. attribute:: props.extra_drag_preload :type: bool Whether the drop data should be preloaded on hover. See :obj:`~gi.repository.Gtk.DropTarget.props.preload`. .. versionadded:: 1.3 .. attribute:: props.inverted :type: bool Whether 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. .. attribute:: props.is_overflowing :type: bool Whether the tab bar is overflowing. If ``TRUE``, all tabs cannot be displayed at once and require scrolling. .. attribute:: props.start_action_widget :type: ~gi.repository.Gtk.Widget The widget shown before the tabs. .. attribute:: props.tabs_revealed :type: bool Whether the tabs are currently revealed. See :obj:`~gi.repository.Adw.TabBar.props.autohide`. .. attribute:: props.view :type: ~gi.repository.Adw.TabView The tab view the tab bar controls. Signals ------- .. rst-class:: interim-class .. class:: TabBar.signals :no-index: .. method:: extra_drag_drop(page: ~gi.repository.Adw.TabPage, value: ~typing.Any) -> bool This signal is emitted when content is dropped onto a tab. The content must be of one of the types set up via :obj:`~gi.repository.TabBar.setup_extra_drop_target`. See :obj:`~gi.repository.Gtk.DropTarget.signals.drop`. :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: ~typing.Any) -> ~gi.repository.Gdk.DragAction This signal is emitted when the dropped content is preloaded. In order for data to be preloaded, :obj:`~gi.repository.Adw.TabBar.props.extra_drag_preload` must be set to ``TRUE``. The content must be of one of the types set up via :obj:`~gi.repository.TabBar.setup_extra_drop_target`. See :obj:`~gi.repository.Gtk.DropTarget.props.value`. .. versionadded:: 1.3 :param page: the page matching the tab the content was dropped onto :param value: the ``GValue`` being dropped