Fix toast notifications by adding AdwToastOverlay
This commit is contained in:
parent
29ae77e8ec
commit
1c124939b6
@ -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', ],
|
||||
)
|
||||
|
||||
@ -7,6 +7,8 @@
|
||||
<property name="default-width">1200</property>
|
||||
<property name="default-height">800</property>
|
||||
<property name="content">
|
||||
<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>
|
||||
@ -210,6 +212,8 @@
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
|
||||
<menu id="primary_menu">
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user