Handy.TabBar¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)
- Structs:
Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
Whether the tabs automatically hide |
||
r/w/en |
The widget shown after the tabs |
||
r/w/en |
Whether tabs expand to full width |
||
r/w/en |
Extra drag destination targets |
||
r/w/en |
Whether tabs use inverted layout |
||
r |
Whether the tab bar is overflowing |
||
r/w/en |
The widget shown before the tabs |
||
r/en |
Whether the tabs are currently revealed |
||
r/w/en |
The view the tab bar controls. |
Style Properties¶
- Inherited:
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when content allowed via [property`TabBar`:py:data::extra-drag-dest-targets<Handy.TabBar.props.extra_drag_dest_targets>] is dropped onto a tab. |
Fields¶
- Inherited:
Class Details¶
- class Handy.TabBar(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A tab bar for [class`TabView`].
The
HdyTabBar
widget is a tab bar that can be used with conjunction with [class`TabView`].HdyTabBar
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,
HdyTabBar
will scroll them. Pinned tabs always stay visible and aren’t a part of the scrollable area.- CSS nodes
HdyTabBar
has a single CSS node with nametabbar
.New in version 1.2.
- classmethod new()¶
- Returns:
a new
HdyTabBar
- Return type:
Creates a new
HdyTabBar
widget.New in version 1.2.
- get_autohide()¶
- Returns:
whether the tabs automatically hide
- Return type:
Gets whether the tabs automatically hide.
New in version 1.2.
- get_end_action_widget()¶
- Returns:
the widget shown after the tabs
- Return type:
Gtk.Widget
orNone
Gets the widget shown after the tabs.
New in version 1.2.
- get_expand_tabs()¶
- Returns:
whether tabs should expand
- Return type:
Gets whether tabs should expand.
New in version 1.2.
- get_extra_drag_dest_targets()¶
- Returns:
extra drag targets
- Return type:
Gets extra drag destination targets.
New in version 1.2.
- get_inverted()¶
- Returns:
whether tabs use inverted layout
- Return type:
Gets whether tabs use inverted layout.
New in version 1.2.
- get_is_overflowing()¶
- Returns:
whether self is overflowing
- Return type:
Gets whether self is overflowing.
New in version 1.2.
- get_start_action_widget()¶
- Returns:
the widget shown before the tabs
- Return type:
Gtk.Widget
orNone
Gets the widget shown before the tabs.
New in version 1.2.
- get_tabs_revealed()¶
- Returns:
whether the tabs are current revealed
- Return type:
Gets the value of the [property`TabBar`:py:data::tabs-revealed<Handy.TabBar.props.tabs_revealed>] property.
New in version 1.2.
- get_view()¶
- Returns:
the [class`TabView`] self controls
- Return type:
Gets the [class`TabView`] self controls.
New in version 1.2.
- set_autohide(autohide)¶
- Parameters:
autohide (
bool
) – whether the tabs automatically hide
Sets whether the tabs automatically hide.
If autohide is
TRUE
, the tab bar disappears when the associated [class`TabView`] has 0 or 1 tab, no pinned tabs, and no tab is being transferred.Autohide is enabled by default.
See [property`TabBar`:py:data::tabs-revealed<Handy.TabBar.props.tabs_revealed>].
New in version 1.2.
- 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.
New in version 1.2.
- set_expand_tabs(expand_tabs)¶
- Parameters:
expand_tabs (
bool
) – whether to expand tabs
Sets whether tabs should expand.
If expand_tabs is
TRUE
, the tabs will always vary width filling the whole width when possible, otherwise tabs will always have the minimum possible size.Expand is enabled by default.
New in version 1.2.
- set_extra_drag_dest_targets(extra_drag_dest_targets)¶
- Parameters:
extra_drag_dest_targets (
Gtk.TargetList
orNone
) – extra drag targets
Sets extra drag destination targets.
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.
After content is dropped, the [signal`TabBar`:py:func:::extra-drag-data-received<Handy.TabBar.signals.extra_drag_data_received>] signal can be used to retrieve and process the drag data.
New in version 1.2.
- set_inverted(inverted)¶
- Parameters:
inverted (
bool
) – whether tabs use inverted layout
Sets whether tabs tabs use inverted layout.
If inverted is
TRUE
, non-pinned tabs will have the close button at the beginning and the indicator at the end rather than the opposite.New in version 1.2.
- 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.
New in version 1.2.
- set_view(view)¶
- Parameters:
view (
Handy.TabView
orNone
) – a tab view
Sets the [class`TabView`] self controls.
New in version 1.2.
Signal Details¶
- Handy.TabBar.signals.extra_drag_data_received(tab_bar, page, context, data, info, time)¶
- Signal Name:
extra-drag-data-received
- Flags:
- Parameters:
tab_bar (
Handy.TabBar
) – The object which received the signalpage (
Handy.TabPage
) – the tab page matching the tab the content was dropped ontocontext (
Gdk.DragContext
) – the drag contextdata (
Gtk.SelectionData
) – the received datainfo (
int
) – the info that has been registered with the target in the [struct`Gtk`.TargetList]time (
int
) – the timestamp at which the data was received
Emitted when content allowed via [property`TabBar`:py:data::extra-drag-dest-targets<Handy.TabBar.props.extra_drag_dest_targets>] is dropped onto a tab.
See [signal`Gtk`.Widget::drag-data-received].
New in version 1.2.
Property Details¶
- Handy.TabBar.props.autohide¶
- Name:
autohide
- Type:
- Default Value:
- Flags:
Whether tabs automatically hide.
If set to
TRUE
, the tab bar disappears when the associated [class`TabView`] has 0 or 1 tab, no pinned tabs, and no tab is being transferred.See [property`TabBar`:py:data::tabs-revealed<Handy.TabBar.props.tabs_revealed>].
New in version 1.2.
- Handy.TabBar.props.end_action_widget¶
- Name:
end-action-widget
- Type:
- Default Value:
- Flags:
The widget shown after the tabs.
New in version 1.2.
- Handy.TabBar.props.expand_tabs¶
- Name:
expand-tabs
- Type:
- Default Value:
- Flags:
Whether tabs should expand.
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.New in version 1.2.
- Handy.TabBar.props.extra_drag_dest_targets¶
- Name:
extra-drag-dest-targets
- Type:
- Default Value:
- Flags:
Extra drag destination targets.
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.
After content is dropped, the [signal`TabBar`:py:func:::extra-drag-data-received<Handy.TabBar.signals.extra_drag_data_received>] signal can be used to retrieve and process the drag data.
New in version 1.2.
- Handy.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.New in version 1.2.
- Handy.TabBar.props.is_overflowing¶
-
Whether the tab bar is overflowing.
If set to
TRUE
, all tabs cannot be displayed at once and require scrolling.New in version 1.2.
- Handy.TabBar.props.start_action_widget¶
- Name:
start-action-widget
- Type:
- Default Value:
- Flags:
The widget shown before the tabs.
New in version 1.2.
- Handy.TabBar.props.tabs_revealed¶
- Name:
tabs-revealed
- Type:
- Default Value:
- Flags:
Whether tabs are currently revealed.
See [property`TabBar`:py:data::autohide<Handy.TabBar.props.autohide>].
New in version 1.2.
- Handy.TabBar.props.view¶
- Name:
view
- Type:
- Default Value:
- Flags:
The [class`TabView`] the tab bar controls.
New in version 1.2.