HdyTabBar: Handy Reference Manual

## HdyTabBar HdyTabBar — A tab bar for HdyTabView |

## Functions

HdyTabBar * | hdy_tab_bar_new ()
HdyTabView * | hdy_tab_bar_get_view ()
void | hdy_tab_bar_set_view ()
GtkWidget * | hdy_tab_bar_get_start_action_widget ()
void | hdy_tab_bar_set_start_action_widget ()
GtkWidget * | hdy_tab_bar_get_end_action_widget ()
void | hdy_tab_bar_set_end_action_widget ()
gboolean | hdy_tab_bar_get_autohide ()
void | hdy_tab_bar_set_autohide ()
gboolean | hdy_tab_bar_get_tabs_revealed ()
gboolean | hdy_tab_bar_get_expand_tabs ()
void | hdy_tab_bar_set_expand_tabs ()
gboolean | hdy_tab_bar_get_inverted ()
void | hdy_tab_bar_set_inverted ()
GtkTargetList * | hdy_tab_bar_get_extra_drag_dest_targets ()
void | hdy_tab_bar_set_extra_drag_dest_targets ()
gboolean | hdy_tab_bar_get_is_overflowing ()

## Properties

gboolean | autohide | Read / Write
GtkWidget * | end-action-widget | Read / Write
gboolean | expand-tabs | Read / Write
GtkTargetList * | extra-drag-dest-targets | Read / Write
gboolean | inverted | Read / Write
gboolean | is-overflowing | Read
GtkWidget * | start-action-widget | Read / Write
gboolean | tabs-revealed | Read
HdyTabView * | view | Read / Write

## Signals

void | extra-drag-data-received | Run Last

## Types and Values

#define | HDY_TYPE_TAB_BAR
| HdyTabBar

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBin
                        ╰── HdyTabBar

## Implemented Interfaces

HdyTabBar implements AtkImplementorIface and GtkBuildable.

## Description

The HdyTabBar widget is a tab bar that can be used with conjunction with HdyTabView.

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.

## Functions

### hdy_tab_bar_new ()

    HdyTabBar *
    hdy_tab_bar_new (void);

Creates a new HdyTabBar widget.

#### Returns

a new HdyTabBar

Since: 1.2

### hdy_tab_bar_get_view ()

    HdyTabView *
    hdy_tab_bar_get_view (HdyTabBar *self);

Gets the HdyTabView `self` controls.

#### Parameters

self | a HdyTabBar |

#### Returns

the HdyTabView `self` controls.

[transfer none][nullable]

Since: 1.2

### hdy_tab_bar_set_view ()

    void
    hdy_tab_bar_set_view (HdyTabBar *self,
                          HdyTabView *view);

Sets the HdyTabView `self` controls.

#### Parameters

self | a HdyTabBar |
view | a HdyTabView. | [nullable]

Since: 1.2

### hdy_tab_bar_get_start_action_widget ()

    GtkWidget *
    hdy_tab_bar_get_start_action_widget (HdyTabBar *self);

Gets the widget shown before the tabs.

#### Parameters

self | a HdyTabBar |

#### Returns

the widget shown before the tabs, or `NULL`.

[transfer none][nullable]

Since: 1.2

### hdy_tab_bar_set_start_action_widget ()

    void
    hdy_tab_bar_set_start_action_widget (HdyTabBar *self,
                                         GtkWidget *widget);

Sets the widget to show before the tabs.

#### Parameters

self | a HdyTabBar |
widget | the widget to show before the tabs, or `NULL`. | [transfer none][nullable]

Since: 1.2

### hdy_tab_bar_get_end_action_widget ()

    GtkWidget *
    hdy_tab_bar_get_end_action_widget (HdyTabBar *self);

Gets the widget shown after the tabs.

#### Parameters

self | a HdyTabBar |

#### Returns

the widget shown after the tabs, or `NULL`.

[transfer none][nullable]

Since: 1.2

### hdy_tab_bar_set_end_action_widget ()

    void
    hdy_tab_bar_set_end_action_widget (HdyTabBar *self,
                                       GtkWidget *widget);

Sets the widget to show after the tabs.

#### Parameters

self | a HdyTabBar |
widget | the widget to show after the tabs, or `NULL`. | [transfer none][nullable]

Since: 1.2

### hdy_tab_bar_get_autohide ()

    gboolean
    hdy_tab_bar_get_autohide (HdyTabBar *self);

Gets whether the tabs automatically hide, see `hdy_tab_bar_set_autohide()`.

#### Parameters

self | a HdyTabBar |

#### Returns

whether the tabs automatically hide

Since: 1.2

### hdy_tab_bar_set_autohide ()

    void
    hdy_tab_bar_set_autohide (HdyTabBar *self,
                              gboolean autohide);

Sets whether the tabs automatically hide.

If `autohide` is `TRUE`, the tab bar disappears when the associated HdyTabView has 0 or 1 tab, no pinned tabs, and no tab is being transferred.

Autohide is enabled by default.

See “tabs-revealed”.

#### Parameters

self | a HdyTabBar |
autohide | whether the tabs automatically hide |

Since: 1.2

### hdy_tab_bar_get_tabs_revealed ()

    gboolean
    hdy_tab_bar_get_tabs_revealed (HdyTabBar *self);

Gets the value of the “tabs-revealed” property.

#### Parameters

self | a HdyTabBar |

#### Returns

whether the tabs are current revealed

Since: 1.2

### hdy_tab_bar_get_expand_tabs ()

    gboolean
    hdy_tab_bar_get_expand_tabs (HdyTabBar *self);

Gets whether tabs should expand, see `hdy_tab_bar_set_expand_tabs()`.

#### Parameters

self | a HdyTabBar |

#### Returns

whether tabs should expand

Since: 1.2

### hdy_tab_bar_set_expand_tabs ()

    void
    hdy_tab_bar_set_expand_tabs (HdyTabBar *self,
                                 gboolean 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.

#### Parameters

self | a HdyTabBar |
expand_tabs | whether to expand tabs |

Since: 1.2

### hdy_tab_bar_get_inverted ()

    gboolean
    hdy_tab_bar_get_inverted (HdyTabBar *self);

Gets whether tabs use inverted layout, see `hdy_tab_bar_set_inverted()`.

#### Parameters

self | a HdyTabBar |

#### Returns

whether tabs use inverted layout

Since: 1.2

### hdy_tab_bar_set_inverted ()

    void
    hdy_tab_bar_set_inverted (HdyTabBar *self,
                              gboolean inverted);

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.

#### Parameters

self | a HdyTabBar |
inverted | whether tabs use inverted layout |

Since: 1.2

### hdy_tab_bar_get_extra_drag_dest_targets ()

    GtkTargetList *
    hdy_tab_bar_get_extra_drag_dest_targets
                                   (HdyTabBar *self);

Gets extra drag destination targets, see `hdy_tab_bar_set_extra_drag_dest_targets()`.

#### Parameters

self | a HdyTabBar |

#### Returns

extra drag targets, or `NULL`.

[transfer none][nullable]

Since: 1.2

### hdy_tab_bar_set_extra_drag_dest_targets ()

    void
    hdy_tab_bar_set_extra_drag_dest_targets
                                   (HdyTabBar *self,
                                    GtkTargetList *extra_drag_dest_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 “extra-drag-data-received” signal can be used to retrieve and process the drag data.

#### Parameters

self | a HdyTabBar |
extra_drag_dest_targets | extra drag targets, or `NULL`. | [transfer none][nullable]

Since: 1.2

### hdy_tab_bar_get_is_overflowing ()

    gboolean
    hdy_tab_bar_get_is_overflowing (HdyTabBar *self);

Gets whether `self` is overflowing.

#### Parameters

self | a HdyTabBar |

#### Returns

whether `self` is overflowing

Since: 1.2

## Types and Values

### HDY_TYPE_TAB_BAR

    #define HDY_TYPE_TAB_BAR (hdy_tab_bar_get_type())

### HdyTabBar

    typedef struct _HdyTabBar HdyTabBar;

## Property Details

### The `“autohide”` property

      “autohide”                 gboolean

Whether tabs automatically hide.

If set to `TRUE`, the tab bar disappears when the associated HdyTabView has 0 or 1 tab, no pinned tabs, and no tab is being transferred.

See “tabs-revealed”.

Owner: HdyTabBar

Flags: Read / Write

Default value: TRUE

Since: 1.2

### The `“end-action-widget”` property

      “end-action-widget”        GtkWidget *

The widget shown after the tabs.

Owner: HdyTabBar

Flags: Read / Write

Since: 1.2

### The `“expand-tabs”` property

      “expand-tabs”              gboolean

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.

Owner: HdyTabBar

Flags: Read / Write

Default value: TRUE

Since: 1.2

### The `“extra-drag-dest-targets”` property

      “extra-drag-dest-targets”  GtkTargetList *

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 “extra-drag-data-received” signal can be used to retrieve and process the drag data.

Owner: HdyTabBar

Flags: Read / Write

Since: 1.2

### The `“inverted”` property

      “inverted”                 gboolean

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.

Owner: HdyTabBar

Flags: Read / Write

Default value: FALSE

Since: 1.2

### The `“is-overflowing”` property

      “is-overflowing”           gboolean

Whether the tab bar is overflowing.

If set to `TRUE`, all tabs cannot be displayed at once and require scrolling.

Owner: HdyTabBar

Flags: Read

Default value: FALSE

Since: 1.2

### The `“start-action-widget”` property

      “start-action-widget”      GtkWidget *

The widget shown before the tabs.

Owner: HdyTabBar

Flags: Read / Write

Since: 1.2

### The `“tabs-revealed”` property

      “tabs-revealed”            gboolean

Whether tabs are currently revealed.

See HdyTabBar:autohide.

Owner: HdyTabBar

Flags: Read

Default value: FALSE

Since: 1.2

### The `“view”` property

      “view”                     HdyTabView *

The HdyTabView the tab bar controls.

Owner: HdyTabBar

Flags: Read / Write

Since: 1.2

## Signal Details

### The `“extra-drag-data-received”` signal

    void
    user_function (HdyTabBar        *self,
                   HdyTabPage       *page,
                   GdkDragContext   *context,
                   GtkSelectionData *data,
                   guint             info,
                   guint             time,
                   gpointer          user_data)

This signal is emitted when content allowed via “extra-drag-dest-targets” is dropped onto a tab.

See “drag-data-received”.

#### Parameters

self | a HdyTabBar |
page | the HdyTabPage matching the tab the content was dropped onto |
context | the drag context |
data | the received data |
info | the info that has been registered with the target in the GtkTargetList |
time | the timestamp at which the data was received |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 1.2

## See Also

HdyTabView