adw.toolbar_view

Module for [ToolbarView] class

Types 3

A widget containing a page, as well as top and/or bottom bars.

toolbar-view

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:

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.

toolbar-view-flat-1 toolbar-view-flat-2 toolbar-view-raised

adw.toolbar_view.ToolbarView ensures the top and bottom bars have consistent backdrop styles and vertical spacing. For comparison:

toolbar-view-spacing toolbar-view-spacing-box

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.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
ToolbarView self() nothrowReturns `this`, for use in `with` statements.
ToolbarViewGidBuilder builder() static nothrowGet builder for [adw.toolbar_view.ToolbarView] Returns: New builder object
int 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.
gtk.widget.Widget content() @property nothrowGet `content` property. Returns: The content widget.
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.
void addBottomBar(gtk.widget.Widget widget) nothrowAdds a bottom bar to self.
void addTopBar(gtk.widget.Widget widget) nothrowAdds a top bar to self.
int getBottomBarHeight() nothrowGets the current bottom bar height for self.
adw.types.ToolbarStyle getBottomBarStyle() nothrowGets appearance of the botom bars for self. Returns: bottom bar style
gtk.widget.Widget getContent() nothrowGets the content widget for self. Returns: the content widget
bool getExtendContentToBottomEdge() nothrowGets whether the content widget can extend behind bottom bars. Returns: whether content extends behind bottom bars
bool getExtendContentToTopEdge() nothrowGets whether the content widget can extend behind top bars. Returns: whether content extends behind top bars
bool getRevealBottomBars() nothrowGets whether bottom bars are revealed for self. Returns: whether bottom bars are revealed
bool getRevealTopBars() nothrowGets whether top bars are revealed for self. Returns: whether top bars are revealed
int getTopBarHeight() nothrowGets the current top bar height for self.
adw.types.ToolbarStyle getTopBarStyle() nothrowGets appearance of the top bars for self. Returns: top bar style
void remove(gtk.widget.Widget widget) nothrowRemoves a child from self.
void setBottomBarStyle(adw.types.ToolbarStyle style) nothrowSets appearance of the bottom bars for self.
void setContent(gtk.widget.Widget content = null) nothrowSets the content widget 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.
void setRevealBottomBars(bool reveal) nothrowSets whether bottom bars are revealed for self.
void setRevealTopBars(bool reveal) nothrowSets whether top bars are revealed for self.
void setTopBarStyle(adw.types.ToolbarStyle style) nothrowSets appearance of the top bars for self.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new [adw.toolbar_view.ToolbarView]. Returns: the newly created [adw.toolbar_view.ToolbarView]

Fluent builder implementation template for adw.toolbar_view.ToolbarView

Methods
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 chaining
T 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

Methods
ToolbarView build() nothrowCreate object from builder. Returns: New object