Changeset 2708
- Timestamp:
- 08/15/07 17:32:50 (6 years ago)
- Location:
- trunk/src/target/OM-2007.2/libraries/libmokoui2
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
libmokoui/moko-stock.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/target/OM-2007.2/libraries/libmokoui2/ChangeLog
r2626 r2708 1 2007-08-15 Thomas Wood <thomas@openedhand.com> 2 3 * libmokoui/moko-stock.c: (_moko_stock_add_icon): Add a hack to make sure we 4 at least have a version of the icons available at each possible GtkIconSize 5 1 6 2007-08-03 Holger Hans Peter Freyther <zecke@selfish.org> 2 7 -
trunk/src/target/OM-2007.2/libraries/libmokoui2/libmokoui/moko-stock.c
r2487 r2708 70 70 { 71 71 static GtkIconTheme *theme = NULL; 72 GtkIconSource *source = NULL;72 GtkIconSource *source; 73 73 GtkIconSet *set = NULL; 74 74 GdkPixbuf *pixbuf = NULL; 75 int i; 75 76 76 77 if (theme == NULL) 77 78 theme = gtk_icon_theme_get_default (); 78 79 79 source = gtk_icon_source_new ();80 81 gtk_icon_source_set_size (source, GTK_ICON_SIZE_BUTTON);82 gtk_icon_source_set_size_wildcarded (source, FALSE);83 84 80 pixbuf = gtk_icon_theme_load_icon (theme, item->stock_id, 85 81 32, 0, NULL); 82 86 83 if (pixbuf == NULL) 87 84 { … … 90 87 } 91 88 92 gtk_icon_source_set_pixbuf (source, pixbuf);93 94 g_object_unref (G_OBJECT (pixbuf));95 96 89 set = gtk_icon_set_new (); 97 90 98 gtk_icon_set_add_source (set, source); 99 gtk_icon_source_free (source); 91 /* 92 * This is temporary hack to make sure we have all the sizes available. 93 * Ideally we should try loading the pixbuf at the correct size from the theme 94 * for each possible size in GtkIconSize, rather than re-using the same pixbuf 95 */ 96 for (i = GTK_ICON_SIZE_MENU; i <= GTK_ICON_SIZE_DIALOG; i++) 97 { 98 source = gtk_icon_source_new (); 99 gtk_icon_source_set_size (source, i); 100 gtk_icon_source_set_size_wildcarded (source, FALSE); 101 gtk_icon_source_set_pixbuf (source, pixbuf); 102 gtk_icon_set_add_source (set, source); 103 gtk_icon_source_free (source); 104 } 105 106 107 100 108 101 109 gtk_icon_factory_add (factory, item->stock_id, set); 102 110 gtk_icon_set_unref (set); 111 112 113 114 g_object_unref (G_OBJECT (pixbuf)); 103 115 } 104 116
Note: See TracChangeset
for help on using the changeset viewer.
