Skip to contentSkip to conversation

applets/systray: Allow icons to be smaller

PATCH New Jussi Kukkonen 1 participant 1 message Oct 4, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 applets/systray: Allow icons to be smaller

Don't expand/fill the systray items, align them in the center of the systray panel. This makes sure the icons are drawn at the size they expect.

---

This is related to [YOCTO #9995]: GtkStatusIcon based systray items render weirdly if the get allocated more space than they expected.

 applets/systray/systray.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
applets/systray/systray.c +3 -2
index 39698a8..94a5753 100644
@@ -29,8 +29,9 @@ on_realize (GtkWidget *widget, gpointer user_data)
   tray = (GtkWidget *)na_tray_new_for_screen (screen, orientation);
 
   gtk_widget_show (tray);
-
-  gtk_container_add (GTK_CONTAINER (widget), tray);
+  gtk_widget_set_valign (tray, GTK_ALIGN_CENTER);
+  gtk_widget_set_halign (tray, GTK_ALIGN_CENTER);
+  gtk_box_pack_start (GTK_BOX (widget), tray, FALSE, FALSE, 0);
 }
 
 G_MODULE_EXPORT GtkWidget *
Signature · 1 line
2.9.3