[gimp] libgimpwidgets: support enums with mnemonics in GimpEnumStrore



commit 87f14fbdbcab543a0c4ba511dad4465ecfa412f2
Author: Michael Natterer <mitch gimp org>
Date:   Mon Aug 15 21:57:34 2016 +0200

    libgimpwidgets: support enums with mnemonics in GimpEnumStrore
    
    Strip the '_' away, combo boxes don't have mnemonics.

 libgimpwidgets/gimpenumstore.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/libgimpwidgets/gimpenumstore.c b/libgimpwidgets/gimpenumstore.c
index f45640d..5187bff 100644
--- a/libgimpwidgets/gimpenumstore.c
+++ b/libgimpwidgets/gimpenumstore.c
@@ -153,14 +153,20 @@ gimp_enum_store_add_value (GtkListStore *store,
 {
   GtkTreeIter  iter = { 0, };
   const gchar *desc;
+  gchar       *stripped;
 
   desc = gimp_enum_value_get_desc (GIMP_ENUM_STORE (store)->enum_class, value);
 
+  /* no mnemonics in combo boxes */
+  stripped = gimp_strip_uline (desc);
+
   gtk_list_store_append (store, &iter);
   gtk_list_store_set (store, &iter,
                       GIMP_INT_STORE_VALUE, value->value,
-                      GIMP_INT_STORE_LABEL, desc,
+                      GIMP_INT_STORE_LABEL, stripped,
                       -1);
+
+  g_free (stripped);
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]