~dbarth/indicator-messages/icon-size-issue

« back to all changes in this revision

Viewing changes to src/indicator-messages.c

  • Committer: David Barth
  • Date: 2010-09-30 13:36:21 UTC
  • Revision ID: david.barth@canonical.com-20100930133621-0ed6st3tkrz2zqt3
trying to fix the icon size issue

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
static GtkWidget * main_image = NULL;
72
72
static DBusGProxy * icon_proxy = NULL;
73
73
static GtkSizeGroup * indicator_right_group = NULL;
 
74
static GtkIconSize design_team_size;
74
75
 
75
76
/* Prototypes */
76
77
static void indicator_messages_class_init (IndicatorMessagesClass *klass);
99
100
        io_class->get_image = get_icon;
100
101
        io_class->get_menu = get_menu;
101
102
 
 
103
        design_team_size = gtk_icon_size_register("design-team-size", 22, 22);
 
104
 
102
105
        return;
103
106
}
104
107
 
426
429
 
427
430
        /* Set the minimum size, we always want it to take space */
428
431
        gint width, height;
429
 
        gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height);
430
 
 
431
 
        GtkWidget * icon = gtk_image_new_from_icon_name(dbusmenu_menuitem_property_get(newitem, APPLICATION_MENUITEM_PROP_ICON), GTK_ICON_SIZE_MENU);
 
432
        gtk_icon_size_lookup(design_team_size, &width, &height);
 
433
 
 
434
        GtkWidget * icon = gtk_image_new_from_icon_name(dbusmenu_menuitem_property_get(newitem, APPLICATION_MENUITEM_PROP_ICON), design_team_size);
 
435
 
 
436
        g_debug ("icon \"%s\", size request: %dx%d",
 
437
                         dbusmenu_menuitem_property_get(newitem, APPLICATION_MENUITEM_PROP_ICON),
 
438
                         width + 5 + 1, height);
432
439
        gtk_widget_set_size_request(icon, width
433
440
                                                                + 5 /* ref triangle is 5x9 pixels */
434
 
                                                                + 2 /* padding */,
 
441
                                                                + 1 /* padding */,
435
442
                                                                height);
436
 
        gtk_misc_set_alignment(GTK_MISC(icon), 1.0 /* right aligned */, 0.5);
 
443
        gtk_misc_set_alignment(GTK_MISC(icon), 0.5 /* right aligned */, 0);
437
444
        gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(gmi), icon);
438
445
        gtk_widget_show(icon);
439
446