Adw.TabBar¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/en |
|||
r/w/en |
|||
r/w/en |
|||
r |
|||
r/w/en |
|||
r |
|||
r/w/en |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted when content is dropped onto a tab. |
|
This signal is emitted when the dropped content is preloaded. |
Fields¶
- Inherited:
Class Details¶
- class Adw.TabBar(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A tab bar for [class`TabView`].
<picture> <source srcset=”tab-bar-dark.png” media=”(prefers-color-scheme: dark)”> <img src=”tab-bar.png” alt=”tab-bar”> </picture>
The
AdwTabBar
widget is a tab bar that can be used with conjunction withAdwTabView
. It is typically used as a top bar within [class`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 nametabbar
.- classmethod new()¶
- Returns:
the newly created
AdwTabBar
- Return type:
Creates a new
AdwTabBar
.
- get_autohide()¶
- Returns:
whether the tabs automatically hide
- Return type:
Gets whether the tabs automatically hide.
- get_end_action_widget()¶
- Returns:
the widget shown after the tabs
- Return type:
Gtk.Widget
orNone
Gets the widget shown after the tabs.
- get_expand_tabs()¶
- Returns:
whether tabs expand to full width.
- Return type:
Gets whether tabs expand to full width.
- get_extra_drag_preferred_action()¶
- Returns:
the drag action of the current drop.
- Return type:
Gets the current action during a drop on the extra_drop_target.
New in version 1.4.
- get_extra_drag_preload()¶
- Returns:
whether drop data should be preloaded on hover
- Return type:
Gets whether drop data should be preloaded on hover.
New in version 1.3.
- get_inverted()¶
- Returns:
whether tabs use inverted layout
- Return type:
Gets whether tabs use inverted layout.
- get_is_overflowing()¶
- Returns:
whether self is overflowing
- Return type:
Gets whether self is overflowing.
If
TRUE
, all tabs cannot be displayed at once and require scrolling.
- get_start_action_widget()¶
- Returns:
the widget shown before the tabs
- Return type:
Gtk.Widget
orNone
Gets the widget shown before the tabs.
- get_tabs_revealed()¶
- Returns:
whether the tabs are currently revealed
- Return type:
Gets whether the tabs are currently revealed.
See [property`TabBar`:py:data::autohide<Adw.TabBar.props.autohide>].
- get_view()¶
- Returns:
the view self controls
- Return type:
Adw.TabView
orNone
Gets the tab view self controls.
- set_autohide(autohide)¶
- Parameters:
autohide (
bool
) – whether the tabs automatically hide
Sets whether the tabs automatically hide.
If set to
TRUE
, the tab bar disappears when [property`TabBar`:py:data::view<Adw.TabBar.props.view>] has 0 or 1 tab, no pinned tabs, and no tab is being transferred.See [property`TabBar`:py:data::tabs-revealed<Adw.TabBar.props.tabs_revealed>].
- set_end_action_widget(widget)¶
- Parameters:
widget (
Gtk.Widget
orNone
) – the widget to show after the tabs
Sets the widget to show after the tabs.
- set_expand_tabs(expand_tabs)¶
- Parameters:
expand_tabs (
bool
) – whether to expand tabs
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.
- set_extra_drag_preload(preload)¶
- Parameters:
preload (
bool
) – whether to preload drop data
Sets whether drop data should be preloaded on hover.
See [property`Gtk`.DropTarget:preload].
New in version 1.3.
- set_inverted(inverted)¶
- Parameters:
inverted (
bool
) – whether tabs use inverted layout
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.
- set_start_action_widget(widget)¶
- Parameters:
widget (
Gtk.Widget
orNone
) – the widget to show before the tabs
Sets the widget to show before the tabs.
- set_view(view)¶
- Parameters:
view (
Adw.TabView
orNone
) – a tab view
Sets the tab view self controls.
- setup_extra_drop_target(actions, types)¶
- Parameters:
actions (
Gdk.DragAction
) – the supported actionstypes ([
GObject.GType
] orNone
) – all supported ``GType``s that can be dropped
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 [signal`TabBar`:py:func:::extra-drag-drop<Adw.TabBar.signals.extra_drag_drop>] signal can be used to handle the drop.
Signal Details¶
- Adw.TabBar.signals.extra_drag_drop(tab_bar, page, value)¶
- Signal Name:
extra-drag-drop
- Flags:
- Parameters:
tab_bar (
Adw.TabBar
) – The object which received the signalpage (
Adw.TabPage
) – the page matching the tab the content was dropped ontovalue (
GObject.Value
) – theGValue
being dropped
- Returns:
whether the drop was accepted for page
- Return type:
This signal is emitted when content is dropped onto a tab.
The content must be of one of the types set up via [method`TabBar`.setup_extra_drop_target].
See [signal`Gtk`.DropTarget::drop].
- Adw.TabBar.signals.extra_drag_value(tab_bar, page, value)¶
- Signal Name:
extra-drag-value
- Flags:
- Parameters:
tab_bar (
Adw.TabBar
) – The object which received the signalpage (
Adw.TabPage
) – the page matching the tab the content was dropped ontovalue (
GObject.Value
) – theGValue
being dropped
- Returns:
the preferred action for the drop on page
- Return type:
This signal is emitted when the dropped content is preloaded.
In order for data to be preloaded, [property`TabBar`:py:data::extra-drag-preload<Adw.TabBar.props.extra_drag_preload>] must be set to
TRUE
.The content must be of one of the types set up via [method`TabBar`.setup_extra_drop_target].
See [property`Gtk`.DropTarget:value].
New in version 1.3.
Property Details¶
- Adw.TabBar.props.autohide¶
- Name:
autohide
- Type:
- Default Value:
- Flags:
Whether the tabs automatically hide.
If set to
TRUE
, the tab bar disappears when [property`TabBar`:py:data::view<Adw.TabBar.props.view>] has 0 or 1 tab, no pinned tabs, and no tab is being transferred.See [property`TabBar`:py:data::tabs-revealed<Adw.TabBar.props.tabs_revealed>].
- Adw.TabBar.props.end_action_widget¶
- Name:
end-action-widget
- Type:
- Default Value:
- Flags:
The widget shown after the tabs.
- Adw.TabBar.props.expand_tabs¶
- Name:
expand-tabs
- Type:
- Default Value:
- Flags:
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.
- Adw.TabBar.props.extra_drag_preferred_action¶
- Name:
extra-drag-preferred-action
- Type:
- Default Value:
0
- Flags:
The unique action on the
current-drop
of the [signal`TabBar`:py:func:::extra-drag-drop<Adw.TabBar.signals.extra_drag_drop>].This property should only be used during a [signal`TabBar`:py:func:::extra-drag-drop<Adw.TabBar.signals.extra_drag_drop>] and is always a subset of what was originally passed to [method`TabBar`.setup_extra_drop_target].
New in version 1.4.
- Adw.TabBar.props.extra_drag_preload¶
- Name:
extra-drag-preload
- Type:
- Default Value:
- Flags:
Whether the drop data should be preloaded on hover.
See [property`Gtk`.DropTarget:preload].
New in version 1.3.
- Adw.TabBar.props.inverted¶
- Name:
inverted
- Type:
- Default Value:
- Flags:
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.
- Adw.TabBar.props.is_overflowing¶
-
Whether the tab bar is overflowing.
If
TRUE
, all tabs cannot be displayed at once and require scrolling.
- Adw.TabBar.props.start_action_widget¶
- Name:
start-action-widget
- Type:
- Default Value:
- Flags:
The widget shown before the tabs.
- Adw.TabBar.props.tabs_revealed¶
-
Whether the tabs are currently revealed.
See [property`TabBar`:py:data::autohide<Adw.TabBar.props.autohide>].
- Adw.TabBar.props.view¶
- Name:
view
- Type:
- Default Value:
- Flags:
The tab view the tab bar controls.