gtk.header_bar

Module for [HeaderBar] class

Types 3

GtkHeaderBar is similar to a horizontal #GtkBox. It allows children to be placed at the start or the end. In addition, it allows a title and subtitle to be displayed. The title will be centered with respect to the width of the box, even if the children at either side take up different amounts of space. The height of the titlebar will be set to provide sufficient space for the subtitle, even if none is currently set. If a subtitle is not needed, the space reservation can be turned off with [gtk.header_bar.HeaderBar.setHasSubtitle].

GtkHeaderBar can add typical window frame controls, such as minimize, maximize and close buttons, or the window icon.

For these reasons, GtkHeaderBar is the natural choice for use as the custom titlebar widget of a #GtkWindow (see [gtk.window.Window.setTitlebar]), as it gives features typical of titlebars while allowing the addition of child widgets.

Methods
GType _gType() @property
HeaderBar self()Returns `this`, for use in `with` statements.
HeaderBarGidBuilder builder()Get builder for [gtk.header_bar.HeaderBar] Returns: New builder object
void customTitle(gtk.widget.Widget propval) @property
string decorationLayout() @propertyGet `decorationLayout` property. Returns: The decoration layout for buttons. If this property is not set, the #GtkSettings:gtk-decoration-layout setting is used.
void decorationLayout(string propval) @propertySet `decorationLayout` property. Params: propval = The decoration layout for buttons. If this property is not set, the #GtkSettings:gtk-decoration-layout setting is used.
bool decorationLayoutSet() @propertyGet `decorationLayoutSet` property. Returns: Set to true if #GtkHeaderBar:decoration-layout is set.
void decorationLayoutSet(bool propval) @propertySet `decorationLayoutSet` property. Params: propval = Set to true if #GtkHeaderBar:decoration-layout is set.
bool hasSubtitle() @propertyGet `hasSubtitle` property. Returns: If true, reserve space for a subtitle, even if none is currently set.
void hasSubtitle(bool propval) @propertySet `hasSubtitle` property. Params: propval = If true, reserve space for a subtitle, even if none is currently set.
bool showCloseButton() @propertyGet `showCloseButton` property. Returns: Whether to show window decorations.
void showCloseButton(bool propval) @propertySet `showCloseButton` property. Params: propval = Whether to show window decorations.
int spacing() @property
void spacing(int propval) @property
string subtitle() @property
void subtitle(string propval) @property
string title() @property
void title(string propval) @property
gtk.widget.Widget getCustomTitle()Retrieves the custom title widget of the header. See [gtk.header_bar.HeaderBar.setCustomTitle]. Returns: the custom title widget of the header, or null if none has been set explicitly.
string getDecorationLayout()Gets the decoration layout set with [gtk.header_bar.HeaderBar.setDecorationLayout]. Returns: the decoration layout
bool getHasSubtitle()Retrieves whether the header bar reserves space for a subtitle, regardless if one is currently set or not. Returns: true if the header bar reserves space for a subtitle
bool getShowCloseButton()Returns whether this header bar shows the standard window decorations. Returns: true if the decorations are shown
string getSubtitle()Retrieves the subtitle of the header. See [gtk.header_bar.HeaderBar.setSubtitle]. Returns: the subtitle of the header, or null if none has been set explicitly. The returned string is owned by the w...
string getTitle()Retrieves the title of the header. See [gtk.header_bar.HeaderBar.setTitle]. Returns: the title of the header, or null if none has been set explicitly. The returned string is owned by the widget and...
void packEnd(gtk.widget.Widget child)Adds child to bar, packed with reference to the end of the bar.
void packStart(gtk.widget.Widget child)Adds child to bar, packed with reference to the start of the bar.
void setCustomTitle(gtk.widget.Widget titleWidget = null)Sets a custom title for the #GtkHeaderBar.
void setDecorationLayout(string layout = null)Sets the decoration layout for this header bar, overriding the #GtkSettings:gtk-decoration-layout setting.
void setHasSubtitle(bool setting)Sets whether the header bar should reserve space for a subtitle, even if none is currently set.
void setShowCloseButton(bool setting)Sets whether this header bar shows the standard window decorations, including close, maximize, and minimize.
void setSubtitle(string subtitle = null)Sets the subtitle of the #GtkHeaderBar. The title should give a user an additional detail to help him identify the current view.
void setTitle(string title = null)Sets the title of the #GtkHeaderBar. The title should help a user identify the current view. A good title should not include the application name.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new #GtkHeaderBar widget. Returns: a new #GtkHeaderBar
Methods
T decorationLayout(string propval)Set `decorationLayout` property. Params: propval = The decoration layout for buttons. If this property is not set, the #GtkSettings:gtk-decoration-layout setting is used.
T decorationLayoutSet(bool propval)Set `decorationLayoutSet` property. Params: propval = Set to true if #GtkHeaderBar:decoration-layout is set. Returns: Builder instance for fluent chaining
T hasSubtitle(bool propval)Set `hasSubtitle` property. Params: propval = If true, reserve space for a subtitle, even if none is currently set. Returns: Builder instance for fluent chaining
T showCloseButton(bool propval)Set `showCloseButton` property. Params: propval = Whether to show window decorations.
T spacing(int propval)
T subtitle(string propval)
T title(string propval)

Fluent builder for [gtk.header_bar.HeaderBar]

Methods