[libadwaita/wip/exalm/screenshots-2: 13/21] toast-overlay: Allow adding toasts via in GtkBuilder




commit 6e66c66c60602f73700cf2474c8ac7c0c9ce8bc3
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Mon Dec 13 16:35:11 2021 +0100

    toast-overlay: Allow adding toasts via in GtkBuilder
    
    This will help making automatic screenshots for toasts.

 src/adw-toast-overlay.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/adw-toast-overlay.c b/src/adw-toast-overlay.c
index 8a3a8e3c..a9c4eac5 100644
--- a/src/adw-toast-overlay.c
+++ b/src/adw-toast-overlay.c
@@ -474,6 +474,8 @@ adw_toast_overlay_buildable_add_child (GtkBuildable *buildable,
 
   if (!type && GTK_IS_WIDGET (child))
     adw_toast_overlay_set_child (self, GTK_WIDGET (child));
+  else if (!type && ADW_IS_TOAST (child))
+    adw_toast_overlay_add_toast (self, g_object_ref (ADW_TOAST (child)));
   else
     parent_buildable_iface->add_child (buildable, builder, child, type);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]