Philipp Hörist pushed to branch master at gajim / gajim


Commits:
10ec9ea2 by wurstsalat at 2025-09-11T21:24:22+02:00
feat: Add Toast overlay for feedback

- - - - -


2 changed files:

- gajim/data/gui/main.ui
- gajim/gtk/main.py


Changes:

=====================================
gajim/data/gui/main.ui
=====================================
@@ -60,28 +60,32 @@
           </object>
         </child>
         <property name="content">
-          <object class="GtkGrid">
-            <property name="hexpand">true</property>
-            <property name="vexpand">true</property>
+          <object class="AdwToastOverlay" id="_toast_overlay">
             <child>
-              <object class="AppSideBar" id="_app_side_bar">
-                <layout>
-                  <property name="column">0</property>
-                  <property name="row">0</property>
-                </layout>
-              </object>
-            </child>
-            <child>
-              <object class="MainStack" id="_main_stack">
-                <layout>
-                  <property name="column">1</property>
-                  <property name="row">0</property>
-                </layout>
+              <object class="GtkGrid">
+                <property name="hexpand">true</property>
+                <property name="vexpand">true</property>
+                <child>
+                  <object class="AppSideBar" id="_app_side_bar">
+                    <layout>
+                      <property name="column">0</property>
+                      <property name="row">0</property>
+                    </layout>
+                  </object>
+                </child>
+                <child>
+                  <object class="MainStack" id="_main_stack">
+                    <layout>
+                      <property name="column">1</property>
+                      <property name="row">0</property>
+                    </layout>
+                  </object>
+                </child>
+                <style>
+                  <class name="mainwindow-grid"/>
+                </style>
               </object>
             </child>
-            <style>
-              <class name="mainwindow-grid"/>
-            </style>
           </object>
         </property>
       </object>


=====================================
gajim/gtk/main.py
=====================================
@@ -94,6 +94,7 @@ class MainWindow(Adw.ApplicationWindow, EventHelper):
     _header_bar: Adw.HeaderBar = Gtk.Template.Child()
     _app_side_bar: AppSideBar = Gtk.Template.Child()
     _main_stack: MainStack = Gtk.Template.Child()
+    _toast_overlay: Adw.ToastOverlay = Gtk.Template.Child()
 
     def __init__(self) -> None:
         app.window = self
@@ -204,6 +205,9 @@ def get_emoji_chooser(self) -> EmojiChooser:
 
         return self._emoji_chooser
 
+    def show_toast(self, toast: Adw.Toast) -> None:
+        self._toast_overlay.add_toast(toast)
+
     def show(self) -> None:
         self.present()
 
@@ -1480,6 +1484,8 @@ def _on_file_request(self, event: 
events.FileRequestReceivedEvent) -> None:
             self.add_chat(event.account, event.jid, "chat")
 
     def quit(self) -> None:
+        self.show_toast(Adw.Toast(title=_("Gajim is quitting…"), timeout=0))
+
         if self.is_visible():
             window_width, window_height = self.get_width(), self.get_height()
             app.settings.set("mainwin_width", window_width)



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/10ec9ea280ecc1efb8d84a365120083b075bd118

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/10ec9ea280ecc1efb8d84a365120083b075bd118
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to