diff options
author | Robert Tari <robert@tari.in> | 2020-09-04 02:37:09 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2020-09-04 20:19:30 +0200 |
commit | bbfcf3d6dfc5f34d722b3be252d9b1e5b9f4ecb7 (patch) | |
tree | e591b28ad16cb3156b515d115fd27b3c298ac8dd | |
parent | 300f66f59d4a07de13d4593d5d9cd1bb47ed33e3 (diff) | |
download | ayatana-indicator-notifications-bbfcf3d6dfc5f34d722b3be252d9b1e5b9f4ecb7.tar.gz ayatana-indicator-notifications-bbfcf3d6dfc5f34d722b3be252d9b1e5b9f4ecb7.tar.bz2 ayatana-indicator-notifications-bbfcf3d6dfc5f34d722b3be252d9b1e5b9f4ecb7.zip |
src/indicator-notifications.c: Add separator after notification list.
Fixes AyatanaIndicators/ayatana-indicator-notifications#8.
-rw-r--r-- | src/indicator-notifications.c | 16 |
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); + } } /** |