HeaderBar


Object Hierarchy:

Adw.HeaderBar Adw.HeaderBar Adw.HeaderBar Gtk.Widget Gtk.Widget Gtk.Widget->Adw.HeaderBar GLib.InitiallyUnowned GLib.InitiallyUnowned GLib.InitiallyUnowned->Gtk.Widget GLib.Object GLib.Object GLib.Object->GLib.InitiallyUnowned Gtk.Accessible Gtk.Accessible Gtk.Accessible->Adw.HeaderBar Gtk.Accessible->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Adw.HeaderBar Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget Gtk.ConstraintTarget Gtk.ConstraintTarget->Adw.HeaderBar Gtk.ConstraintTarget->Gtk.Widget

Description:

[ CCode ( type_id = "adw_header_bar_get_type ()" ) ]
[ Version ( since = "1.0" ) ]
public sealed class HeaderBar : Widget, Accessible, Buildable, ConstraintTarget

A title bar widget.

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

`AdwHeaderBar` is similar to [[email protected]], but provides additional features compared to it. Refer to `GtkHeaderBar` for details.

[property@HeaderBar:centering-policy] allows to enforce strict centering of the title widget, this is useful for [class@ViewSwitcherTitle ].

[property@HeaderBar:show-start-title-buttons] and [property@HeaderBar:show-end-title-buttons] allow to easily create split header bar layouts using [class@Leaflet], as follows:

```xml <object class="AdwLeaflet" id="leaflet"> <child> <object class="GtkBox"> <property name="orientation"> vertical</property> <child> <object class="AdwHeaderBar"> <binding name="show-end-title-buttons"> <lookup name="folded">leaflet</lookup> </binding> </object> </child> <!-- ... --> </object> < /child> <!-- ... --> <child> <object class="GtkBox"> <property name="orientation">vertical</property> <property name="hexpand">True</property> <child> <object class="AdwHeaderBar"> <binding name="show-start-title-buttons"> <lookup name="folded">leaflet</lookup> </binding> </object> </child> <!-- ... --> </object> </child> </object> ```

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

CSS nodes

``` headerbar ╰── windowhandle ╰── box ├── widget │ ╰── box.start │ ├── windowcontrols.start │ ╰── [other children] ├── [Title Widget] ╰── widget ╰── box.end ├── [other children] ╰── windowcontrols.end ```

`AdwHeaderBar`'s CSS node is called `headerbar`. It contains a `windowhandle` subnode, which contains a `box` subnode, which contains two `widget` subnodes at the start and end of the header bar, each of which contains a `box` subnode with the `.start` and `.end` style classes respectively, as well as a center node that represents the title.

Each of the boxes contains a `windowcontrols` subnode, see [[email protected]] for details, as well as other children.

Accessibility

`AdwHeaderBar` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.


Namespace: Adw
Package: libadwaita-1

Content:

Properties:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object
All known members inherited from interface Gtk.Accessible
All known members inherited from interface Gtk.Buildable



2022 vala-language.org