Commit aa610592 authored by Gabriel Ivascu's avatar Gabriel Ivascu
Browse files

notification: Destroy widget when close button is clicked
parent 6afb7957
......@@ -79,3 +79,18 @@ ephy_notification_container_add_notification (EphyNotificationContainer *self,
gtk_widget_show_all (GTK_WIDGET (self));
gtk_revealer_set_reveal_child (GTK_REVEALER (self), TRUE);
ephy_notification_container_get_num_children (EphyNotificationContainer *self)
GList *children;
guint retval;
children = gtk_container_get_children (GTK_CONTAINER (self->grid));
retval = g_list_length (children);
g_list_free (children);
return retval;
......@@ -32,5 +32,6 @@ EphyNotificationContainer *ephy_notification_container_get_default (void);
void ephy_notification_container_add_notification (EphyNotificationContainer *self,
GtkWidget *notification);
guint ephy_notification_container_get_num_children (EphyNotificationContainer *self);
......@@ -118,8 +118,13 @@ close_button_clicked_cb (GtkButton *button,
EphyNotificationContainer *container = ephy_notification_container_get_default ();
gtk_widget_hide (GTK_WIDGET (container));
gtk_revealer_set_reveal_child (GTK_REVEALER (container), FALSE);
/* gtk_widget_destroy() removes the widget from its parent container. */
gtk_widget_destroy (GTK_WIDGET (self));
if (ephy_notification_container_get_num_children (container) == 0) {
gtk_widget_hide (GTK_WIDGET (container));
gtk_revealer_set_reveal_child (GTK_REVEALER (container), FALSE);
static void
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment