aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-notifications.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/indicator-notifications.c')
-rw-r--r--src/indicator-notifications.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/indicator-notifications.c b/src/indicator-notifications.c
index 56ddd7a..dffa57c 100644
--- a/src/indicator-notifications.c
+++ b/src/indicator-notifications.c
@@ -72,6 +72,7 @@ struct _IndicatorNotificationsPrivate {
GtkWidget *clear_item;
GtkWidget *clear_item_label;
GtkWidget *settings_item;
+ GtkWidget *pSeparator;
gchar *accessible_desc;
@@ -204,6 +205,9 @@ indicator_notifications_init(IndicatorNotifications *self)
gtk_menu_shell_prepend(GTK_MENU_SHELL(self->priv->menu), self->priv->clear_item);
+ self->priv->pSeparator = gtk_separator_menu_item_new();
+ gtk_menu_shell_prepend(GTK_MENU_SHELL(self->priv->menu), self->priv->pSeparator);
+
/* Watch for notifications from dbus */
self->priv->spy = dbus_spy_new();
g_signal_connect(self->priv->spy, DBUS_SPY_SIGNAL_MESSAGE_RECEIVED, G_CALLBACK(message_received_cb), self);
@@ -527,9 +531,15 @@ update_clear_item_markup(IndicatorNotifications *self)
gtk_label_set_markup(GTK_LABEL(self->priv->clear_item_label), markup);
g_free(markup);
- if (total_length == 0) {
- gtk_menu_shell_deactivate(GTK_MENU_SHELL(self->priv->menu));
- }
+ if (total_length == 0)
+ {
+ gtk_widget_hide(self->priv->pSeparator);
+ gtk_menu_shell_deactivate(GTK_MENU_SHELL(self->priv->menu));
+ }
+ else
+ {
+ gtk_widget_show(self->priv->pSeparator);
+ }
}
/**