Revision: 396 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=396&view=rev Author: eht16 Date: 2009-01-21 22:13:43 +0000 (Wed, 21 Jan 2009)
Log Message: ----------- Don't enable mnemonics for "Add ... to Dictionary" and "Ignore All" menu items to prevent wrongly displayed labels.
Modified Paths: -------------- trunk/spellcheck/ChangeLog trunk/spellcheck/src/gui.c
Modified: trunk/spellcheck/ChangeLog =================================================================== --- trunk/spellcheck/ChangeLog 2009-01-21 21:49:19 UTC (rev 395) +++ trunk/spellcheck/ChangeLog 2009-01-21 22:13:43 UTC (rev 396) @@ -1,3 +1,10 @@ +2009-01-21 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> + + * src/gui.c: + Don't enable mnemonics for "Add ... to Dictionary" and "Ignore All" + menu items to prevent wrongly displayed labels. + + 2009-01-18 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/scplugin.c, src/speller.c:
Modified: trunk/spellcheck/src/gui.c =================================================================== --- trunk/spellcheck/src/gui.c 2009-01-21 21:49:19 UTC (rev 395) +++ trunk/spellcheck/src/gui.c 2009-01-21 22:13:43 UTC (rev 396) @@ -228,6 +228,21 @@ }
+/* Create a @c GtkImageMenuItem with a stock image and a custom label. + * @param stock_id Stock image ID, e.g. @c GTK_STOCK_OPEN. + * @param label Menu item label. + * @return The new @c GtkImageMenuItem. */ +static GtkWidget *image_menu_item_new(const gchar *stock_id, const gchar *label) +{ + GtkWidget *item = gtk_image_menu_item_new_with_label(label); + GtkWidget *image = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_MENU); + + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image); + gtk_widget_show(image); + return item; +} + + void gui_update_editor_menu_cb(GObject *obj, const gchar *word, gint pos, GeanyDocument *doc, gpointer user_data) { @@ -305,12 +320,12 @@ gtk_container_add(GTK_CONTAINER(sc->edit_menu_sub), menu_item);
label = g_strdup_printf(_("Add "%s" to Dictionary"), search_word); - menu_item = ui_image_menu_item_new(GTK_STOCK_ADD, label); + menu_item = image_menu_item_new(GTK_STOCK_ADD, label); gtk_container_add(GTK_CONTAINER(sc->edit_menu_sub), menu_item); g_signal_connect((gpointer) menu_item, "activate", G_CALLBACK(on_menu_addword_item_activate), GINT_TO_POINTER(0));
- menu_item = ui_image_menu_item_new(GTK_STOCK_REMOVE, _("Ignore All")); + menu_item = image_menu_item_new(GTK_STOCK_REMOVE, _("Ignore All")); gtk_container_add(GTK_CONTAINER(sc->edit_menu_sub), menu_item); g_signal_connect((gpointer) menu_item, "activate", G_CALLBACK(on_menu_addword_item_activate), GINT_TO_POINTER(1));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org