From 87f14fbdbcab543a0c4ba511dad4465ecfa412f2 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Mon, 15 Aug 2016 21:57:34 +0200 Subject: [PATCH] libgimpwidgets: support enums with mnemonics in GimpEnumStrore Strip the '_' away, combo boxes don't have mnemonics. --- libgimpwidgets/gimpenumstore.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libgimpwidgets/gimpenumstore.c b/libgimpwidgets/gimpenumstore.c index f45640dafc..5187bffaa0 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); }