Handy.TabBar

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Bin Gtk.Bin Handy.TabBar Handy.TabBar Gtk.Bin->Handy.TabBar Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Container->Gtk.Bin Gtk.Widget->Gtk.Container

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

new ()

get_autohide ()

get_end_action_widget ()

get_expand_tabs ()

get_extra_drag_dest_targets ()

get_inverted ()

get_is_overflowing ()

get_start_action_widget ()

get_tabs_revealed ()

get_view ()

set_autohide (autohide)

set_end_action_widget (widget)

set_expand_tabs (expand_tabs)

set_extra_drag_dest_targets (extra_drag_dest_targets)

set_inverted (inverted)

set_start_action_widget (widget)

set_view (view)

Virtual Methods

Inherited:

Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

Properties

Inherited:

Gtk.Container (3), Gtk.Widget (39)

Name

Type

Flags

Short Description

autohide

bool

r/w/en

Whether the tabs automatically hide

end-action-widget

Gtk.Widget

r/w/en

The widget shown after the tabs

expand-tabs

bool

r/w/en

Whether tabs expand to full width

extra-drag-dest-targets

Gtk.TargetList

r/w/en

Extra drag destination targets

inverted

bool

r/w/en

Whether tabs use inverted layout

is-overflowing

bool

r

Whether the tab bar is overflowing

start-action-widget

Gtk.Widget

r/w/en

The widget shown before the tabs

tabs-revealed

bool

r/en

Whether the tabs are currently revealed

view

Handy.TabView

r/w/en

The view the tab bar controls.

Style Properties

Inherited:

Gtk.Widget (17)

Signals

Inherited:

Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Short Description

extra-drag-data-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.

Fields

Inherited:

Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Class Details

class Handy.TabBar(**kwargs)
Bases:

Gtk.Bin

Abstract:

No

Structure:

Handy.TabBarClass

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 name tabbar.

New in version 1.2.

classmethod new()
Returns:

a new HdyTabBar

Return type:

Handy.TabBar

Creates a new HdyTabBar widget.

New in version 1.2.

get_autohide()
Returns:

whether the tabs automatically hide

Return type:

bool

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 or None

Gets the widget shown after the tabs.

New in version 1.2.

get_expand_tabs()
Returns:

whether tabs should expand

Return type:

bool

Gets whether tabs should expand.

New in version 1.2.

get_extra_drag_dest_targets()
Returns:

extra drag targets

Return type:

Gtk.TargetList or None

Gets extra drag destination targets.

New in version 1.2.

get_inverted()
Returns:

whether tabs use inverted layout

Return type:

bool

Gets whether tabs use inverted layout.

New in version 1.2.

get_is_overflowing()
Returns:

whether self is overflowing

Return type:

bool

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 or None

Gets the widget shown before the tabs.

New in version 1.2.

get_tabs_revealed()
Returns:

whether the tabs are current revealed

Return type:

bool

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:

Handy.TabView or None

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 or None) – 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 or None) – 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 or None) – 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 or None) – 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:

RUN_LAST

Parameters:
  • tab_bar (Handy.TabBar) – The object which received the signal

  • page (Handy.TabPage) – the tab page matching the tab the content was dropped onto

  • context (Gdk.DragContext) – the drag context

  • data (Gtk.SelectionData) – the received data

  • info (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:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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:

Gtk.Widget

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The widget shown after the tabs.

New in version 1.2.

Handy.TabBar.props.expand_tabs
Name:

expand-tabs

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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:

Gtk.TargetList

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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
Name:

is-overflowing

Type:

bool

Default Value:

False

Flags:

READABLE

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:

Gtk.Widget

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The widget shown before the tabs.

New in version 1.2.

Handy.TabBar.props.tabs_revealed
Name:

tabs-revealed

Type:

bool

Default Value:

False

Flags:

READABLE, EXPLICIT_NOTIFY

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:

Handy.TabView

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The [class`TabView`] the tab bar controls.

New in version 1.2.