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.
Content:
Properties:
Creation methods:
Methods:
Inherited Members:
All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref
All known members inherited from interface Gtk.Accessible
accessible_role
get_accessible_role
reset_property
reset_relation
reset_state
update_property
update_property_value
update_relation
update_relation_value
update_state
update_state_value
All known members inherited from interface Gtk.Buildable
add_child
custom_finished
custom_tag_end
custom_tag_start
get_buildable_id
get_id
get_internal_child
parser_finished
set_buildable_property
set_id