adw.overlay_split_view

Module for [OverlaySplitView] class

Types 3

A widget presenting sidebar and content side by side or as an overlay.

overlay-split-view overlay-split-view-collapsed

[adw.overlay_split_view.OverlaySplitView] has two children: sidebar and content, and displays them side by side.

When property@OverlaySplitView:collapsed is set to TRUE, the sidebar is instead shown as an overlay above the content widget.

The sidebar can be hidden or shown using the property@OverlaySplitView:show-sidebar property.

Sidebar can be displayed before or after the content, this can be controlled with the property@OverlaySplitView:sidebar-position property.

Collapsing the split view automatically hides the sidebar widget, and uncollapsing it shows the sidebar. If this behavior is not desired, the property@OverlaySplitView:pin-sidebar property can be used to override it.

[adw.overlay_split_view.OverlaySplitView] supports an edge swipe gesture for showing the sidebar, and a swipe from the sidebar for hiding it. Gestures are only supported on touchscreen, but not touchpad. Gestures can be controlled with the property@OverlaySplitView:enable-show-gesture and property@OverlaySplitView:enable-hide-gesture properties.

See also class@NavigationSplitView.

[adw.overlay_split_view.OverlaySplitView] is typically used together with an class@Breakpoint setting the collapsed property to TRUE on small widths, as follows:

<object class="AdwWindow">
 <property name="width-request">360</property>
 <property name="height-request">200</property>
 <property name="default-width">800</property>
 <property name="default-height">800</property>
 <child>
   <object class="AdwBreakpoint">
     <condition>max-width: 400sp</condition>
     <setter object="split_view" property="collapsed">True</setter>
   </object>
 </child>
 <property name="content">
   <object class="AdwOverlaySplitView" id="split_view">
     <property name="sidebar">
       <!-- ... -->
     </property>
     <property name="content">
       <!-- ... -->
     </property>
   </object>
 </property>
</object>

[adw.overlay_split_view.OverlaySplitView] is often used for implementing the

utility pane

pattern.

Sizing

When not collapsed, [adw.overlay_split_view.OverlaySplitView] changes the sidebar width depending on its own width.

If possible, it tries to allocate a fraction of the total width, controlled with the property@OverlaySplitView:sidebar-width-fraction property.

The sidebar also has minimum and maximum sizes, controlled with the property@OverlaySplitView:min-sidebar-width and property@OverlaySplitView:max-sidebar-width properties.

The minimum and maximum sizes are using the length unit specified with the property@OverlaySplitView:sidebar-width-unit.

By default, sidebar is using 25% of the total width, with 180sp as the minimum size and 280sp as the maximum size.

When collapsed, the preferred width fraction is ignored and the sidebar uses property@OverlaySplitView:max-sidebar-width when possible.

Header Bar Integration

When used inside [adw.overlay_split_view.OverlaySplitView], class@HeaderBar will automatically hide the window buttons in the middle.

[adw.overlay_split_view.OverlaySplitView] as [gtk.buildable.Buildable]

The [adw.overlay_split_view.OverlaySplitView] implementation of the [gtk.buildable.Buildable] interface supports setting the sidebar widget by specifying “sidebar” as the “type” attribute of a <child> element, Specifying “content” child type or omitting it results in setting the content widget.

CSS nodes

[adw.overlay_split_view.OverlaySplitView] has a single CSS node with the name overlay-split-view.

It contains two nodes with the name widget, containing the sidebar and content children.

When not collapsed, they have the .sidebar-view and .content-view style classes respectively.

overlay-split-view
├── widget.sidebar-pane
│   ╰── [sidebar child]
╰── widget.content-pane
   ╰── [content child]

When collapsed, the one containing the sidebar child has the .background style class and the other one has no style classes.

overlay-split-view
├── widget.background
│   ╰── [sidebar child]
╰── widget
   ╰── [content child]

Accessibility

[adw.overlay_split_view.OverlaySplitView] uses the [gtk.types.AccessibleRole.Group] role.

Methods
GType _gType() @property
OverlaySplitView self()Returns `this`, for use in `with` statements.
OverlaySplitViewGidBuilder builder()Get builder for [adw.overlaysplitview.OverlaySplitView] Returns: New builder object
bool collapsed() @propertyGet `collapsed` property. Returns: Whether the split view is collapsed.
void collapsed(bool propval) @propertySet `collapsed` property. Params: propval = Whether the split view is collapsed.
gtk.widget.Widget content() @propertyGet `content` property. Returns: The content widget.
void content(gtk.widget.Widget propval) @propertySet `content` property. Params: propval = The content widget.
bool enableHideGesture() @propertyGet `enableHideGesture` property. Returns: Whether the sidebar can be closed with a swipe gesture.
void enableHideGesture(bool propval) @propertySet `enableHideGesture` property. Params: propval = Whether the sidebar can be closed with a swipe gesture.
bool enableShowGesture() @propertyGet `enableShowGesture` property. Returns: Whether the sidebar can be opened with an edge swipe gesture.
void enableShowGesture(bool propval) @propertySet `enableShowGesture` property. Params: propval = Whether the sidebar can be opened with an edge swipe gesture.
double maxSidebarWidth() @propertyGet `maxSidebarWidth` property. Returns: The maximum sidebar width.
void maxSidebarWidth(double propval) @propertySet `maxSidebarWidth` property. Params: propval = The maximum sidebar width.
double minSidebarWidth() @propertyGet `minSidebarWidth` property. Returns: The minimum sidebar width.
void minSidebarWidth(double propval) @propertySet `minSidebarWidth` property. Params: propval = The minimum sidebar width.
bool pinSidebar() @propertyGet `pinSidebar` property. Returns: Whether the sidebar widget is pinned.
void pinSidebar(bool propval) @propertySet `pinSidebar` property. Params: propval = Whether the sidebar widget is pinned.
bool showSidebar() @propertyGet `showSidebar` property. Returns: Whether the sidebar widget is shown.
void showSidebar(bool propval) @propertySet `showSidebar` property. Params: propval = Whether the sidebar widget is shown.
gtk.widget.Widget sidebar() @propertyGet `sidebar` property. Returns: The sidebar widget.
void sidebar(gtk.widget.Widget propval) @propertySet `sidebar` property. Params: propval = The sidebar widget.
gtk.types.PackType sidebarPosition() @propertyGet `sidebarPosition` property. Returns: The sidebar position.
void sidebarPosition(gtk.types.PackType propval) @propertySet `sidebarPosition` property. Params: propval = The sidebar position.
double sidebarWidthFraction() @propertyGet `sidebarWidthFraction` property. Returns: The preferred sidebar width as a fraction of the total width.
void sidebarWidthFraction(double propval) @propertySet `sidebarWidthFraction` property. Params: propval = The preferred sidebar width as a fraction of the total width.
adw.types.LengthUnit sidebarWidthUnit() @propertyGet `sidebarWidthUnit` property. Returns: The length unit for minimum and maximum sidebar widths.
void sidebarWidthUnit(adw.types.LengthUnit propval) @propertySet `sidebarWidthUnit` property. Params: propval = The length unit for minimum and maximum sidebar widths.
bool getCollapsed()Gets whether self is collapsed. Returns: whether self is collapsed
gtk.widget.Widget getContent()Gets the content widget for self. Returns: the content widget for self
bool getEnableHideGesture()Gets whether self can be closed with a swipe gesture. Returns: `TRUE` if self can be closed with a swipe gesture
bool getEnableShowGesture()Gets whether self can be opened with an edge swipe gesture. Returns: `TRUE` if self can be opened with a swipe gesture
double getMaxSidebarWidth()Gets the maximum sidebar width for self. Returns: the maximum width
double getMinSidebarWidth()Gets the minimum sidebar width for self. Returns: the minimum width
bool getPinSidebar()Gets whether the sidebar widget is pinned for self. Returns: whether if the sidebar widget is pinned
bool getShowSidebar()Gets whether the sidebar widget is shown for self. Returns: `TRUE` if the sidebar widget is shown
gtk.widget.Widget getSidebar()Gets the sidebar widget for self. Returns: the sidebar widget for self
gtk.types.PackType getSidebarPosition()Gets the sidebar position for self. Returns: the sidebar position for self
double getSidebarWidthFraction()Gets the preferred sidebar width fraction for self. Returns: the preferred width fraction
adw.types.LengthUnit getSidebarWidthUnit()Gets the length unit for minimum and maximum sidebar widths. Returns: the length unit
void setCollapsed(bool collapsed)Sets whether self view is collapsed.
void setContent(gtk.widget.Widget content = null)Sets the content widget for self.
void setEnableHideGesture(bool enableHideGesture)Sets whether self can be closed with a swipe gesture.
void setEnableShowGesture(bool enableShowGesture)Sets whether self can be opened with an edge swipe gesture.
void setMaxSidebarWidth(double width)Sets the maximum sidebar width for self.
void setMinSidebarWidth(double width)Sets the minimum sidebar width for self.
void setPinSidebar(bool pinSidebar)Sets whether the sidebar widget is pinned for self.
void setShowSidebar(bool showSidebar)Sets whether the sidebar widget is shown for self.
void setSidebar(gtk.widget.Widget sidebar = null)Sets the sidebar widget for self.
void setSidebarPosition(gtk.types.PackType position)Sets the sidebar position for self.
void setSidebarWidthFraction(double fraction)Sets the preferred sidebar width as a fraction of the total width of self.
void setSidebarWidthUnit(adw.types.LengthUnit unit)Sets the length unit for minimum and maximum sidebar widths.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new [adw.overlaysplitview.OverlaySplitView]. Returns: the newly created [adw.overlaysplitview.OverlaySplitView]
Methods
T collapsed(bool propval)Set `collapsed` property. Params: propval = Whether the split view is collapsed.
T content(gtk.widget.Widget propval)Set `content` property. Params: propval = The content widget. Returns: Builder instance for fluent chaining
T enableHideGesture(bool propval)Set `enableHideGesture` property. Params: propval = Whether the sidebar can be closed with a swipe gesture.
T enableShowGesture(bool propval)Set `enableShowGesture` property. Params: propval = Whether the sidebar can be opened with an edge swipe gesture.
T maxSidebarWidth(double propval)Set `maxSidebarWidth` property. Params: propval = The maximum sidebar width.
T minSidebarWidth(double propval)Set `minSidebarWidth` property. Params: propval = The minimum sidebar width.
T pinSidebar(bool propval)Set `pinSidebar` property. Params: propval = Whether the sidebar widget is pinned.
T showSidebar(bool propval)Set `showSidebar` property. Params: propval = Whether the sidebar widget is shown. Returns: Builder instance for fluent chaining
T sidebar(gtk.widget.Widget propval)Set `sidebar` property. Params: propval = The sidebar widget. Returns: Builder instance for fluent chaining
T sidebarPosition(gtk.types.PackType propval)Set `sidebarPosition` property. Params: propval = The sidebar position.
T sidebarWidthFraction(double propval)Set `sidebarWidthFraction` property. Params: propval = The preferred sidebar width as a fraction of the total width.
T sidebarWidthUnit(adw.types.LengthUnit propval)Set `sidebarWidthUnit` property. Params: propval = The length unit for minimum and maximum sidebar widths.

Fluent builder for [adw.overlay_split_view.OverlaySplitView]