Fix toast notifications by adding AdwToastOverlay

This commit is contained in:
Pavel Baksy 2026-01-05 11:14:31 +01:00
parent 99121a8c48
commit 31c7b383b4
3 changed files with 10 additions and 6 deletions

View File

@ -1,5 +1,5 @@
project('roster',
version: '0.4.0',
version: '0.4.1',
meson_version: '>= 1.0.0',
default_options: [ 'warning_level=2', 'werror=false', ],
)

View File

@ -7,7 +7,9 @@
<property name="default-width">1200</property>
<property name="default-height">800</property>
<property name="content">
<object class="GtkPaned" id="main_pane">
<object class="AdwToastOverlay" id="toast_overlay">
<property name="child">
<object class="GtkPaned" id="main_pane">
<property name="orientation">horizontal</property>
<property name="position">180</property>
<property name="shrink-start-child">False</property>
@ -209,6 +211,8 @@
</object>
</property>
</object>
</property>
</object>
</property>
</template>

View File

@ -39,6 +39,9 @@ import uuid
class RosterWindow(Adw.ApplicationWindow):
__gtype_name__ = 'RosterWindow'
# Toast overlay
toast_overlay = Gtk.Template.Child()
# Top bar widgets
save_request_button = Gtk.Template.Child()
new_request_button = Gtk.Template.Child()
@ -750,10 +753,7 @@ class RosterWindow(Adw.ApplicationWindow):
toast = Adw.Toast()
toast.set_title(message)
toast.set_timeout(3)
# Get the toast overlay (we need to add one)
# For now, just print to console
print(f"Toast: {message}")
self.toast_overlay.add_toast(toast)
# Project Management Methods