From 8ccd3bc96dd8d962db69d2a1e645e8db8901668b Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Sat, 5 Sep 2020 17:55:25 +0200 Subject: Whitespace fix --- libayatana-indicator/indicator-ng.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/libayatana-indicator/indicator-ng.c b/libayatana-indicator/indicator-ng.c index b31d298..675b8f1 100644 --- a/libayatana-indicator/indicator-ng.c +++ b/libayatana-indicator/indicator-ng.c @@ -522,19 +522,20 @@ indicator_ng_set_icon_from_variant (IndicatorNg *self, } } -static void -indicator_ng_set_label (IndicatorNg *self, - const gchar *label) +static void indicator_ng_set_label(IndicatorNg *self, const gchar *label) { - if (label == NULL || *label == '\0') + if (label == NULL || *label == '\0') { - if (self->entry.label) - gtk_widget_hide (GTK_WIDGET (self->entry.label)); - return; + if (self->entry.label) + { + gtk_label_set_label(GTK_LABEL (self->entry.label), NULL); + } + + return; } - gtk_label_set_label (GTK_LABEL (self->entry.label), label); - gtk_widget_show (GTK_WIDGET (self->entry.label)); + gtk_label_set_label (GTK_LABEL (self->entry.label), label); + gtk_widget_show (GTK_WIDGET (self->entry.label)); } static void -- cgit v1.2.3 From 8c8822dc3994354ad73b8e0937747f7c291b5b8a Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Sat, 5 Sep 2020 18:06:09 +0200 Subject: Whitespace fix --- libayatana-indicator/indicator-ng.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libayatana-indicator/indicator-ng.c b/libayatana-indicator/indicator-ng.c index 675b8f1..79a612c 100644 --- a/libayatana-indicator/indicator-ng.c +++ b/libayatana-indicator/indicator-ng.c @@ -528,14 +528,14 @@ static void indicator_ng_set_label(IndicatorNg *self, const gchar *label) { if (self->entry.label) { - gtk_label_set_label(GTK_LABEL (self->entry.label), NULL); + gtk_widget_hide(GTK_WIDGET (self->entry.label)); } return; } - gtk_label_set_label (GTK_LABEL (self->entry.label), label); - gtk_widget_show (GTK_WIDGET (self->entry.label)); + gtk_label_set_label(GTK_LABEL (self->entry.label), label); + gtk_widget_show(GTK_WIDGET (self->entry.label)); } static void -- cgit v1.2.3 From d8b5315ba904348de5b06d2a667faac9877dc6c4 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Sat, 5 Sep 2020 18:07:06 +0200 Subject: indicator-ng.c: Do not hide image when toggling label visibility Fixes AyatanaIndicators/ayatana-indicator-session#12 --- libayatana-indicator/indicator-ng.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libayatana-indicator/indicator-ng.c b/libayatana-indicator/indicator-ng.c index 79a612c..58cc2a6 100644 --- a/libayatana-indicator/indicator-ng.c +++ b/libayatana-indicator/indicator-ng.c @@ -528,7 +528,8 @@ static void indicator_ng_set_label(IndicatorNg *self, const gchar *label) { if (self->entry.label) { - gtk_widget_hide(GTK_WIDGET (self->entry.label)); + // Hiding the label also hides the image - set the label instead of gtk_widget_hide + gtk_label_set_label(GTK_LABEL (self->entry.label), NULL); } return; -- cgit v1.2.3