# HG changeset patch
# Node ID b4693b4c669f
# Parent  b069ea54b906
diff --git a/pidgin/pidginnotificationlist.c b/pidgin/pidginnotificationlist.c
--- a/pidgin/pidginnotificationlist.c
+++ b/pidgin/pidginnotificationlist.c
@@ -33,7 +33,7 @@
 struct _PidginNotificationList {
 	GtkBox parent;
 
-	GtkWidget *list_view;
+	GtkStack *stack;
 	GtkSingleSelection *selection_model;
 };
 
@@ -106,6 +106,22 @@ pidgin_notification_generic_new(PurpleNo
  * Callbacks
  *****************************************************************************/
 static void
+pidgin_notification_list_items_changed_cb(GListModel *model,
+                                          G_GNUC_UNUSED guint position,
+                                          G_GNUC_UNUSED guint added,
+                                          G_GNUC_UNUSED guint removed,
+                                          gpointer data)
+{
+	PidginNotificationList *list = data;
+
+	if(g_list_model_get_n_items(model) != 0) {
+		gtk_stack_set_visible_child_name(list->stack, "view");
+	} else {
+		gtk_stack_set_visible_child_name(list->stack, "placeholder");
+	}
+}
+
+static void
 pidgin_notification_list_bind_cb(G_GNUC_UNUSED GtkSignalListItemFactory *self,
                                  GObject *object,
                                  G_GNUC_UNUSED gpointer data)
@@ -152,6 +168,10 @@ pidgin_notification_list_init(PidginNoti
 
 	model = purple_notification_manager_get_default_as_model();
 	gtk_single_selection_set_model(list->selection_model, model);
+	g_signal_connect(model, "items-changed",
+	                 G_CALLBACK(pidgin_notification_list_items_changed_cb),
+	                 list);
+	pidgin_notification_list_items_changed_cb(model, 0, 0, 0, list);
 }
 
 static void
@@ -164,7 +184,7 @@ pidgin_notification_list_class_init(Pidg
 	);
 
 	gtk_widget_class_bind_template_child(widget_class, PidginNotificationList,
-	                                     list_view);
+	                                     stack);
 	gtk_widget_class_bind_template_child(widget_class, PidginNotificationList,
 	                                     selection_model);
 
diff --git a/pidgin/resources/notificationlist.ui b/pidgin/resources/notificationlist.ui
--- a/pidgin/resources/notificationlist.ui
+++ b/pidgin/resources/notificationlist.ui
@@ -18,6 +18,7 @@ along with this library; if not, see <ht
 -->
 <interface>
   <requires lib="gtk" version="4.0"/>
+  <requires lib="Adw" version="1.0"/>
   <!-- interface-license-type gplv2 -->
   <!-- interface-name Pidgin -->
   <!-- interface-description Internet Messenger -->
@@ -25,29 +26,39 @@ along with this library; if not, see <ht
   <template class="PidginNotificationList" parent="GtkBox">
     <property name="orientation">vertical</property>
     <child>
-      <object class="GtkListView" id="list_view">
-        <property name="model">
-          <object class="GtkSingleSelection" id="selection_model"/>
-        </property>
-        <property name="factory">
-          <object class="GtkSignalListItemFactory">
-            <signal name="bind" handler="pidgin_notification_list_bind_cb"/>
-          </object>
-        </property>
-<!--
-        <child type="placeholder">
-          <object class="AdwStatusPage">
-            <property name="visible">True</property>
-            <property name="can-focus">False</property>
-            <property name="icon-name">mail-read-symbolic</property>
-            <property name="title" translatable="1">Notifications</property>
-            <property name="description" translatable="1">You&apos;re all caught up!</property>
-            <child>
-              <placeholder/>
-            </child>
+      <object class="GtkStack" id="stack">
+        <property name="vexpand">True</property>
+        <child>
+          <object class="GtkStackPage">
+            <property name="name">view</property>
+            <property name="child">
+              <object class="GtkListView">
+                <property name="model">
+                  <object class="GtkSingleSelection" id="selection_model"/>
+                </property>
+                <property name="factory">
+                  <object class="GtkSignalListItemFactory">
+                    <signal name="bind" handler="pidgin_notification_list_bind_cb"/>
+                  </object>
+                </property>
+              </object>
+            </property>
           </object>
         </child>
--->
+        <child>
+          <object class="GtkStackPage">
+            <property name="name">placeholder</property>
+            <property name="child">
+              <object class="AdwStatusPage">
+                <property name="visible">True</property>
+                <property name="can-focus">False</property>
+                <property name="icon-name">mail-read-symbolic</property>
+                <property name="title" translatable="1">Notifications</property>
+                <property name="description" translatable="1">You&apos;re all caught up!</property>
+              </object>
+            </property>
+          </object>
+        </child>
       </object>
     </child>
   </template>
