Revision: 5331 http://geany.svn.sourceforge.net/geany/?rev=5331&view=rev Author: ntrel Date: 2010-10-26 17:30:16 +0000 (Tue, 26 Oct 2010)
Log Message: ----------- Add notebook tab document icons (based on patch by Colomban Wendling, thanks).
Modified Paths: -------------- trunk/ChangeLog trunk/src/ui_utils.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-10-26 17:20:48 UTC (rev 5330) +++ trunk/ChangeLog 2010-10-26 17:30:16 UTC (rev 5331) @@ -14,6 +14,9 @@ * src/sidebar.c, src/document.c: Show mimetype icon in sidebar Documents list (patch by Colomban Wendling, thanks). + * src/ui_utils.c: + Add notebook tab document icons (based on patch by Colomban + Wendling, thanks).
2010-10-25 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/ui_utils.c =================================================================== --- trunk/src/ui_utils.c 2010-10-26 17:20:48 UTC (rev 5330) +++ trunk/src/ui_utils.c 2010-10-26 17:30:16 UTC (rev 5331) @@ -2364,7 +2364,7 @@ * @since 0.19 */ void ui_menu_add_document_items(GtkMenu *menu, GeanyDocument *active, GCallback callback) { - GtkWidget *menu_item, *menu_item_label; + GtkWidget *menu_item, *menu_item_label, *image; const GdkColor *color; GeanyDocument *doc; guint i, len; @@ -2378,7 +2378,14 @@ continue;
base_name = g_path_get_basename(DOC_FILENAME(doc)); - menu_item = gtk_menu_item_new_with_label(base_name); + menu_item = gtk_image_menu_item_new_with_label(base_name); + if (doc->file_type->icon) + image = gtk_image_new_from_pixbuf(doc->file_type->icon); + else + image = gtk_image_new_from_stock(GTK_STOCK_FILE, GTK_ICON_SIZE_MENU); + + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM (menu_item), image); + gtk_widget_show(menu_item); gtk_container_add(GTK_CONTAINER(menu), menu_item); g_signal_connect(menu_item, "activate", callback, doc);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.