aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Jardón <javier.jardon@codethink.co.uk>2011-08-22 15:40:07 +0100
committerJavier Jardón <javier.jardon@codethink.co.uk>2011-08-22 15:40:07 +0100
commit94b05b3ac5e37146e6e049df4daf011e0b5689ae (patch)
tree080ae13c6693f2daf761b7badefd1593c368bad0
parentbd9dc3e996ff885ab13c81d25d317d5121057366 (diff)
downloadayatana-indicator-power-94b05b3ac5e37146e6e049df4daf011e0b5689ae.tar.gz
ayatana-indicator-power-94b05b3ac5e37146e6e049df4daf011e0b5689ae.tar.bz2
ayatana-indicator-power-94b05b3ac5e37146e6e049df4daf011e0b5689ae.zip
Follow standard alignment of icons in menus
Fixes https://bugs.launchpad.net/ubuntu/+source/indicator-power/+bug/829697
-rw-r--r--src/indicator-power.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/indicator-power.c b/src/indicator-power.c
index 1ddcea0..24b2b72 100644
--- a/src/indicator-power.c
+++ b/src/indicator-power.c
@@ -359,6 +359,8 @@ menu_add_device (GtkMenu *menu,
UpDeviceState state;
GtkWidget *icon;
GtkWidget *item;
+ GtkWidget *details_label;
+ GtkWidget *grid;
GIcon *device_gicons;
gchar *device_icon = NULL;
gchar *object_path = NULL;
@@ -397,12 +399,19 @@ menu_add_device (GtkMenu *menu,
/* Create menu item */
item = gtk_image_menu_item_new ();
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), icon);
- gtk_menu_item_set_label (GTK_MENU_ITEM (item), details);
- gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (item), TRUE);
+
+ grid = gtk_grid_new ();
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
+ gtk_grid_attach (GTK_GRID (grid), icon, 0, 0, 1, 1);
+ details_label = gtk_label_new (details);
+ gtk_grid_attach_next_to (GTK_GRID (grid), details_label, icon, GTK_POS_RIGHT, 1, 1);
+ gtk_container_add (GTK_CONTAINER (item), grid);
+ gtk_widget_show (grid);
+
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (show_info_cb), NULL);
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
g_free (short_details);
g_free (details);