Class Sidebar.Builder<B extends Sidebar.Builder<B>>
- Type Parameters:
B- the type of the Builder that is returned
- All Implemented Interfaces:
Accessible.Builder<B>, BuilderInterface
- Enclosing class:
Sidebar
- Since:
- 1.9
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Finish building theSidebarobject.onActivated(Sidebar.ActivatedCallback handler) Emitted when an item atindexhas been activated.onDrop(Sidebar.DropCallback handler) Emitted when content is dropped onto the item atindex.onDropEnter(Sidebar.DropEnterCallback handler) Emitted when the pointer enters the item atindex.Emitted when the dropped content is preloaded for the item atindex.onSetupMenu(Sidebar.SetupMenuCallback handler) Emitted when a context menu is opened or closed foritem.setDropPreload(boolean dropPreload) Whether the drop data should be preloaded on hover.The item filter.setMenuModel(MenuModel menuModel) Context menu model for the items.setMode(SidebarMode mode) Determines the sidebar's look and behavior.setPlaceholder(Widget placeholder) The placeholder widget.setSelected(int selected) The index of the currently selected item.Methods inherited from class Widget.Builder
onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, setCanFocus, setCanTarget, setCssClasses, setCssName, setCursor, setFocusable, setFocusOnClick, setHalign, setHasTooltip, setHeightRequest, setHexpand, setHexpandSet, setLayoutManager, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setReceivesDefault, setSensitive, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, setWidthRequestMethods inherited from class GObject.Builder
onNotifyMethods inherited from class Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValuesMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Accessible.Builder
setAccessibleRoleMethods inherited from interface BuilderInterface
addBuilderProperty, connect, connect, getArena
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilderobject.
-
-
Method Details
-
build
Finish building theSidebarobject. This will callGObject.withProperties(Type, String[], Value[])to create a new GObject instance, which is then cast toSidebar.- Overrides:
buildin classWidget.Builder<B extends Sidebar.Builder<B>>- Returns:
- a new instance of
Sidebarwith the properties that were set in the Builder object.
-
setDropPreload
Whether the drop data should be preloaded on hover.
See
Gtk.DropTarget:preload.- Parameters:
dropPreload- the value for thedrop-preloadproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.9
-
setFilter
-
setMenuModel
Context menu model for the items.
When a context menu is shown for an item, it will be constructed from the provided menu model. Use the
Sidebar::setup-menusignal to set up the menu actions for the particular item.Sidebar:menu-modelwill be preferred over this model if set.- Parameters:
menuModel- the value for themenu-modelproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.9
-
setMode
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. 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
NavigationSplitViewwhen 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.- Parameters:
mode- the value for themodeproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.9
-
setPlaceholder
The placeholder widget.
This widget will be shown if the sidebar has no items, or all of its items have been filtered out by
Sidebar:filter.- Parameters:
placeholder- the value for theplaceholderproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.9
-
setSelected
The index of the currently selected item.
If set to
Gtk.INVALID_LIST_POSITION, no item is selected.If
Sidebar:modeis set toAdw.SidebarMode.page, the selection is invisible, but still tracked, indicating which item will be selected once the mode is changed toAdw.SidebarMode.sidebar.See also:
Sidebar:selected-item.- Parameters:
selected- the value for theselectedproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.9
-
onActivated
Emitted when an item atindexhas been activated.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.9
- See Also:
-
onDrop
Emitted when content is dropped onto the item at
index.The content must be of one of the types set up via
Sidebar.setupDropTarget(Set, Type[]).See
Gtk.DropTarget::drop.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-
onDropEnter
Emitted when the pointer enters the item at
index.Applications can use this to set their default drop action even when
Sidebar:drop-preloadis set toFALSE.See
Gtk.DropTarget::enter.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.9
- See Also:
-
onDropValueLoaded
Emitted when the dropped content is preloaded for the item at
index.In order for data to be preloaded,
Sidebar:drop-preloadmust be set toTRUE.The content must be of one of the types set up via
Sidebar.setupDropTarget(Set, Type[]).See
Gtk.DropTarget:value.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.9
- See Also:
-
onSetupMenu
Emitted when a context menu is opened or closed for
item.If the menu has been closed,
itemwill be set toNULL.It can be used to set up menu actions before showing the menu, for example disable actions not applicable to
item.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-