Class TabBar

All Implemented Interfaces:
PointerInterface

public class TabBar extends Widget
A tab bar for [class@TabView].

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

The `AdwTabBar` widget is a tab bar that can be used with conjunction with
`AdwTabView`.

`AdwTabBar` 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, `AdwTabBar` will scroll
them. Pinned tabs always stay visible and aren't a part of the scrollable
area.

## CSS nodes

`AdwTabBar` has a single CSS node with name `tabbar`.

https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.TabBar.html

  • Field Details

  • Constructor Details

    • TabBar

      public TabBar(PointerContainer pointer)
    • TabBar

      public TabBar()
      Creates a new `AdwTabBar`.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getAutohide

      public boolean getAutohide()
      Gets whether the tabs automatically hide.
      Returns:
      whether the tabs automatically hide
    • getEndActionWidget

      public Widget getEndActionWidget()
      Gets the widget shown after the tabs.
      Returns:
      the widget shown after the tabs
    • getExpandTabs

      public boolean getExpandTabs()
      Gets whether tabs expand to full width.
      Returns:
      whether tabs expand to full width.
    • getInverted

      public boolean getInverted()
      Gets whether tabs use inverted layout.
      Returns:
      whether tabs use inverted layout
    • getIsOverflowing

      public boolean getIsOverflowing()
      Gets whether @self is overflowing.

      If `TRUE`, all tabs cannot be displayed at once and require scrolling.
      Returns:
      whether @self is overflowing
    • getStartActionWidget

      public Widget getStartActionWidget()
      Gets the widget shown before the tabs.
      Returns:
      the widget shown before the tabs
    • getTabsRevealed

      public boolean getTabsRevealed()
      Gets whether the tabs are currently revealed.

      See [property@TabBar:autohide].
      Returns:
      whether the tabs are currently revealed
    • getView

      public TabView getView()
      Gets the tab view @self controls.
      Returns:
      the view @self controls
    • setAutohide

      public void setAutohide(boolean autohide)
      Sets whether the tabs automatically hide.

      If set to `TRUE`, the tab bar disappears when [property@TabBar:view] has 0
      or 1 tab, no pinned tabs, and no tab is being transferred.

      See [property@TabBar:tabs-revealed].
      Parameters:
      autohide - whether the tabs automatically hide
    • setEndActionWidget

      public void setEndActionWidget(@Nullable Widget widget)
      Sets the widget to show after the tabs.
      Parameters:
      widget - the widget to show after the tabs
    • setExpandTabs

      public void setExpandTabs(boolean expand_tabs)
      Sets whether tabs expand to full width.

      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.
      Parameters:
      expand_tabs - whether to expand tabs
    • setInverted

      public void setInverted(boolean inverted)
      Sets whether tabs 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.
      Parameters:
      inverted - whether tabs use inverted layout
    • setStartActionWidget

      public void setStartActionWidget(@Nullable Widget widget)
      Sets the widget to show before the tabs.
      Parameters:
      widget - the widget to show before the tabs
    • setView

      public void setView(@Nullable TabView view)
      Sets the tab view @self controls.
      Parameters:
      view - a tab view
    • setupExtraDropTarget

      public void setupExtraDropTarget(int actions, @Nullable Int64 types, long n_types)
      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@TabBar::extra-drag-drop] signal can be used to handle the drop.
      Parameters:
      actions - the supported actions
      types - all supported `GType`s that can be dropped
      n_types - number of @types
    • onExtraDragDrop

      public SignalHandler onExtraDragDrop(TabBar.OnExtraDragDrop signal)
      Connect to signal "extra-drag-drop".
      See TabBar.OnExtraDragDrop.onExtraDragDrop(ch.bailu.gtk.adw.TabPage, ch.bailu.gtk.gobject.Value) for signal description.
      Field SIGNAL_ON_EXTRA_DRAG_DROP contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • asAccessible

      public Accessible asAccessible()
      Implements interface Accessible. Call this to get access to interface functions.
      Overrides:
      asAccessible in class Widget
      Returns:
      Accessible
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Overrides:
      asBuildable in class Widget
      Returns:
      Buildable
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Overrides:
      asConstraintTarget in class Widget
      Returns:
      ConstraintTarget
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()