From: Colin Clark Date: Sat, 16 Apr 2022 11:58:52 +0000 (+0100) Subject: Spelling checks for keywords auto-completion list X-Git-Tag: gtk2final~24 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=05bae097462142e2d709b7d246eef1a3f7239515 Spelling checks for keywords auto-completion list Include option to permit spelling checks on the keyword auto-completion list in Preferences/Keywords. --- diff --git a/src/preferences.c b/src/preferences.c index a67fc772..dce9e05c 100644 --- a/src/preferences.c +++ b/src/preferences.c @@ -63,6 +63,10 @@ #endif #endif +#ifdef HAVE_SPELL +#include +#endif + #define EDITOR_NAME_MAX_LENGTH 32 #define EDITOR_COMMAND_MAX_LENGTH 1024 @@ -3272,6 +3276,9 @@ static void config_tab_keywords(GtkWidget *notebook) GtkTextIter iter; GtkTextBuffer *buffer; gchar *tmp; +#ifdef HAVE_SPELL + GspellTextView *gspell_view; +#endif vbox = scrolled_notebook_page(notebook, _("Keywords")); @@ -3290,6 +3297,16 @@ static void config_tab_keywords(GtkWidget *notebook) gtk_box_pack_start(GTK_BOX(group), scrolled, TRUE, TRUE, 0); gtk_widget_show(scrolled); +#ifdef HAVE_SPELL +#if GTK_CHECK_VERSION(3,20,0) + if (options->metadata.check_spelling) + { + gspell_view = gspell_text_view_get_from_gtk_text_view(GTK_TEXT_VIEW(keyword_text)); + gspell_text_view_basic_setup(gspell_view); + } +#endif +#endif + gtk_container_add(GTK_CONTAINER(scrolled), keyword_text); gtk_widget_show(keyword_text);