adw.toolbar_view
Module for [ToolbarView] class
Types 3
A widget containing a page, as well as top and/or bottom bars.
adw.toolbar_view.ToolbarView has a single content widget and one or multiple top and bottom bars, shown at the top and bottom sides respectively.
Example of an adw.toolbar_view.ToolbarView UI definition:
<object class="AdwToolbarView">
<child type="top">
<object class="AdwHeaderBar"/>
</child>
<property name="content">
<object class="AdwPreferencesPage">
<!-- ... -->
</object>
</property>
</object>The following kinds of top and bottom bars are supported:
- adw.header_bar.HeaderBar
- adw.tab_bar.TabBar
- adw.view_switcher_bar.ViewSwitcherBar
- gtk.action_bar.ActionBar
- gtk.header_bar.HeaderBar
- gtk.popover_menu_bar.PopoverMenuBar
- gtk.search_bar.SearchBar
- Any gtk.box.Box or a similar widget with the
.toolbarstyle class
By default, top and bottom bars are flat and scrolling content has a subtle undershoot shadow, same as when using the .undershoot-top and .undershoot-bottom style classes. This works well in most cases, e.g. with adw.status_page.StatusPage or adw.preferences_page.PreferencesPage, where the background at the top and bottom parts of the page is uniform. Additionally, windows with sidebars should always use this style.
adw.toolbar_view.ToolbarView.topBarStyle and adw.toolbar_view.ToolbarView.bottomBarStyle properties can be used add an opaque background and a persistent shadow to top and bottom bars, this can be useful for content such as utility panes, where some elements are adjacent to the top/bottom bars, or adw.tab_view.TabView, where each page can have a different background.
adw.toolbar_view.ToolbarView ensures the top and bottom bars have consistent backdrop styles and vertical spacing. For comparison:
Any top and bottom bars can also be dragged to move the window, equivalent to putting them into a gtk.window_handle.WindowHandle.
Content is typically place between top and bottom bars, but can also extend behind them. This is controlled with the adw.toolbar_view.ToolbarView.extendContentToTopEdge and adw.toolbar_view.ToolbarView.extendContentToBottomEdge properties.
Top and bottom bars can be hidden and revealed with an animation using the adw.toolbar_view.ToolbarView.revealTopBars and adw.toolbar_view.ToolbarView.revealBottomBars properties.
adw.toolbar_view.ToolbarView as gtk.buildable.Buildable
The adw.toolbar_view.ToolbarView implementation of the gtk.buildable.Buildable interface supports adding a top bar by specifying “top” as the “type” attribute of a <child> element, or adding a bottom bar by specifying “bottom”.
Accessibility
adw.toolbar_view.ToolbarView uses the gtk.types.AccessibleRole.Group role.
ToolbarViewGidBuilder builder() static nothrowGet builder for [adw.toolbar_view.ToolbarView] Returns: New builder objectint bottomBarHeight() @property nothrowGet `bottomBarHeight` property. Returns: The current bottom bar height.adw.types.ToolbarStyle bottomBarStyle() @property nothrowGet `bottomBarStyle` property. Returns: Appearance of the bottom bars.void bottomBarStyle(adw.types.ToolbarStyle propval) @property nothrowSet `bottomBarStyle` property. Params: propval = Appearance of the bottom bars.void content(gtk.widget.Widget propval) @property nothrowSet `content` property. Params: propval = The content widget.bool extendContentToBottomEdge() @property nothrowGet `extendContentToBottomEdge` property. Returns: Whether the content widget can extend behind bottom bars.void extendContentToBottomEdge(bool propval) @property nothrowSet `extendContentToBottomEdge` property. Params: propval = Whether the content widget can extend behind bottom bars.bool extendContentToTopEdge() @property nothrowGet `extendContentToTopEdge` property. Returns: Whether the content widget can extend behind top bars.void extendContentToTopEdge(bool propval) @property nothrowSet `extendContentToTopEdge` property. Params: propval = Whether the content widget can extend behind top bars.bool revealBottomBars() @property nothrowGet `revealBottomBars` property. Returns: Whether bottom bars are visible.void revealBottomBars(bool propval) @property nothrowSet `revealBottomBars` property. Params: propval = Whether bottom bars are visible.bool revealTopBars() @property nothrowGet `revealTopBars` property. Returns: Whether top bars are revealed.void revealTopBars(bool propval) @property nothrowSet `revealTopBars` property. Params: propval = Whether top bars are revealed.int topBarHeight() @property nothrowGet `topBarHeight` property. Returns: The current top bar height.adw.types.ToolbarStyle topBarStyle() @property nothrowGet `topBarStyle` property. Returns: Appearance of the top bars.void topBarStyle(adw.types.ToolbarStyle propval) @property nothrowSet `topBarStyle` property. Params: propval = Appearance of the top bars.adw.types.ToolbarStyle getBottomBarStyle() nothrowGets appearance of the botom bars for self. Returns: bottom bar stylebool getExtendContentToBottomEdge() nothrowGets whether the content widget can extend behind bottom bars. Returns: whether content extends behind bottom barsbool getExtendContentToTopEdge() nothrowGets whether the content widget can extend behind top bars. Returns: whether content extends behind top barsbool getRevealBottomBars() nothrowGets whether bottom bars are revealed for self. Returns: whether bottom bars are revealedbool getRevealTopBars() nothrowGets whether top bars are revealed for self. Returns: whether top bars are revealedadw.types.ToolbarStyle getTopBarStyle() nothrowGets appearance of the top bars for self. Returns: top bar stylevoid setBottomBarStyle(adw.types.ToolbarStyle style) nothrowSets appearance of the bottom bars for self.void setExtendContentToBottomEdge(bool extend) nothrowSets whether the content widget can extend behind bottom bars.void setExtendContentToTopEdge(bool extend) nothrowSets whether the content widget can extend behind top bars.Fluent builder implementation template for adw.toolbar_view.ToolbarView
T bottomBarStyle(adw.types.ToolbarStyle propval) nothrowSet `bottomBarStyle` property. Params: propval = Appearance of the bottom bars.T content(gtk.widget.Widget propval) nothrowSet `content` property. Params: propval = The content widget. Returns: Builder instance for fluent chainingT extendContentToBottomEdge(bool propval) nothrowSet `extendContentToBottomEdge` property. Params: propval = Whether the content widget can extend behind bottom bars.T extendContentToTopEdge(bool propval) nothrowSet `extendContentToTopEdge` property. Params: propval = Whether the content widget can extend behind top bars.T revealBottomBars(bool propval) nothrowSet `revealBottomBars` property. Params: propval = Whether bottom bars are visible.T revealTopBars(bool propval) nothrowSet `revealTopBars` property. Params: propval = Whether top bars are revealed.T topBarStyle(adw.types.ToolbarStyle propval) nothrowSet `topBarStyle` property. Params: propval = Appearance of the top bars.Fluent builder for adw.toolbar_view.ToolbarView