adw.overlay_split_view
Module for [OverlaySplitView] class
Types 3
A widget presenting sidebar and content side by side or as an overlay.
adw.overlay_split_view.OverlaySplitView has two children: sidebar and content, and displays them side by side.
When adw.overlay_split_view.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 adw.overlay_split_view.OverlaySplitView.showSidebar property.
Sidebar can be displayed before or after the content, this can be controlled with the adw.overlay_split_view.OverlaySplitView.sidebarPosition property.
Collapsing the split view automatically hides the sidebar widget, and uncollapsing it shows the sidebar. If this behavior is not desired, the adw.overlay_split_view.OverlaySplitView.pinSidebar 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 adw.overlay_split_view.OverlaySplitView.enableShowGesture and adw.overlay_split_view.OverlaySplitView.enableHideGesture properties.
See also adw.navigation_split_view.NavigationSplitView.
adw.overlay_split_view.OverlaySplitView is typically used together with an adw.breakpoint.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 adw.overlay_split_view.OverlaySplitView.sidebarWidthFraction property.
The sidebar also has minimum and maximum sizes, controlled with the adw.overlay_split_view.OverlaySplitView.minSidebarWidth and adw.overlay_split_view.OverlaySplitView.maxSidebarWidth properties.
The minimum and maximum sizes are using the length unit specified with the adw.overlay_split_view.OverlaySplitView.sidebarWidthUnit.
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 adw.overlay_split_view.OverlaySplitView.maxSidebarWidth when possible.
Header Bar Integration
When used inside adw.overlay_split_view.OverlaySplitView, adw.header_bar.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.
OverlaySplitViewGidBuilder builder() static nothrowGet builder for [adw.overlay_split_view.OverlaySplitView] Returns: New builder objectbool collapsed() @property nothrowGet `collapsed` property. Returns: Whether the split view is collapsed.void collapsed(bool propval) @property nothrowSet `collapsed` property. Params: propval = Whether the split view is collapsed.void content(gtk.widget.Widget propval) @property nothrowSet `content` property. Params: propval = The content widget.bool enableHideGesture() @property nothrowGet `enableHideGesture` property. Returns: Whether the sidebar can be closed with a swipe gesture.void enableHideGesture(bool propval) @property nothrowSet `enableHideGesture` property. Params: propval = Whether the sidebar can be closed with a swipe gesture.bool enableShowGesture() @property nothrowGet `enableShowGesture` property. Returns: Whether the sidebar can be opened with an edge swipe gesture.void enableShowGesture(bool propval) @property nothrowSet `enableShowGesture` property. Params: propval = Whether the sidebar can be opened with an edge swipe gesture.double maxSidebarWidth() @property nothrowGet `maxSidebarWidth` property. Returns: The maximum sidebar width.void maxSidebarWidth(double propval) @property nothrowSet `maxSidebarWidth` property. Params: propval = The maximum sidebar width.double minSidebarWidth() @property nothrowGet `minSidebarWidth` property. Returns: The minimum sidebar width.void minSidebarWidth(double propval) @property nothrowSet `minSidebarWidth` property. Params: propval = The minimum sidebar width.bool pinSidebar() @property nothrowGet `pinSidebar` property. Returns: Whether the sidebar widget is pinned.void pinSidebar(bool propval) @property nothrowSet `pinSidebar` property. Params: propval = Whether the sidebar widget is pinned.bool showSidebar() @property nothrowGet `showSidebar` property. Returns: Whether the sidebar widget is shown.void showSidebar(bool propval) @property nothrowSet `showSidebar` property. Params: propval = Whether the sidebar widget is shown.void sidebar(gtk.widget.Widget propval) @property nothrowSet `sidebar` property. Params: propval = The sidebar widget.gtk.types.PackType sidebarPosition() @property nothrowGet `sidebarPosition` property. Returns: The sidebar position.void sidebarPosition(gtk.types.PackType propval) @property nothrowSet `sidebarPosition` property. Params: propval = The sidebar position.double sidebarWidthFraction() @property nothrowGet `sidebarWidthFraction` property. Returns: The preferred sidebar width as a fraction of the total width.void sidebarWidthFraction(double propval) @property nothrowSet `sidebarWidthFraction` property. Params: propval = The preferred sidebar width as a fraction of the total width.adw.types.LengthUnit sidebarWidthUnit() @property nothrowGet `sidebarWidthUnit` property. Returns: The length unit for minimum and maximum sidebar widths.void sidebarWidthUnit(adw.types.LengthUnit propval) @property nothrowSet `sidebarWidthUnit` property. Params: propval = The length unit for minimum and maximum sidebar widths.gtk.widget.Widget getContent() nothrowGets the content widget for self. Returns: the content widget for selfbool getEnableHideGesture() nothrowGets whether self can be closed with a swipe gesture. Returns: `TRUE` if self can be closed with a swipe gesturebool getEnableShowGesture() nothrowGets whether self can be opened with an edge swipe gesture. Returns: `TRUE` if self can be opened with a swipe gesturedouble getMaxSidebarWidth() nothrowGets the maximum sidebar width for self. Returns: the maximum widthdouble getMinSidebarWidth() nothrowGets the minimum sidebar width for self. Returns: the minimum widthbool getPinSidebar() nothrowGets whether the sidebar widget is pinned for self. Returns: whether if the sidebar widget is pinnedbool getShowSidebar() nothrowGets whether the sidebar widget is shown for self. Returns: `TRUE` if the sidebar widget is showngtk.widget.Widget getSidebar() nothrowGets the sidebar widget for self. Returns: the sidebar widget for selfgtk.types.PackType getSidebarPosition() nothrowGets the sidebar position for self. Returns: the sidebar position for selfdouble getSidebarWidthFraction() nothrowGets the preferred sidebar width fraction for self. Returns: the preferred width fractionadw.types.LengthUnit getSidebarWidthUnit() nothrowGets the length unit for minimum and maximum sidebar widths. Returns: the length unitvoid setEnableHideGesture(bool enableHideGesture) nothrowSets whether self can be closed with a swipe gesture.void setEnableShowGesture(bool enableShowGesture) nothrowSets whether self can be opened with an edge swipe gesture.void setSidebarWidthFraction(double fraction) nothrowSets the preferred sidebar width as a fraction of the total width of self.void setSidebarWidthUnit(adw.types.LengthUnit unit) nothrowSets the length unit for minimum and maximum sidebar widths.Fluent builder implementation template for adw.overlay_split_view.OverlaySplitView
T collapsed(bool propval) nothrowSet `collapsed` property. Params: propval = Whether the split view is collapsed.T content(gtk.widget.Widget propval) nothrowSet `content` property. Params: propval = The content widget. Returns: Builder instance for fluent chainingT enableHideGesture(bool propval) nothrowSet `enableHideGesture` property. Params: propval = Whether the sidebar can be closed with a swipe gesture.T enableShowGesture(bool propval) nothrowSet `enableShowGesture` property. Params: propval = Whether the sidebar can be opened with an edge swipe gesture.T maxSidebarWidth(double propval) nothrowSet `maxSidebarWidth` property. Params: propval = The maximum sidebar width.T minSidebarWidth(double propval) nothrowSet `minSidebarWidth` property. Params: propval = The minimum sidebar width.T pinSidebar(bool propval) nothrowSet `pinSidebar` property. Params: propval = Whether the sidebar widget is pinned.T showSidebar(bool propval) nothrowSet `showSidebar` property. Params: propval = Whether the sidebar widget is shown. Returns: Builder instance for fluent chainingT sidebar(gtk.widget.Widget propval) nothrowSet `sidebar` property. Params: propval = The sidebar widget. Returns: Builder instance for fluent chainingT sidebarPosition(gtk.types.PackType propval) nothrowSet `sidebarPosition` property. Params: propval = The sidebar position.T sidebarWidthFraction(double propval) nothrowSet `sidebarWidthFraction` property. Params: propval = The preferred sidebar width as a fraction of the total width.T sidebarWidthUnit(adw.types.LengthUnit propval) nothrowSet `sidebarWidthUnit` property. Params: propval = The length unit for minimum and maximum sidebar widths.Fluent builder for adw.overlay_split_view.OverlaySplitView