Class

AdwToolbarView

Description [src]

final class Adw.ToolbarView : Gtk.Widget {
  /* No available fields */
}

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

toolbar-view

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

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

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

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

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

Top and bottom bars can be hidden and revealed with an animation using the AdwToolbarView:reveal-top-bars and AdwToolbarView: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_ACCESSIBLE_ROLE_GROUP role.

Available since:1.4

Ancestors

  • GtkWidget
  • GInitiallyUnowned
  • GObject

Implements

  • GtkAccessible
  • GtkBuildable
  • GtkConstraintTarget

Constructors

adw_toolbar_view_new

Creates a new AdwToolbarView.

Available since: 1.4

Instance methods

adw_toolbar_view_add_bottom_bar

Adds a bottom bar to self.

Available since: 1.4

adw_toolbar_view_add_top_bar

Adds a top bar to self.

Available since: 1.4

adw_toolbar_view_get_bottom_bar_height

Gets the current bottom bar height for self.

Available since: 1.4

adw_toolbar_view_get_bottom_bar_style

Gets appearance of the botom bars for self.

Available since: 1.4

adw_toolbar_view_get_content

Gets the content widget for self.

Available since: 1.4

adw_toolbar_view_get_extend_content_to_bottom_edge

Gets whether the content widget can extend behind bottom bars.

Available since: 1.4

adw_toolbar_view_get_extend_content_to_top_edge

Gets whether the content widget can extend behind top bars.

Available since: 1.4

adw_toolbar_view_get_reveal_bottom_bars

Gets whether bottom bars are revealed for self.

Available since: 1.4

adw_toolbar_view_get_reveal_top_bars

Gets whether top bars are revealed for self.

Available since: 1.4

adw_toolbar_view_get_top_bar_height

Gets the current top bar height for self.

Available since: 1.4

adw_toolbar_view_get_top_bar_style

Gets appearance of the top bars for self.

Available since: 1.4

adw_toolbar_view_remove

Removes a child from self.

Available since: 1.4

adw_toolbar_view_set_bottom_bar_style

Sets appearance of the bottom bars for self.

Available since: 1.4

adw_toolbar_view_set_content

Sets the content widget for self.

Available since: 1.4

adw_toolbar_view_set_extend_content_to_bottom_edge

Sets whether the content widget can extend behind bottom bars.

Available since: 1.4

adw_toolbar_view_set_extend_content_to_top_edge

Sets whether the content widget can extend behind top bars.

Available since: 1.4

adw_toolbar_view_set_reveal_bottom_bars

Sets whether bottom bars are revealed for self.

Available since: 1.4

adw_toolbar_view_set_reveal_top_bars

Sets whether top bars are revealed for self.

Available since: 1.4

adw_toolbar_view_set_top_bar_style

Sets appearance of the top bars for self.

Available since: 1.4

Properties

Adw.ToolbarView:bottom-bar-height

The current bottom bar height.

Available since: 1.4

Adw.ToolbarView:bottom-bar-style

Appearance of the bottom bars.

Available since: 1.4

Adw.ToolbarView:content

The content widget.

Available since: 1.4

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

Whether the content widget can extend behind bottom bars.

Available since: 1.4

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

Whether the content widget can extend behind top bars.

Available since: 1.4

Adw.ToolbarView:reveal-bottom-bars

Whether bottom bars are visible.

Available since: 1.4

Adw.ToolbarView:reveal-top-bars

Whether top bars are revealed.

Available since: 1.4

Adw.ToolbarView:top-bar-height

The current top bar height.

Available since: 1.4

Adw.ToolbarView:top-bar-style

Appearance of the top bars.

Available since: 1.4

Class structure

struct AdwToolbarViewClass {
  GtkWidgetClass parent_class;
  
}
Class members
parent_class
GtkWidgetClass
  No description available.