Class HeaderBar.Builder<B extends HeaderBar.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
Accessible.Builder<B>, BuilderInterface
Enclosing class:
HeaderBar

public static class HeaderBar.Builder<B extends HeaderBar.Builder<B>> extends Widget.Builder<B> implements Accessible.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public HeaderBar build()
      Finish building the HeaderBar object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to HeaderBar.
      Overrides:
      build in class Widget.Builder<B extends HeaderBar.Builder<B>>
      Returns:
      a new instance of HeaderBar with the properties that were set in the Builder object.
    • setDecorationLayout

      public B setDecorationLayout(String decorationLayout)

      The decoration layout for buttons.

      If this property is not set, the Gtk.Settings:gtk-decoration-layout setting is used.

      Parameters:
      decorationLayout - the value for the decoration-layout property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setShowTitleButtons

      public B setShowTitleButtons(boolean showTitleButtons)

      Whether to show title buttons like close, minimize, maximize.

      Which buttons are actually shown and where is determined by the Gtk.HeaderBar:decoration-layout property, and by the state of the window (e.g. a close button will not be shown if the window can't be closed).

      Parameters:
      showTitleButtons - the value for the show-title-buttons property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTitleWidget

      public B setTitleWidget(Widget titleWidget)
      The title widget to display.
      Parameters:
      titleWidget - the value for the title-widget property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setUseNativeControls

      public B setUseNativeControls(boolean useNativeControls)

      Whether to show platform native close/minimize/maximize buttons.

      For macOS, the Gtk.HeaderBar:decoration-layout property can be used to enable/disable controls.

      On Linux, this option has no effect.

      See also Using GTK on Apple macOS.

      Parameters:
      useNativeControls - the value for the use-native-controls property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.18