It derives from <GtkWidget>.
An adaptive sidebar that controls an ViewStack.
<AdwViewSwitcherSidebar> is a view
switcher implemented using a Sidebar, in a similar fashion to
<GtkStackSidebar>.
<AdwViewSwitcherSidebar> items have an
icon, a label, as well as an unread dot or a badge.
Unlike other switchers,
<AdwViewSwitcherSidebar> supports
grouping pages into sections, using the
ViewStackPage:starts-section and
ViewStackPage:section-title properties.
Like Sidebar,
<AdwViewSwitcherSidebar> is adaptive
and can behave as a sidebar or a page, via the
ViewSwitcherSidebar:mode property.
Connect to the "activated" signal to run code when an item has
been activated. This can be used to toggle the visible pane when used
in a split view.
Like <AdwSidebar>,
<AdwViewSwitcherSidebar> supports
filtering items via the ViewSwitcherSidebar:filter property.
Use ViewSwitcherSidebar:placeholder to provide an empty state
widget. It will be shown when all items have been filtered out, or the
sidebar has no items otherwise.
<AdwViewSwitcherSidebar> has a single
CSS node with name view-switcher-sidebar.
See also: ViewSwitcher, ViewSwitcherBar,
InlineViewSwitcher.
The item filter.
Can be used to implement search within the sidebar.
Use ViewSwitcherSidebar:placeholder to provide an empty state.
See Sidebar:filter.
Its value is a <GtkFilter>, or #f.
Set it with (set! (view-switcher-sidebar:filter self) value).
Determines the sidebar’s look and behavior.
If set to Adw.SidebarMode.sidebar, behaves like a sidebar: with a
sidebar style and a persistent selection.
If set to Adw.SidebarMode.page, behaves like a page of boxed
lists.
The page mode is intended to be used with NavigationSplitView
when collapsed, as the sidebar pane becomes a page there.
When used with OverlaySplitView, the sidebar should stay in
sidebar mode, as the sidebar pane is still a sidebar when collapsed.
See Sidebar:mode.
Its value is a <AdwSidebarMode> (or, to set
it, one of its symbols).
Set it with (set! (view-switcher-sidebar:mode self) value).
The placeholder widget.
This widget will be shown if the sidebar has no items, or all of its
items have been filtered out by ViewSwitcherSidebar:filter.
See Sidebar:placeholder.
Its value is a <GtkWidget>, or #f.
Set it with (set! (view-switcher-sidebar:placeholder self)
value).
The stack the sidebar controls.
Its value is a <AdwViewStack>, or #f.
Set it with (set! (view-switcher-sidebar:stack self) value).
Gets the item filter for self.
Passed: a <AdwViewSwitcherSidebar>.
a view switcher sidebar
Returned: a <GtkFilter>, or #f.
the item filter
Gets self’s look and behavior.
See Sidebar.get_mode.
Passed: a <AdwViewSwitcherSidebar>.
a view switcher sidebar
Returned: a <AdwSidebarMode>.
the current mode
Gets the placeholder widget for self.
Passed: a <AdwViewSwitcherSidebar>.
a view switcher sidebar
Returned: a <GtkWidget>, or #f.
the placeholder widget
Gets the stack self controls.
Passed: a <AdwViewSwitcherSidebar>.
a view switcher sidebar
Returned: a <AdwViewStack>, or #f.
The stack of self
Creates a new
<AdwViewSwitcherSidebar>.
Returned: a <GtkWidget>.
the newly created
<AdwViewSwitcherSidebar>
Sets the item filter for self.
Can be used to implement search within the sidebar.
Use ViewSwitcherSidebar:placeholder to provide an empty state.
See Sidebar.set_filter.
Passed: a <AdwViewSwitcherSidebar>.
a view switcher sidebar
Passed, or left out: a <GtkFilter>, or
#f.
the item filter
Sets self’s look and behavior.
If set to Adw.SidebarMode.sidebar, behaves like a sidebar: with a
sidebar style and a persistent selection.
If set to Adw.SidebarMode.page, behaves like a page of boxed
lists. In this mode, the selection is invisible and only tracked to
determine the initially selected item once switched back to sidebar
mode.
The page mode is intended to be used with NavigationSplitView
when collapsed, as the sidebar pane becomes a page there.
When used with OverlaySplitView, the sidebar should stay in
sidebar mode, as the sidebar pane is still a sidebar when collapsed.
See Sidebar.set_mode.
Passed: a <AdwViewSwitcherSidebar>.
a view switcher sidebar
Passed: a <AdwSidebarMode>, or one of its
symbols.
the new mode
Sets the placeholder widget for self.
This widget will be shown if self has no items, or all of its
items have been filtered out by ViewSwitcherSidebar:filter.
See Sidebar.set_placeholder.
Passed: a <AdwViewSwitcherSidebar>.
a view switcher sidebar
Passed, or left out: a <GtkWidget>, or
#f.
the placeholder widget
Sets the stack to control.
Passed: a <AdwViewSwitcherSidebar>.
a view switcher sidebar
Passed, or left out: a <AdwViewStack>, or
#f.
a stack
Connect a handler with (connect object
view-switcher-sidebar:activated handler). It is called as
(handler self).
Emitted when an item has been activated.
Passed: a <AdwViewSwitcherSidebar>.