Class OverlaySplitView.Builder<B extends OverlaySplitView.Builder<B>>

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

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

      public B setCollapsed(boolean collapsed)

      Whether the split view is collapsed.

      When collapsed, the sidebar widget is presented as an overlay above the content widget, otherwise they are displayed side by side.

      Parameters:
      collapsed - the value for the collapsed 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
    • setEnableHideGesture

      public B setEnableHideGesture(boolean enableHideGesture)

      Whether the sidebar can be closed with a swipe gesture.

      Only touchscreen swipes are supported.

      Parameters:
      enableHideGesture - the value for the enable-hide-gesture property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setEnableShowGesture

      public B setEnableShowGesture(boolean enableShowGesture)

      Whether the sidebar can be opened with an edge swipe gesture.

      Only touchscreen swipes are supported.

      Parameters:
      enableShowGesture - the value for the enable-show-gesture property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setMaxSidebarWidth

      public B setMaxSidebarWidth(double maxSidebarWidth)

      The maximum sidebar width.

      Maximum width is affected by OverlaySplitView:sidebar-width-unit.

      The sidebar widget can still be allocated with larger width if its own minimum width exceeds it.

      Parameters:
      maxSidebarWidth - the value for the max-sidebar-width property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setMinSidebarWidth

      public B setMinSidebarWidth(double minSidebarWidth)

      The minimum sidebar width.

      Minimum width is affected by OverlaySplitView:sidebar-width-unit.

      The sidebar widget can still be allocated with larger width if its own minimum width exceeds it.

      Parameters:
      minSidebarWidth - the value for the min-sidebar-width property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setPinSidebar

      public B setPinSidebar(boolean pinSidebar)

      Whether the sidebar widget is pinned.

      By default, collapsing self automatically hides the sidebar widget, and uncollapsing it shows the sidebar. If set to TRUE, sidebar visibility never changes on its own.

      Parameters:
      pinSidebar - the value for the pin-sidebar property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setShowSidebar

      public B setShowSidebar(boolean showSidebar)
      Whether the sidebar widget is shown.
      Parameters:
      showSidebar - the value for the show-sidebar property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setSidebar

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

      public B setSidebarPosition(PackType sidebarPosition)

      The sidebar position.

      If it's set to Gtk.PackType.start, the sidebar is displayed before the content; if Gtk.PackType.end, it's displayed after the content.

      Parameters:
      sidebarPosition - the value for the sidebar-position property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setSidebarWidthFraction

      public B setSidebarWidthFraction(double sidebarWidthFraction)

      The preferred sidebar width as a fraction of the total width.

      The preferred width is additionally limited by OverlaySplitView:min-sidebar-width and OverlaySplitView:max-sidebar-width.

      The sidebar widget can be allocated with larger width if its own minimum width exceeds the preferred width.

      Parameters:
      sidebarWidthFraction - the value for the sidebar-width-fraction property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setSidebarWidthUnit

      public B setSidebarWidthUnit(LengthUnit sidebarWidthUnit)

      The length unit for minimum and maximum sidebar widths.

      See OverlaySplitView:min-sidebar-width and OverlaySplitView:max-sidebar-width.

      Parameters:
      sidebarWidthUnit - the value for the sidebar-width-unit property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4