Adw.TabOverview

g Adw.TabOverview Adw.TabOverview GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.Widget->Adw.TabOverview

Subclasses:

None

Methods

Inherited:

Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new ()

get_child ()

get_enable_new_tab ()

get_enable_search ()

get_extra_drag_preferred_action ()

get_extra_drag_preload ()

get_inverted ()

get_open ()

get_search_active ()

get_secondary_menu ()

get_show_end_title_buttons ()

get_show_start_title_buttons ()

get_view ()

set_child (child)

set_enable_new_tab (enable_new_tab)

set_enable_search (enable_search)

set_extra_drag_preload (preload)

set_inverted (inverted)

set_open (open)

set_secondary_menu (secondary_menu)

set_show_end_title_buttons (show_end_title_buttons)

set_show_start_title_buttons (show_start_title_buttons)

set_view (view)

setup_extra_drop_target (actions, types)

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

Properties

Inherited:

Gtk.Widget (34), Gtk.Accessible (1)

Name

Type

Flags

Short Description

child

Gtk.Widget

r/w/en

enable-new-tab

bool

r/w/en

enable-search

bool

r/w/en

extra-drag-preferred-action

Gdk.DragAction

r/en

extra-drag-preload

bool

r/w/en

inverted

bool

r/w/en

open

bool

r/w/en

search-active

bool

r

secondary-menu

Gio.MenuModel

r/w/en

show-end-title-buttons

bool

r/w/en

show-start-title-buttons

bool

r/w/en

view

Adw.TabView

r/w/en

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Name

Short Description

create-tab

Emitted when a tab needs to be created; This can happen after the new tab button has been pressed, see [property`TabOverview`:py:data::enable-new-tab<Adw.TabOverview.props.enable_new_tab>].

extra-drag-drop

This signal is emitted when content is dropped onto a tab.

extra-drag-value

This signal is emitted when the dropped content is preloaded.

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Class Details

class Adw.TabOverview(**kwargs)
Bases:

Gtk.Widget

Abstract:

No

Structure:

Adw.TabOverviewClass

A tab overview for [class`TabView`].

<picture> <source srcset=”tab-overview-dark.png” media=”(prefers-color-scheme: dark)”> <img src=”tab-overview.png” alt=”tab-overview”> </picture>

AdwTabOverview is a widget that can display tabs from an AdwTabView in a grid.

AdwTabOverview shows a thumbnail for each tab. By default thumbnails are static for all pages except the selected one. They can be made always live by setting [property`TabPage`:py:data::live-thumbnail<Adw.TabOverview.props.live_thumbnail>] to TRUE, or refreshed with [method`TabPage`.invalidate_thumbnail] or [method`TabView`.invalidate_thumbnails] otherwise.

If the pages are too tall or too wide, the thumbnails will be cropped; use [property`TabPage`:py:data::thumbnail-xalign<Adw.TabOverview.props.thumbnail_xalign>] and [property`TabPage`:py:data::thumbnail-yalign<Adw.TabOverview.props.thumbnail_yalign>] to control which part of the page should be visible in this case.

Pinned tabs are shown as smaller cards without thumbnails above the other tabs. Unlike in [class`TabBar`], they still have titles, as well as an unpin button.

AdwTabOverview provides search in open tabs. It searches in tab titles and tooltips, as well as [property`TabPage`:py:data::keyword<Adw.TabOverview.props.keyword>].

If [property`TabOverview`:py:data::enable-new-tab<Adw.TabOverview.props.enable_new_tab>] is set to TRUE, a new tab button will be shown. Connect to the [signal`TabOverview`:py:func:::create-tab<Adw.TabOverview.signals.create_tab>] signal to use it.

[property`TabOverview`:py:data::secondary-menu<Adw.TabOverview.props.secondary_menu>] can be used to provide a secondary menu for the overview. Use it to add extra actions, e.g. to open a new window or undo closed tab.

AdwTabOverview is intended to be used as the direct child of the window, with the rest of the window contents set as the [property`TabOverview`:py:data::child<Adw.TabOverview.props.child>]. The child is expected to contain an [class`TabView`].

AdwTabOverview shows window buttons by default. They can be disabled by setting [property`TabOverview`:py:data::show-start-title-buttons<Adw.TabOverview.props.show_start_title_buttons>] and/or [property`TabOverview`:py:data::show-start-title-buttons<Adw.TabOverview.props.show_start_title_buttons>] and/or [property`TabOverview`:py:data::show-end-title-buttons<Adw.TabOverview.props.show_end_title_buttons>] to FALSE.

If search and window buttons are disabled, and secondary menu is not set, the header bar will be hidden.

Actions

AdwTabOverview defines the overview.open and overview.close actions for opening and closing itself. They can be convenient when used together with [class`TabButton`].

CSS nodes

AdwTabOverview has a single CSS node with name taboverview.

New in version 1.3.

classmethod new()
Returns:

the newly created AdwTabOverview

Return type:

Gtk.Widget

Creates a new AdwTabOverview.

New in version 1.3.

get_child()
Returns:

the child widget of self

Return type:

Gtk.Widget or None

Gets the child widget of self.

New in version 1.3.

get_enable_new_tab()
Returns:

whether new tab button is enabled

Return type:

bool

Gets whether to new tab button is enabled for self.

New in version 1.3.

Returns:

whether search is enabled

Return type:

bool

Gets whether search in tabs is enabled for self.

New in version 1.3.

get_extra_drag_preferred_action()
Returns:

the drag action of the current drop.

Return type:

Gdk.DragAction

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:

bool

Gets whether drop data should be preloaded on hover.

New in version 1.3.

get_inverted()
Returns:

whether thumbnails use inverted layout

Return type:

bool

Gets whether thumbnails use inverted layout.

New in version 1.3.

get_open()
Returns:

whether the overview is open

Return type:

bool

Gets whether self is open.

New in version 1.3.

get_search_active()
Returns:

whether search is active

Return type:

bool

Gets whether search is currently active for self.

See [property`TabOverview`:py:data::enable-search<Adw.TabOverview.props.enable_search>].

New in version 1.3.

get_secondary_menu()
Returns:

the secondary menu model

Return type:

Gio.MenuModel or None

Gets the secondary menu model for self.

New in version 1.3.

get_show_end_title_buttons()
Returns:

whether end title buttons are shown

Return type:

bool

Gets whether end title buttons are shown in self's header bar.

New in version 1.3.

get_show_start_title_buttons()
Returns:

whether start title buttons are shown

Return type:

bool

Gets whether start title buttons are shown in self's header bar.

New in version 1.3.

get_view()
Returns:

the tab view

Return type:

Adw.TabView or None

Gets the tab view self controls.

New in version 1.3.

set_child(child)
Parameters:

child (Gtk.Widget or None) – the child widget

Sets the child widget of self.

New in version 1.3.

set_enable_new_tab(enable_new_tab)
Parameters:

enable_new_tab (bool) – whether to enable new tab button

Sets whether to enable new tab button for self.

Connect to the [signal`TabOverview`:py:func:::create-tab<Adw.TabOverview.signals.create_tab>] signal to use it.

New in version 1.3.

Parameters:

enable_search (bool) – whether to enable search

Sets whether to enable search in tabs for self.

Search matches tab titles and tooltips, as well as keywords, set via [property`TabPage`:py:data::keyword<Adw.TabOverview.props.keyword>]. Use keywords to search in e.g. page URLs in a web browser.

During search, tab reordering and drag-n-drop are disabled.

Use [property`TabOverview`:py:data::search-active<Adw.TabOverview.props.search_active>] to check out if search is currently active.

New in version 1.3.

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 thumbnails use inverted layout

Sets whether thumbnails use inverted layout.

If set to TRUE, thumbnails will have the close or unpin button at the beginning and the indicator at the end rather than the other way around.

New in version 1.3.

set_open(open)
Parameters:

open (bool) – whether the overview is open

Sets whether the to open self.

New in version 1.3.

set_secondary_menu(secondary_menu)
Parameters:

secondary_menu (Gio.MenuModel or None) – a menu model

Sets the secondary menu model for self.

Use it to add extra actions, e.g. to open a new window or undo closed tab.

New in version 1.3.

set_show_end_title_buttons(show_end_title_buttons)
Parameters:

show_end_title_buttons (bool) – whether to show end title buttons

Sets whether to show end title buttons in self's header bar.

See [property`HeaderBar`:py:data::show-start-title-buttons<Adw.TabOverview.props.show_start_title_buttons>] for the other side.

New in version 1.3.

set_show_start_title_buttons(show_start_title_buttons)
Parameters:

show_start_title_buttons (bool) – whether to show start title buttons

Sets whether to show start title buttons in self's header bar.

See [property`HeaderBar`:py:data::show-end-title-buttons<Adw.TabOverview.props.show_end_title_buttons>] for the other side.

New in version 1.3.

set_view(view)
Parameters:

view (Adw.TabView or None) – a tab view

Sets the tab view to control.

The view must be inside self, see [property`TabOverview`:py:data::child<Adw.TabOverview.props.child>].

New in version 1.3.

setup_extra_drop_target(actions, types)
Parameters:

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`TabOverview`:py:func:::extra-drag-drop<Adw.TabOverview.signals.extra_drag_drop>] signal can be used to handle the drop.

New in version 1.3.

Signal Details

Adw.TabOverview.signals.create_tab(tab_overview)
Signal Name:

create-tab

Flags:

RUN_LAST

Parameters:

tab_overview (Adw.TabOverview) – The object which received the signal

Returns:

the newly created page

Return type:

Adw.TabPage

Emitted when a tab needs to be created;

This can happen after the new tab button has been pressed, see [property`TabOverview`:py:data::enable-new-tab<Adw.TabOverview.props.enable_new_tab>].

The signal handler is expected to create a new page in the corresponding [class`TabView`] and return it.

New in version 1.3.

Adw.TabOverview.signals.extra_drag_drop(tab_overview, page, value)
Signal Name:

extra-drag-drop

Flags:

RUN_LAST

Parameters:
  • tab_overview (Adw.TabOverview) – The object which received the signal

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

  • value (GObject.Value) – the GValue being dropped

Returns:

whether the drop was accepted for page

Return type:

bool

This signal is emitted when content is dropped onto a tab.

The content must be of one of the types set up via [method`TabOverview`.setup_extra_drop_target].

See [signal`Gtk`.DropTarget::drop].

New in version 1.3.

Adw.TabOverview.signals.extra_drag_value(tab_overview, page, value)
Signal Name:

extra-drag-value

Flags:

RUN_LAST

Parameters:
  • tab_overview (Adw.TabOverview) – The object which received the signal

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

  • value (GObject.Value) – the GValue being dropped

Returns:

the preferred action for the drop on page

Return type:

Gdk.DragAction

This signal is emitted when the dropped content is preloaded.

In order for data to be preloaded, [property`TabOverview`:py:data::extra-drag-preload<Adw.TabOverview.props.extra_drag_preload>] must be set to TRUE.

The content must be of one of the types set up via [method`TabOverview`.setup_extra_drop_target].

See [property`Gtk`.DropTarget:value].

New in version 1.3.

Property Details

Adw.TabOverview.props.child
Name:

child

Type:

Gtk.Widget

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The child widget.

New in version 1.3.

Adw.TabOverview.props.enable_new_tab
Name:

enable-new-tab

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether to enable new tab button.

Connect to the [signal`TabOverview`:py:func:::create-tab<Adw.TabOverview.signals.create_tab>] signal to use it.

New in version 1.3.

Name:

enable-search

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether to enable search in tabs.

Search matches tab titles and tooltips, as well as keywords, set via [property`TabPage`:py:data::keyword<Adw.TabOverview.props.keyword>]. Use keywords to search in e.g. page URLs in a web browser.

During search, tab reordering and drag-n-drop are disabled.

Use [property`TabOverview`:py:data::search-active<Adw.TabOverview.props.search_active>] to check out if search is currently active.

New in version 1.3.

Adw.TabOverview.props.extra_drag_preferred_action
Name:

extra-drag-preferred-action

Type:

Gdk.DragAction

Default Value:

0

Flags:

READABLE, EXPLICIT_NOTIFY

The unique action on the current-drop of the [signal`TabOverview`:py:func:::extra-drag-drop<Adw.TabOverview.signals.extra_drag_drop>].

This property should only be used during a [signal`TabOverview`:py:func:::extra-drag-drop<Adw.TabOverview.signals.extra_drag_drop>] and is always a subset of what was originally passed to [method`TabOverview`.setup_extra_drop_target].

New in version 1.4.

Adw.TabOverview.props.extra_drag_preload
Name:

extra-drag-preload

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether the drop data should be preloaded on hover.

See [property`Gtk`.DropTarget:preload].

New in version 1.3.

Adw.TabOverview.props.inverted
Name:

inverted

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether thumbnails use inverted layout.

If set to TRUE, thumbnails will have the close or unpin buttons at the beginning and the indicator at the end rather than the other way around.

New in version 1.3.

Adw.TabOverview.props.open
Name:

open

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether the overview is open.

New in version 1.3.

Adw.TabOverview.props.search_active
Name:

search-active

Type:

bool

Default Value:

False

Flags:

READABLE

Whether search is currently active.

See [property`TabOverview`:py:data::enable-search<Adw.TabOverview.props.enable_search>].

New in version 1.3.

Adw.TabOverview.props.secondary_menu
Name:

secondary-menu

Type:

Gio.MenuModel

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The secondary menu model.

Use it to add extra actions, e.g. to open a new window or undo closed tab.

New in version 1.3.

Adw.TabOverview.props.show_end_title_buttons
Name:

show-end-title-buttons

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether to show end title buttons in the overview’s header bar.

See [property`HeaderBar`:py:data::show-start-title-buttons<Adw.TabOverview.props.show_start_title_buttons>] for the other side.

New in version 1.3.

Adw.TabOverview.props.show_start_title_buttons
Name:

show-start-title-buttons

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether to show start title buttons in the overview’s header bar.

See [property`HeaderBar`:py:data::show-end-title-buttons<Adw.TabOverview.props.show_end_title_buttons>] for the other side.

New in version 1.3.

Adw.TabOverview.props.view
Name:

view

Type:

Adw.TabView

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The tab view the overview controls.

The view must be inside the tab overview, see [property`TabOverview`:py:data::child<Adw.TabOverview.props.child>].

New in version 1.3.