1.71 <AdwToolbarView>

Class: <AdwToolbarView>

It derives from <GtkWidget>.

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

<AdwToolbarView> has a single content widget and one or multiple top and bottom bars, shown at the top and bottom sides respectively.

Example of an <AdwToolbarView> 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 StatusPage or PreferencesPage, where the background at the top and bottom parts of the page is uniform. Additionally, windows with sidebars should always use this style.

ToolbarView:top-bar-style and ToolbarView:bottom-bar-style 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 TabView, where each page can have a different background.

<AdwToolbarView> 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 <GtkWindowHandle>.

Content is typically place between top and bottom bars, but can also extend behind them. This is controlled with the ToolbarView:extend-content-to-top-edge and ToolbarView:extend-content-to-bottom-edge properties.

Top and bottom bars can be hidden and revealed with an animation using the ToolbarView:reveal-top-bars and ToolbarView:reveal-bottom-bars properties.

‘AdwToolbarView‘ as ‘GtkBuildable‘

The <AdwToolbarView> implementation of the <GtkBuildable> 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

<AdwToolbarView> uses the Gtk.AccessibleRole.group role.

Properties

Property: toolbar-view:bottom-bar-height self

The current bottom bar height.

Bottom bar height does change depending on ToolbarView:reveal-bottom-bars, including during the transition.

See ToolbarView:top-bar-height.

Its value is a 32-bit integer.

It is read only.

Property: toolbar-view:bottom-bar-style self

Appearance of the bottom bars.

If set to Adw.ToolbarStyle.flat, bottom bars are flat and scrolling content has a subtle undershoot shadow when touching them, same as the ‘.undershoot-bottom‘ style class. This works well for simple content, e.g. StatusPage or PreferencesPage, where the background at the bottom of the page is uniform. Additionally, windows with sidebars should always use this style.

Undershoot shadow is only present if a bottom bar is actually present and visible. It is also never present if ToolbarView:extend-content-to-bottom-edge is set to TRUE.

If set to Adw.ToolbarStyle.raised, bottom bars have an opaque background and a persistent shadow, this is suitable for content such as utility panes, where some elements are directly adjacent to the bottom bars, or TabView, where each page can have a different background.

Adw.ToolbarStyle.raised-border is similar to Adw.ToolbarStyle.raised, but the shadow is replaced with a more subtle border. This can be useful for applications like image viewers.

See also ToolbarView:top-bar-style.

Its value is a <AdwToolbarStyle> (or, to set it, one of its symbols).

Set it with (set! (toolbar-view:bottom-bar-style self) value).

Property: toolbar-view:content self

The content widget.

Its value is a <GtkWidget>, or #f.

Set it with (set! (toolbar-view:content self) value).

Property: toolbar-view:extend-content-to-bottom-edge self

Whether the content widget can extend behind bottom bars.

This can be used in combination with ToolbarView:reveal-bottom-bars to show and hide toolbars in fullscreen.

See ToolbarView:extend-content-to-top-edge.

Its value is a boolean.

Set it with (set! (toolbar-view:extend-content-to-bottom-edge self) value).

Property: toolbar-view:extend-content-to-top-edge self

Whether the content widget can extend behind top bars.

This can be used in combination with ToolbarView:reveal-top-bars to show and hide toolbars in fullscreen.

See ToolbarView:extend-content-to-bottom-edge.

Its value is a boolean.

Set it with (set! (toolbar-view:extend-content-to-top-edge self) value).

Property: toolbar-view:reveal-bottom-bars self

Whether bottom bars are visible.

The transition will be animated.

This can be used in combination with ToolbarView:extend-content-to-bottom-edge to show and hide toolbars in fullscreen.

See ToolbarView:reveal-top-bars.

Its value is a boolean.

Set it with (set! (toolbar-view:reveal-bottom-bars self) value).

Property: toolbar-view:reveal-top-bars self

Whether top bars are revealed.

The transition will be animated.

This can be used in combination with ToolbarView:extend-content-to-top-edge to show and hide toolbars in fullscreen.

See ToolbarView:reveal-bottom-bars.

Its value is a boolean.

Set it with (set! (toolbar-view:reveal-top-bars self) value).

Property: toolbar-view:top-bar-height self

The current top bar height.

Top bar height does change depending ToolbarView:reveal-top-bars, including during the transition.

See ToolbarView:bottom-bar-height.

Its value is a 32-bit integer.

It is read only.

Property: toolbar-view:top-bar-style self

Appearance of the top bars.

If set to Adw.ToolbarStyle.flat, top bars are flat and scrolling content has a subtle undershoot shadow when touching them, same as the ‘.undershoot-top‘ style class. This works well for simple content, e.g. StatusPage or PreferencesPage, where the background at the top of the page is uniform. Additionally, windows with sidebars should always use this style.

Undershoot shadow is only present if a top bar is actually present and visible. It is also never present if ToolbarView:extend-content-to-top-edge is set to TRUE.

If set to Adw.ToolbarStyle.raised, top bars have an opaque background and a persistent shadow, this is suitable for content such as utility panes, where some elements are directly adjacent to the top bars, or TabView, where each page can have a different background.

Adw.ToolbarStyle.raised-border is similar to Adw.ToolbarStyle.raised, but the shadow is replaced with a more subtle border. This can be useful for applications like image viewers.

See also ToolbarView:bottom-bar-style.

Its value is a <AdwToolbarStyle> (or, to set it, one of its symbols).

Set it with (set! (toolbar-view:top-bar-style self) value).

Procedures

Method: toolbar-view:add-bottom-bar self widget
Method: add-bottom-bar self widget

Adds a bottom bar to self.

self

Passed: a <AdwToolbarView>.

a toolbar view

widget

Passed: a <GtkWidget>.

a widget

Method: toolbar-view:add-top-bar self widget
Method: add-top-bar self widget

Adds a top bar to self.

self

Passed: a <AdwToolbarView>.

a toolbar view

widget

Passed: a <GtkWidget>.

a widget

Method: toolbar-view:get-bottom-bar-height self ⇒ %return
Method: get-bottom-bar-height self ⇒ %return

Gets the current bottom bar height for self.

Bottom bar height does change depending on ToolbarView:reveal-bottom-bars, including during the transition.

See ToolbarView.get_top_bar_height.

self

Passed: a <AdwToolbarView>.

a toolbar view

%return

Returned: a 32-bit integer.

the current bottom bar height

Method: toolbar-view:get-bottom-bar-style self ⇒ %return
Method: get-bottom-bar-style self ⇒ %return

Gets appearance of the bottom bars for self.

self

Passed: a <AdwToolbarView>.

a toolbar view

%return

Returned: a <AdwToolbarStyle>.

bottom bar style

Method: toolbar-view:get-content self ⇒ %return
Method: get-content self ⇒ %return

Gets the content widget for self.

self

Passed: a <AdwToolbarView>.

a toolbar view

%return

Returned: a <GtkWidget>, or #f.

the content widget

Method: toolbar-view:get-extend-content-to-bottom-edge? self ⇒ %return
Method: get-extend-content-to-bottom-edge? self ⇒ %return

Gets whether the content widget can extend behind bottom bars.

self

Passed: a <AdwToolbarView>.

a toolbar view

%return

Returned: a boolean.

whether content extends behind bottom bars

Method: toolbar-view:get-extend-content-to-top-edge? self ⇒ %return
Method: get-extend-content-to-top-edge? self ⇒ %return

Gets whether the content widget can extend behind top bars.

self

Passed: a <AdwToolbarView>.

a toolbar view

%return

Returned: a boolean.

whether content extends behind top bars

Method: toolbar-view:get-reveal-bottom-bars? self ⇒ %return
Method: get-reveal-bottom-bars? self ⇒ %return

Gets whether bottom bars are revealed for self.

self

Passed: a <AdwToolbarView>.

a toolbar view

%return

Returned: a boolean.

whether bottom bars are revealed

Method: toolbar-view:get-reveal-top-bars? self ⇒ %return
Method: get-reveal-top-bars? self ⇒ %return

Gets whether top bars are revealed for self.

self

Passed: a <AdwToolbarView>.

a toolbar view

%return

Returned: a boolean.

whether top bars are revealed

Method: toolbar-view:get-top-bar-height self ⇒ %return
Method: get-top-bar-height self ⇒ %return

Gets the current top bar height for self.

Top bar height does change depending on ToolbarView:reveal-top-bars, including during the transition.

See ToolbarView.get_bottom_bar_height.

self

Passed: a <AdwToolbarView>.

a toolbar view

%return

Returned: a 32-bit integer.

the current top bar height

Method: toolbar-view:get-top-bar-style self ⇒ %return
Method: get-top-bar-style self ⇒ %return

Gets appearance of the top bars for self.

self

Passed: a <AdwToolbarView>.

a toolbar view

%return

Returned: a <AdwToolbarStyle>.

top bar style

Procedure: toolbar-view:new ⇒ %return

Creates a new <AdwToolbarView>.

%return

Returned: a <GtkWidget>.

the newly created <AdwToolbarView>

Method: toolbar-view:remove self widget
Method: remove self widget

Removes a child from self.

self

Passed: a <AdwToolbarView>.

a toolbar view

widget

Passed: a <GtkWidget>.

the child to be removed

Method: toolbar-view:set-bottom-bar-style self style
Method: set-bottom-bar-style self style

Sets appearance of the bottom bars for self.

If set to Adw.ToolbarStyle.flat, bottom bars are flat and scrolling content has a subtle undershoot shadow when touching them, same as the ‘.undershoot-bottom‘ style class. This works well for simple content, e.g. StatusPage or PreferencesPage, where the background at the bottom of the page is uniform. Additionally, windows with sidebars should always use this style.

Undershoot shadow is only present if a bottom bar is actually present and visible. It is also never present if ToolbarView:extend-content-to-bottom-edge is set to TRUE.

If set to Adw.ToolbarStyle.raised, bottom bars have an opaque background and a persistent shadow, this is suitable for content such as utility panes, where some elements are directly adjacent to the bottom bars, or TabView, where each page can have a different background.

Adw.ToolbarStyle.raised-border is similar to Adw.ToolbarStyle.raised, but the shadow is replaced with a more subtle border. This can be useful for applications like image viewers.

See also ToolbarView.set_top_bar_style.

self

Passed: a <AdwToolbarView>.

a toolbar view

style

Passed: a <AdwToolbarStyle>, or one of its symbols.

bottom bar style

Method: toolbar-view:set-content self [content]
Method: set-content self [content]

Sets the content widget for self.

self

Passed: a <AdwToolbarView>.

a toolbar view

content

Passed, or left out: a <GtkWidget>, or #f.

the content widget

Method: toolbar-view:set-extend-content-to-bottom-edge self extend
Method: set-extend-content-to-bottom-edge self extend

Sets whether the content widget can extend behind bottom bars.

This can be used in combination with ToolbarView:reveal-bottom-bars to show and hide toolbars in fullscreen.

See ToolbarView.set_extend_content_to_top_edge.

self

Passed: a <AdwToolbarView>.

a toolbar view

extend

Passed: a boolean.

whether content extends behind bottom bars

Method: toolbar-view:set-extend-content-to-top-edge self extend
Method: set-extend-content-to-top-edge self extend

Sets whether the content widget can extend behind top bars.

This can be used in combination with ToolbarView:reveal-top-bars to show and hide toolbars in fullscreen.

See ToolbarView.set_extend_content_to_bottom_edge.

self

Passed: a <AdwToolbarView>.

a toolbar view

extend

Passed: a boolean.

whether content extends behind top bars

Method: toolbar-view:set-reveal-bottom-bars self reveal
Method: set-reveal-bottom-bars self reveal

Sets whether bottom bars are revealed for self.

The transition will be animated.

This can be used in combination with ToolbarView:extend-content-to-bottom-edge to show and hide toolbars in fullscreen.

See ToolbarView.set_reveal_top_bars.

self

Passed: a <AdwToolbarView>.

a toolbar view

reveal

Passed: a boolean.

whether to reveal bottom bars

Method: toolbar-view:set-reveal-top-bars self reveal
Method: set-reveal-top-bars self reveal

Sets whether top bars are revealed for self.

The transition will be animated.

This can be used in combination with ToolbarView:extend-content-to-top-edge to show and hide toolbars in fullscreen.

See ToolbarView.set_reveal_bottom_bars.

self

Passed: a <AdwToolbarView>.

a toolbar view

reveal

Passed: a boolean.

whether to reveal top bars

Method: toolbar-view:set-top-bar-style self style
Method: set-top-bar-style self style

Sets appearance of the top bars for self.

If set to Adw.ToolbarStyle.flat, top bars are flat and scrolling content has a subtle undershoot shadow when touching them, same as the ‘.undershoot-top‘ style class. This works well for simple content, e.g. StatusPage or PreferencesPage, where the background at the top of the page is uniform. Additionally, windows with sidebars should always use this style.

Undershoot shadow is only present if a top bar is actually present and visible. It is also never present if ToolbarView:extend-content-to-top-edge is set to TRUE.

If set to Adw.ToolbarStyle.raised, top bars have an opaque background and a persistent shadow, this is suitable for content such as utility panes, where some elements are directly adjacent to the top bars, or TabView, where each page can have a different background.

Adw.ToolbarStyle.raised-border is similar to Adw.ToolbarStyle.raised, but the shadow is replaced with a more subtle border. This can be useful for applications like image viewers.

See also ToolbarView.set_bottom_bar_style.

self

Passed: a <AdwToolbarView>.

a toolbar view

style

Passed: a <AdwToolbarStyle>, or one of its symbols.

top bar style