Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/telephony/client/ui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,13 @@ def _refresh_calling_controls(self, *args):
def _toast_target(self):
"""Return the overlay of the topmost surface.

A presented dialog is painted above the window content, so a
toast raised on the window's own overlay would sit hidden
underneath an open sheet.
An open sheet and a presented dialog are both painted above
the window content, so a toast raised on the window's own
overlay would sit hidden underneath them.
"""
if self.sheet_host.get_open() and self.sheet_toast_overlay is not None:
return self.sheet_toast_overlay

dialog = self.get_visible_dialog()
if dialog is not None:
overlay = self._find_toast_overlay(dialog.get_child())
Expand Down
15 changes: 13 additions & 2 deletions src/telephony/client/ui/widgets/common_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,23 @@ def install_sheet_host(window):
host.set_modal(True)
host.set_content(content)
window.set_content(host)
window.sheet_toast_overlay = None
return host


def present_sheet(window, child):
"""Show a widget as the window's bottom sheet."""
window.sheet_host.set_sheet(child)
"""Show a widget as the window's bottom sheet.

The sheet content rides inside its own toast overlay, because the
window's overlay sits under the sheet and a toast raised there
while a sheet is open answers to nobody. The host itself is left
where it is; the sheet slot is just a widget and takes the wrapper
without complaint.
"""
overlay = Adw.ToastOverlay()
overlay.set_child(child)
window.sheet_toast_overlay = overlay
window.sheet_host.set_sheet(overlay)
window.sheet_host.set_open(True)


Expand Down