Class ToolbarView.Builder<B extends ToolbarView.Builder<B>>

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

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

    • Builder

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

    • build

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

      public B setBottomBarStyle(ToolbarStyle bottomBarStyle)

      Appearance of the bottom bars.

      If set to Adw.ToolbarStyle.flat, bottom bars are flat and scrolling content has a subtle undershoot shadow when touching them, same as the .undershoot-bottom style class. This works well for simple content, e.g. StatusPage or PreferencesPage, where the background at the bottom of the page is uniform. Additionally, windows with sidebars should always use this style.

      Undershoot shadow is only present if a bottom bar is actually present and visible. It is also never present if ToolbarView:extend-content-to-bottom-edge is set to TRUE.

      If set to Adw.ToolbarStyle.raised, bottom bars have an opaque background and a persistent shadow, this is suitable for content such as utility panes, where some elements are directly adjacent to the bottom bars, or TabView, where each page can have a different background.

      Adw.ToolbarStyle.raised-border is similar to Adw.ToolbarStyle.raised, but the shadow is replaced with a more subtle border. This can be useful for applications like image viewers.

      See also ToolbarView:top-bar-style.

      Parameters:
      bottomBarStyle - the value for the bottom-bar-style property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setContent

      public B setContent(Widget content)
      The content widget.
      Parameters:
      content - the value for the content property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setExtendContentToBottomEdge

      public B setExtendContentToBottomEdge(boolean extendContentToBottomEdge)

      Whether the content widget can extend behind bottom bars.

      This can be used in combination with ToolbarView:reveal-bottom-bars to show and hide toolbars in fullscreen.

      See ToolbarView:extend-content-to-top-edge.

      Parameters:
      extendContentToBottomEdge - the value for the extend-content-to-bottom-edge property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setExtendContentToTopEdge

      public B setExtendContentToTopEdge(boolean extendContentToTopEdge)

      Whether the content widget can extend behind top bars.

      This can be used in combination with ToolbarView:reveal-top-bars to show and hide toolbars in fullscreen.

      See ToolbarView:extend-content-to-bottom-edge.

      Parameters:
      extendContentToTopEdge - the value for the extend-content-to-top-edge property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setRevealBottomBars

      public B setRevealBottomBars(boolean revealBottomBars)

      Whether bottom bars are visible.

      The transition will be animated.

      This can be used in combination with ToolbarView:extend-content-to-bottom-edge to show and hide toolbars in fullscreen.

      See ToolbarView:reveal-top-bars.

      Parameters:
      revealBottomBars - the value for the reveal-bottom-bars property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setRevealTopBars

      public B setRevealTopBars(boolean revealTopBars)

      Whether top bars are revealed.

      The transition will be animated.

      This can be used in combination with ToolbarView:extend-content-to-top-edge to show and hide toolbars in fullscreen.

      See ToolbarView:reveal-bottom-bars.

      Parameters:
      revealTopBars - the value for the reveal-top-bars property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setTopBarStyle

      public B setTopBarStyle(ToolbarStyle topBarStyle)

      Appearance of the top bars.

      If set to Adw.ToolbarStyle.flat, top bars are flat and scrolling content has a subtle undershoot shadow when touching them, same as the .undershoot-top style class. This works well for simple content, e.g. StatusPage or PreferencesPage, where the background at the top of the page is uniform. Additionally, windows with sidebars should always use this style.

      Undershoot shadow is only present if a top bar is actually present and visible. It is also never present if ToolbarView:extend-content-to-top-edge is set to TRUE.

      If set to Adw.ToolbarStyle.raised, top bars have an opaque background and a persistent shadow, this is suitable for content such as utility panes, where some elements are directly adjacent to the top bars, or TabView, where each page can have a different background.

      Adw.ToolbarStyle.raised-border is similar to Adw.ToolbarStyle.raised, but the shadow is replaced with a more subtle border. This can be useful for applications like image viewers.

      See also ToolbarView:bottom-bar-style.

      Parameters:
      topBarStyle - the value for the top-bar-style property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4