aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-09-04 20:23:37 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-09-04 20:23:37 +0200
commit2c8673116d330a7d2b68b2c60cac8f3ebc98e555 (patch)
treee591b28ad16cb3156b515d115fd27b3c298ac8dd
parent300f66f59d4a07de13d4593d5d9cd1bb47ed33e3 (diff)
parentbbfcf3d6dfc5f34d722b3be252d9b1e5b9f4ecb7 (diff)
downloadayatana-indicator-notifications-2c8673116d330a7d2b68b2c60cac8f3ebc98e555.tar.gz
ayatana-indicator-notifications-2c8673116d330a7d2b68b2c60cac8f3ebc98e555.tar.bz2
ayatana-indicator-notifications-2c8673116d330a7d2b68b2c60cac8f3ebc98e555.zip
Merge branch 'tari01-pr/add-separator'
Attributes GH PR #11: https://github.com/AyatanaIndicators/ayatana-indicator-notifications/pull/11
-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);
+ }
}
/**