It derives from <GtkWidget>.
A bottom sheet with an optional bottom bar.
<AdwBottomSheet> has three child widgets.
BottomSheet:content is shown persistently.
BottomSheet:sheet is displayed above it when it’s open, and
BottomSheet:bottom-bar is displayed when it’s not.
Bottom sheet and bottom bar are attached to the bottom edge of the
widget. They take the full width by default, but can only take a
portion of it if BottomSheet:full-width is set to FALSE.
In this case, BottomSheet:align determines where along the bottom
edge they are placed.
Bottom bar can be hidden using the BottomSheet:reveal-bottom-bar
property.
<AdwBottomSheet> can be useful for
applications such as music players, that want to have a persistent
bottom bar that expands into a bottom sheet when clicked. It’s meant
for cases where a bottom sheet is tightly integrated into the UI. For
more transient bottom sheets, see Dialog.
To open or close the bottom sheet, use the BottomSheet:open
property.
By default, the bottom sheet has an overlaid drag handle. It can be
disabled by setting BottomSheet:show-drag-handle to FALSE.
Note that the handle also controls whether the sheet can be dragged
using a pointer.
Bottom sheets are modal by default, meaning that the content is dimmed
and cannot be accessed while the sheet is open. Set
BottomSheet:modal to FALSE if this behavior is unwanted.
To disable user interactions for opening or closing the bottom sheet
(such as swipes or clicking the bottom bar or close button), set
BottomSheet:can-open or BottomSheet:can-close to
FALSE.
In some cases, particularly when using a full-width bottom bar, it may
be necessary to shift BottomSheet:content upwards. Use the
BottomSheet:bottom-bar-height and BottomSheet:sheet-height
for that.
<AdwBottomSheet> is not adaptive, and for
larger window sizes applications may want to replace it with another UI,
such as a sidebar. This can be done using MultiLayoutView.
Unlike Dialog presented as a bottom sheet,
<AdwBottomSheet> just follows the content’s
natural size, and it’s up to the applications to make sure their content
provides one. For example, when using
<GtkScrolledWindow>, make sure to set
scrolled-window:propagate-natural-height
to TRUE.
When placed inside an <AdwBottomSheet>,
HeaderBar will not show the title when
BottomSheet:show-drag-handle is TRUE, regardless of
HeaderBar:show-title. This only applies to the default title,
titles set with HeaderBar:title-widget will still be shown.
The <AdwBottomSheet> implementation of the
<GtkBuildable> interface supports setting
the sheet widget by specifying “sheet” as the “type” attribute of a
<child> element, and the bottom bar by specifying “bottom-bar”.
Specifying “content” or omitting the child type results in setting the
content child.
Horizontal alignment of the bottom sheet.
0 means the bottom sheet is flush with the start edge, 1 means it’s flush with the end edge. 0.5 means it’s centered.
Only used when BottomSheet:full-width is set to FALSE.
Its value is a real number.
Set it with (set! (bottom-sheet:align self) value).
The bottom bar widget.
Shown when BottomSheet:open is FALSE. When open, morphs
into the BottomSheet:sheet.
Bottom bar can be temporarily hidden using the
BottomSheet:reveal-bottom-bar property.
Its value is a <GtkWidget>, or #f.
Set it with (set! (bottom-sheet:bottom-bar self) value).
The current bottom bar height.
It can be used to shift the content upwards permanently to accommodate for the bottom bar.
Its value is a 32-bit integer.
It is read only.
Whether the bottom sheet can be closed by user.
It can be closed via the close button, swiping down, pressing Escape or clicking the content dimming (when modal).
Bottom sheet can still be closed using BottomSheet:open.
Its value is a boolean.
Set it with (set! (bottom-sheet:can-close self) value).
Whether the bottom sheet can be opened by user.
It can be opened via clicking or swiping up from the bottom bar.
Does nothing if BottomSheet:bottom-bar is not set.
Bottom sheet can still be opened using BottomSheet:open.
Its value is a boolean.
Set it with (set! (bottom-sheet:can-open self) value).
The content widget.
It’s always shown, and the bottom sheet is overlaid over it.
Its value is a <GtkWidget>, or #f.
Set it with (set! (bottom-sheet:content self) value).
Whether the bottom sheet takes the full width.
When full width, BottomSheet:align is ignored.
Its value is a boolean.
Set it with (set! (bottom-sheet:full-width self) value).
Whether the bottom sheet is modal.
When modal, BottomSheet:content will be dimmed when the bottom
sheet is open, and clicking it will close the bottom sheet. It also
cannot be focused with keyboard.
Otherwise, the content is accessible even when the bottom sheet is open.
Its value is a boolean.
Set it with (set! (bottom-sheet:modal self) value).
Whether the bottom sheet is open.
Its value is a boolean.
Set it with (set! (bottom-sheet:open self) value).
Whether to reveal the bottom bar.
The transition will be animated.
See BottomSheet:bottom-bar and
BottomSheet:bottom-bar-height.
Its value is a boolean.
Set it with (set! (bottom-sheet:reveal-bottom-bar self) value).
The bottom sheet widget.
Only shown when BottomSheet:open is TRUE.
Its value is a <GtkWidget>, or #f.
Set it with (set! (bottom-sheet:sheet self) value).
The current bottom sheet height.
It can be used to shift the content upwards when the bottom sheet is open.
Its value is a 32-bit integer.
It is read only.
Whether to overlay a drag handle in the bottom sheet.
The handle will be overlaid over BottomSheet:sheet.
When the handle is shown, HeaderBar will hide its default title,
and ToolbarView will reserve space if there are no top bars.
Showing drag handle also allows to swipe the bottom sheet down (and to swipe the bottom bar up) with a pointer, instead of just touchscreen.
Its value is a boolean.
Set it with (set! (bottom-sheet:show-drag-handle self) value).
Gets horizontal alignment of the bottom sheet.
Passed: a <AdwBottomSheet>.
a bottom sheet
Returned: a real number.
the horizontal alignment
Gets the bottom bar widget for self.
Passed: a <AdwBottomSheet>.
a bottom sheet
Returned: a <GtkWidget>, or #f.
the bottom bar widget
Gets the current bottom bar height.
It can be used to shift the content upwards permanently to accommodate for the bottom bar.
Passed: a <AdwBottomSheet>.
a bottom sheet
Returned: a 32-bit integer.
the bottom bar height
Gets whether the bottom sheet can be closed by user.
Passed: a <AdwBottomSheet>.
a bottom sheet
Returned: a boolean.
whether the sheet can be closed by user
Gets whether the bottom sheet can be opened by user.
Passed: a <AdwBottomSheet>.
a bottom sheet
Returned: a boolean.
whether the sheet can be opened by user.
Gets the content widget for self.
Passed: a <AdwBottomSheet>.
a bottom sheet
Returned: a <GtkWidget>, or #f.
the content widget
Gets whether the bottom sheet takes the full width.
Passed: a <AdwBottomSheet>.
a bottom sheet
Returned: a boolean.
whether the sheet takes up the full width
Gets whether the bottom sheet is modal.
Passed: a <AdwBottomSheet>.
a bottom sheet
Returned: a boolean.
whether the sheet is modal
Gets whether the bottom sheet is open.
Passed: a <AdwBottomSheet>.
a bottom sheet
Returned: a boolean.
whether the sheet is open
Gets whether the bottom bar is revealed.
Passed: a <AdwBottomSheet>.
a bottom sheet
Returned: a boolean.
whether the bottom bar is revealed
Gets the bottom sheet widget for self.
Passed: a <AdwBottomSheet>.
a bottom sheet
Returned: a <GtkWidget>, or #f.
the sheet widget
Gets the current bottom sheet height.
It can be used to shift the content upwards when the bottom sheet is open.
Passed: a <AdwBottomSheet>.
a bottom sheet
Returned: a 32-bit integer.
the sheet height
Gets whether to show a drag handle in the bottom sheet.
Passed: a <AdwBottomSheet>.
a bottom sheet
Returned: a boolean.
whether to show the drag handle
Creates a new <AdwBottomSheet>.
Returned: a <GtkWidget>.
the new created <AdwBottomSheet>
Sets horizontal alignment of the bottom sheet.
0 means the bottom sheet is flush with the start edge, 1 means it’s flush with the end edge. 0.5 means it’s centered.
Only used when BottomSheet:full-width is set to FALSE.
Passed: a <AdwBottomSheet>.
a bottom sheet
Passed: a real number.
the new alignment
Sets the bottom bar widget for self.
Shown when BottomSheet:open is FALSE. When open, morphs
into the BottomSheet:sheet.
Bottom bar can be temporarily hidden using the
BottomSheet:reveal-bottom-bar property.
Passed: a <AdwBottomSheet>.
a bottom sheet
Passed, or left out: a <GtkWidget>, or
#f.
the bottom bar widget
Sets whether the bottom sheet can be closed by user.
It can be closed via the close button, swiping down, pressing Escape or clicking the content dimming (when modal).
Bottom sheet can still be closed using BottomSheet:open.
Passed: a <AdwBottomSheet>.
a bottom sheet
Passed: a boolean.
whether the sheet can be closed by user
Sets whether the bottom sheet can be opened by user.
It can be opened via clicking or swiping up from the bottom bar.
Does nothing if BottomSheet:bottom-bar is not set.
Bottom sheet can still be opened using BottomSheet:open.
Passed: a <AdwBottomSheet>.
a bottom sheet
Passed: a boolean.
whether the sheet can be opened by user.
Sets the content widget for self.
It’s always shown, and the bottom sheet is overlaid over it.
Passed: a <AdwBottomSheet>.
a bottom sheet
Passed, or left out: a <GtkWidget>, or
#f.
the content widget
Sets whether the bottom sheet takes the full width.
When full width, BottomSheet:align is ignored.
Passed: a <AdwBottomSheet>.
a bottom sheet
Passed: a boolean.
whether the sheet takes up the full width
Sets whether the bottom sheet is modal.
When modal, BottomSheet:content will be dimmed when the bottom
sheet is open, and clicking it will close the bottom sheet. It also
cannot be focused with keyboard.
Otherwise, the content is accessible even when the bottom sheet is open.
Passed: a <AdwBottomSheet>.
a bottom sheet
Passed: a boolean.
whether the sheet is modal
Sets whether the bottom sheet is open.
Passed: a <AdwBottomSheet>.
a bottom sheet
Passed: a boolean.
whether to open the sheet
Sets whether to reveal the bottom bar.
The transition will be animated.
See BottomSheet:bottom-bar and
BottomSheet:bottom-bar-height.
Passed: a <AdwBottomSheet>.
a bottom sheet
Passed: a boolean.
whether to reveal the bottom bar
Sets the bottom sheet widget for self.
Only shown when BottomSheet:open is TRUE.
Passed: a <AdwBottomSheet>.
a bottom sheet
Passed, or left out: a <GtkWidget>, or
#f.
the sheet widget
Sets whether to show a drag handle in the bottom sheet.
The handle will be overlaid over BottomSheet:sheet.
When the handle is shown, HeaderBar will hide its default title,
and ToolbarView will reserve space if there are no top bars.
Showing drag handle also allows to swipe the bottom sheet down (and to swipe the bottom bar up) with a pointer, instead of just touchscreen.
Passed: a <AdwBottomSheet>.
a bottom sheet
Passed: a boolean.
whether to show the drag handle
Connect a handler with (connect object bottom-sheet:close-attempt
handler). It is called as (handler self).
Emitted when the close button or shortcut is used while
Dialog:can-close is set to FALSE.
Passed: a <AdwBottomSheet>.