Class TabOverview

All Implemented Interfaces:
Accessible, Buildable, ConstraintTarget, Proxy

@Generated("org.javagi.JavaGI") public final class TabOverview extends Widget implements Accessible, Buildable, ConstraintTarget

A tab overview for TabView.

tab-overview

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.invalidateThumbnail() or TabView.invalidateThumbnails() 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 TabOverview::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 setupExtraDropTarget(Set, Type[]) to set it up, specifying the supported content types and drag actions, then connect to TabOverview::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 TabOverview::extra-drag-value signal, then return the action from its handler. To access this action from the TabOverview::extra-drag-drop handler, use the TabOverview:extra-drag-preferred-action property.

TabOverview::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.

Since:
1.3
  • Constructor Details

    • TabOverview

      public TabOverview(MemorySegment address)
      Create a TabOverview instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • TabOverview

      public TabOverview()
      Create a new TabOverview.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the TabOverview class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected TabOverview asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class Widget
      Returns:
      the instance as if it were its parent type
    • getChild

      public @Nullable Widget getChild()
      Gets the child widget of self.
      Returns:
      the child widget of this TabOverview
      Since:
      1.3
    • getEnableNewTab

      public boolean getEnableNewTab()
      Gets whether to new tab button is enabled for self.
      Returns:
      whether new tab button is enabled
      Since:
      1.3
    • getEnableSearch

      public boolean getEnableSearch()
      Gets whether search in tabs is enabled for self.
      Returns:
      whether search is enabled
      Since:
      1.3
    • getExtraDragPreferredAction

      public Set<DragAction> getExtraDragPreferredAction()
      Gets the current action during a drop on the extra_drop_target.
      Returns:
      the drag action of the current drop.
      Since:
      1.4
    • getExtraDragPreload

      public boolean getExtraDragPreload()

      Gets the current drag action during a drop.

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

      The action will be a subset of what was originally passed to setupExtraDropTarget(Set, Type[]).

      Returns:
      the drag action of the current drop
      Since:
      1.3
    • getInverted

      public boolean getInverted()
      Gets whether thumbnails use inverted layout.
      Returns:
      whether thumbnails use inverted layout
      Since:
      1.3
    • getOpen

      public boolean getOpen()
      Gets whether this TabOverview is open.
      Returns:
      whether the overview is open
      Since:
      1.3
    • getSearchActive

      public boolean getSearchActive()

      Gets whether search is currently active for self.

      See TabOverview:enable-search.

      Returns:
      whether search is active
      Since:
      1.3
    • getSecondaryMenu

      public @Nullable MenuModel getSecondaryMenu()
      Gets the secondary menu model for self.
      Returns:
      the secondary menu model
      Since:
      1.3
    • getShowEndTitleButtons

      public boolean getShowEndTitleButtons()
      Gets whether end title buttons are shown in self's header bar.
      Returns:
      whether end title buttons are shown
      Since:
      1.3
    • getShowStartTitleButtons

      public boolean getShowStartTitleButtons()
      Gets whether start title buttons are shown in self's header bar.
      Returns:
      whether start title buttons are shown
      Since:
      1.3
    • getView

      public @Nullable TabView getView()
      Gets the tab view this TabOverview controls.
      Returns:
      the tab view
      Since:
      1.3
    • setChild

      public void setChild(@Nullable Widget child)
      Sets the child widget of self.
      Parameters:
      child - the child widget
      Since:
      1.3
    • setEnableNewTab

      public void setEnableNewTab(boolean enableNewTab)

      Sets whether to enable new tab button for self.

      Connect to the TabOverview::create-tab signal to use it.

      Parameters:
      enableNewTab - whether to enable new tab button
      Since:
      1.3
    • setEnableSearch

      public void setEnableSearch(boolean enableSearch)

      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.

      Parameters:
      enableSearch - whether to enable search
      Since:
      1.3
    • setExtraDragPreload

      public void setExtraDragPreload(boolean preload)

      Sets whether drop data should be preloaded on hover.

      See Gtk.DropTarget:preload.

      Parameters:
      preload - whether to preload drop data
      Since:
      1.3
    • setInverted

      public void setInverted(boolean 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.

      Parameters:
      inverted - whether thumbnails use inverted layout
      Since:
      1.3
    • setOpen

      public void setOpen(boolean open)
      Sets whether the to open self.
      Parameters:
      open - whether the overview is open
      Since:
      1.3
    • setSecondaryMenu

      public void setSecondaryMenu(@Nullable MenuModel secondaryMenu)

      Sets the secondary menu model for self.

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

      Parameters:
      secondaryMenu - a menu model
      Since:
      1.3
    • setShowEndTitleButtons

      public void setShowEndTitleButtons(boolean showEndTitleButtons)

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

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

      Parameters:
      showEndTitleButtons - whether to show end title buttons
      Since:
      1.3
    • setShowStartTitleButtons

      public void setShowStartTitleButtons(boolean showStartTitleButtons)

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

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

      Parameters:
      showStartTitleButtons - whether to show start title buttons
      Since:
      1.3
    • setView

      public void setView(@Nullable TabView view)

      Sets the tab view to control.

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

      Parameters:
      view - a tab view
      Since:
      1.3
    • setupExtraDropTarget

      public void setupExtraDropTarget(Set<DragAction> actions, @Nullable Type @Nullable [] 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 TabOverview::extra-drag-drop signal can be used to handle the drop.

      Parameters:
      actions - the supported actions
      types - all supported GTypes that can be dropped
      Since:
      1.3
    • setupExtraDropTarget

      public void setupExtraDropTarget(DragAction actions, @Nullable Type @Nullable [] 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 TabOverview::extra-drag-drop signal can be used to handle the drop.

      Parameters:
      actions - the supported actions
      types - all supported GTypes that can be dropped
      Since:
      1.3
    • onCreateTab

      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.

      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      Since:
      1.3
      See Also:
    • emitCreateTab

      public TabPage emitCreateTab()
      Emits the "create-tab" signal. See onCreateTab(TabOverview.CreateTabCallback).
    • onExtraDragDrop

      Emitted when content is dropped onto a tab.

      The content must be of one of the types set up via setupExtraDropTarget(Set, Type[]).

      See Gtk.DropTarget::drop.

      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      Since:
      1.3
      See Also:
    • emitExtraDragDrop

      public boolean emitExtraDragDrop(@Nullable TabPage page, @Nullable Value value)
      Emits the "extra-drag-drop" signal. See onExtraDragDrop(TabOverview.ExtraDragDropCallback).
    • onExtraDragValue

      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 setupExtraDropTarget(Set, Type[]).

      See Gtk.DropTarget:value.

      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      Since:
      1.3
      See Also:
    • emitExtraDragValue

      public Set<DragAction> emitExtraDragValue(@Nullable TabPage page, @Nullable Value value)
      Emits the "extra-drag-value" signal. See onExtraDragValue(TabOverview.ExtraDragValueCallback).
    • builder

      public static TabOverview.Builder<? extends TabOverview.Builder> builder()
      A TabOverview.Builder object constructs a TabOverview with the specified properties. Use the various set...() methods to set properties, and finish construction with TabOverview.Builder.build().
      Returns:
      the builder object