1.63 <AdwTabOverview>

Class: <AdwTabOverview>

It derives from <GtkWidget>.

A tab overview for TabView.

<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 TabPage:live-thumbnail to TRUE, or refreshed with TabPage.invalidate_thumbnail or TabView.invalidate_thumbnails otherwise.

If the pages are too tall or too wide, the thumbnails will be cropped; use TabPage:thumbnail-xalign and TabPage: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 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 TabPage:keyword.

If TabOverview:enable-new-tab is set to TRUE, a new tab button will be shown. Connect to the "create-tab" signal to use it.

TabOverview: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 TabOverview:child. The child is expected to contain an TabView.

<AdwTabOverview> shows window buttons by default. They can be disabled by setting TabOverview:show-start-title-buttons and/or TabOverview:show-start-title-buttons and/or TabOverview: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.

Drag-and-Drop

<AdwTabOverview> thumbnails can have an additional drop target for arbitrary content.

Use TabOverview.setup_extra_drop_target to set it up, specifying the supported content types and drag actions, then connect to "extra-drag-drop" to handle a drop.

In some cases, it may be necessary to determine the used action based on the content. In that case, set TabOverview:extra-drag-preload to TRUE and connect to "extra-drag-value" signal, then return the action from its handler. To access this action from the "extra-drag-drop" handler, use the TabOverview:extra-drag-preferred-action property.

"extra-drag-value" is also always emitted when starting to hover an item, with a NULL value. This happens even when TabOverview:extra-drag-preload is FALSE.

Actions

<AdwTabOverview> defines the overview.open and overview.close actions for opening and closing itself. They can be convenient when used together with TabButton.

CSS nodes

<AdwTabOverview> has a single CSS node with name taboverview.

Properties

Property: tab-overview:child self

The child widget.

Its value is a <GtkWidget>, or #f.

Set it with (set! (tab-overview:child self) value).

Property: tab-overview:enable-new-tab self

Whether to enable new tab button.

Connect to the "create-tab" signal to use it.

Its value is a boolean.

Set it with (set! (tab-overview:enable-new-tab self) value).

Property: tab-overview:enable-search self

Whether to enable search in tabs.

Search matches tab titles and tooltips, as well as keywords, set via TabPage: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 TabOverview:search-active to check out if search is currently active.

Its value is a boolean.

Set it with (set! (tab-overview:enable-search self) value).

Property: tab-overview:extra-drag-preferred-action self

The current drag action during a drop.

This property should only be used from inside a "extra-drag-drop" handler.

The action will be a subset of what was originally passed to TabOverview.setup_extra_drop_target.

Its value is a <GdkDragAction>.

It is read only.

Property: tab-overview:extra-drag-preload self

Whether the drop data should be preloaded on hover.

See drop-target:preload.

Its value is a boolean.

Set it with (set! (tab-overview:extra-drag-preload self) value).

Property: tab-overview:inverted self

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.

Its value is a boolean.

Set it with (set! (tab-overview:inverted self) value).

Property: tab-overview:open self

Whether the overview is open.

Its value is a boolean.

Set it with (set! (tab-overview:open self) value).

Property: tab-overview:search-active self

Whether search is currently active.

See TabOverview:enable-search.

Its value is a boolean.

It is read only.

Property: tab-overview:secondary-menu self

The secondary menu model.

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

Its value is a <GMenuModel>, or #f.

Set it with (set! (tab-overview:secondary-menu self) value).

Property: tab-overview:show-end-title-buttons self

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

See HeaderBar:show-start-title-buttons for the other side.

Its value is a boolean.

Set it with (set! (tab-overview:show-end-title-buttons self) value).

Property: tab-overview:show-start-title-buttons self

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

See HeaderBar:show-end-title-buttons for the other side.

Its value is a boolean.

Set it with (set! (tab-overview:show-start-title-buttons self) value).

Property: tab-overview:view self

The tab view the overview controls.

The view must be inside the tab overview, see TabOverview:child.

Its value is a <AdwTabView>, or #f.

Set it with (set! (tab-overview:view self) value).

Procedures

Method: tab-overview:get-child self ⇒ %return
Method: get-child self ⇒ %return

Gets the child widget of self.

self

Passed: a <AdwTabOverview>.

a tab overview

%return

Returned: a <GtkWidget>, or #f.

the child widget of self

Method: tab-overview:get-enable-new-tab? self ⇒ %return
Method: get-enable-new-tab? self ⇒ %return

Gets whether to new tab button is enabled for self.

self

Passed: a <AdwTabOverview>.

a tab overview

%return

Returned: a boolean.

whether new tab button is enabled

Method: tab-overview:get-enable-search? self ⇒ %return
Method: get-enable-search? self ⇒ %return

Gets whether search in tabs is enabled for self.

self

Passed: a <AdwTabOverview>.

a tab overview

%return

Returned: a boolean.

whether search is enabled

Method: tab-overview:get-extra-drag-preferred-action self ⇒ %return
Method: get-extra-drag-preferred-action self ⇒ %return

Gets the current action during a drop on the extra_drop_target.

self

Passed: a <AdwTabOverview>.

a tab overview

%return

Returned: a <GdkDragAction>.

the drag action of the current drop.

Method: tab-overview:get-extra-drag-preload? self ⇒ %return
Method: get-extra-drag-preload? self ⇒ %return

Gets the current drag action during a drop.

This method should only be used from inside a "extra-drag-drop" handler.

The action will be a subset of what was originally passed to TabOverview.setup_extra_drop_target.

self

Passed: a <AdwTabOverview>.

a tab overview

%return

Returned: a boolean.

the drag action of the current drop

Method: tab-overview:get-inverted? self ⇒ %return
Method: get-inverted? self ⇒ %return

Gets whether thumbnails use inverted layout.

self

Passed: a <AdwTabOverview>.

a tab overview

%return

Returned: a boolean.

whether thumbnails use inverted layout

Method: tab-overview:get-open? self ⇒ %return
Method: get-open? self ⇒ %return

Gets whether self is open.

self

Passed: a <AdwTabOverview>.

a tab overview

%return

Returned: a boolean.

whether the overview is open

Method: tab-overview:get-search-active? self ⇒ %return
Method: get-search-active? self ⇒ %return

Gets whether search is currently active for self.

See TabOverview:enable-search.

self

Passed: a <AdwTabOverview>.

a tab overview

%return

Returned: a boolean.

whether search is active

Method: tab-overview:get-secondary-menu self ⇒ %return
Method: get-secondary-menu self ⇒ %return

Gets the secondary menu model for self.

self

Passed: a <AdwTabOverview>.

a tab overview

%return

Returned: a <GMenuModel>, or #f.

the secondary menu model

Method: tab-overview:get-show-end-title-buttons? self ⇒ %return
Method: get-show-end-title-buttons? self ⇒ %return

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

self

Passed: a <AdwTabOverview>.

a tab overview

%return

Returned: a boolean.

whether end title buttons are shown

Method: tab-overview:get-show-start-title-buttons? self ⇒ %return
Method: get-show-start-title-buttons? self ⇒ %return

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

self

Passed: a <AdwTabOverview>.

a tab overview

%return

Returned: a boolean.

whether start title buttons are shown

Method: tab-overview:get-view self ⇒ %return
Method: get-view self ⇒ %return

Gets the tab view self controls.

self

Passed: a <AdwTabOverview>.

a tab overview

%return

Returned: a <AdwTabView>, or #f.

the tab view

Procedure: tab-overview:new ⇒ %return

Creates a new <AdwTabOverview>.

%return

Returned: a <GtkWidget>.

the newly created <AdwTabOverview>

Method: tab-overview:set-child self [child]
Method: set-child self [child]

Sets the child widget of self.

self

Passed: a <AdwTabOverview>.

a tab overview

child

Passed, or left out: a <GtkWidget>, or #f.

the child widget

Method: tab-overview:set-enable-new-tab self enable-new-tab
Method: set-enable-new-tab self enable-new-tab

Sets whether to enable new tab button for self.

Connect to the "create-tab" signal to use it.

self

Passed: a <AdwTabOverview>.

a tab overview

enable-new-tab

Passed: a boolean.

whether to enable new tab button

Method: tab-overview:set-enable-search self enable-search
Method: set-enable-search self enable-search

Sets whether to enable search in tabs for self.

Search matches tab titles and tooltips, as well as keywords, set via TabPage: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 TabOverview:search-active to check out if search is currently active.

self

Passed: a <AdwTabOverview>.

a tab overview

enable-search

Passed: a boolean.

whether to enable search

Method: tab-overview:set-extra-drag-preload self preload
Method: set-extra-drag-preload self preload

Sets whether drop data should be preloaded on hover.

See drop-target:preload.

self

Passed: a <AdwTabOverview>.

a tab overview

preload

Passed: a boolean.

whether to preload drop data

Method: tab-overview:set-inverted self inverted
Method: set-inverted self inverted

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.

self

Passed: a <AdwTabOverview>.

a tab overview

inverted

Passed: a boolean.

whether thumbnails use inverted layout

Method: tab-overview:set-open self open
Method: set-open self open

Sets whether the to open self.

self

Passed: a <AdwTabOverview>.

a tab overview

open

Passed: a boolean.

whether the overview is open

Method: tab-overview:set-secondary-menu self [secondary-menu]
Method: set-secondary-menu self [secondary-menu]

Sets the secondary menu model for self.

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

self

Passed: a <AdwTabOverview>.

a tab overview

secondary-menu

Passed, or left out: a <GMenuModel>, or #f.

a menu model

Method: tab-overview:set-show-end-title-buttons self show-end-title-buttons
Method: set-show-end-title-buttons self show-end-title-buttons

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

See HeaderBar:show-start-title-buttons for the other side.

self

Passed: a <AdwTabOverview>.

a tab overview

show-end-title-buttons

Passed: a boolean.

whether to show end title buttons

Method: tab-overview:set-show-start-title-buttons self show-start-title-buttons
Method: set-show-start-title-buttons self show-start-title-buttons

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

See HeaderBar:show-end-title-buttons for the other side.

self

Passed: a <AdwTabOverview>.

a tab overview

show-start-title-buttons

Passed: a boolean.

whether to show start title buttons

Method: tab-overview:set-view self [view]
Method: set-view self [view]

Sets the tab view to control.

The view must be inside self, see TabOverview:child.

self

Passed: a <AdwTabOverview>.

a tab overview

view

Passed, or left out: a <AdwTabView>, or #f.

a tab view

Method: tab-overview:setup-extra-drop-target self actions types
Method: setup-extra-drop-target self actions types

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 "extra-drag-drop" signal can be used to handle the drop.

self

Passed: a <AdwTabOverview>.

a tab overview

actions

Passed: a <GdkDragAction>, or a list of its symbols, or one of them.

the supported actions

types

Passed: a list or vector, each a class, or a GType number, or #f.

all supported GTypes that can be dropped

n-types

Not passed: guile-gi gives the length of types.

number of types

Signals

Signal: tab-overview:create-tab

Connect a handler with (connect object tab-overview:create-tab handler). It is called as (handler self) ⇒ %return.

Emitted when a tab needs to be created.

This can happen after the new tab button has been pressed, see TabOverview:enable-new-tab.

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

self

Passed: a <AdwTabOverview>.

%return

Returned: a <AdwTabPage>.

the newly created page

Signal: tab-overview:extra-drag-drop

Connect a handler with (connect object tab-overview:extra-drag-drop handler). It is called as (handler self page value) ⇒ %return.

Emitted when content is dropped onto a tab.

The content must be of one of the types set up via TabOverview.setup_extra_drop_target.

See drop-target:drop.

self

Passed: a <AdwTabOverview>.

page

Passed: a <AdwTabPage>.

the page matching the tab the content was dropped onto

value

Passed: a <GValue>.

the <GValue> being dropped

%return

Returned: a boolean.

whether the drop was accepted

Signal: tab-overview:extra-drag-value

Connect a handler with (connect object tab-overview:extra-drag-value handler). It is called as (handler self page value) ⇒ %return.

Emitted when the dropped content is preloaded.

In order for data to be preloaded, TabOverview:extra-drag-preload must be set to TRUE.

The content must be of one of the types set up via TabOverview.setup_extra_drop_target.

See drop-target:value.

self

Passed: a <AdwTabOverview>.

page

Passed: a <AdwTabPage>.

the page matching the tab the content was dropped onto

value

Passed: a <GValue>, or #f.

the <GValue> being dropped

%return

Returned: a <GdkDragAction>, or a list of its symbols, or one of them.

the preferred action for the drop