Show a transient toast using Adw.ToastOverlay.
(self, message: str)
| 112 | self._raw_wrap_lines = False |
| 113 | |
| 114 | def show_toast(self, message: str): |
| 115 | """Show a transient toast using Adw.ToastOverlay.""" |
| 116 | try: |
| 117 | toast = Adw.Toast.new(message) |
| 118 | try: |
| 119 | toast.set_timeout(3) |
| 120 | except Exception: |
| 121 | pass |
| 122 | if hasattr(self, "toast_overlay") and self.toast_overlay is not None: |
| 123 | self.toast_overlay.add_toast(toast) |
| 124 | except Exception: |
| 125 | pass |
| 126 | |
| 127 | def _show_undo_toast(self, message: str, on_undo): |
| 128 | """Show a toast with an Undo action; executes on_undo when clicked.""" |
no outgoing calls
no test coverage detected