Commit a69b8a25 authored by Michael Natterer's avatar Michael Natterer 😴

libgimpwidgets: in GimpEnumLabel use the value's nick if there is no desc

parent 23dab431
......@@ -168,8 +168,8 @@ gimp_enum_label_set_property (GObject *object,
/**
* gimp_enum_label_new:
* @enum_type: the #GType of an enum.
* @value:
* @enum_type: the #GType of an enum
* @value: an enum value
*
* Return value: a new #GimpEnumLabel.
*
......@@ -190,7 +190,7 @@ gimp_enum_label_new (GType enum_type,
/**
* gimp_enum_label_set_value
* @label: a #GimpEnumLabel
* @value:
* @value: an enum value
*
* Since: 2.4
**/
......@@ -198,12 +198,13 @@ void
gimp_enum_label_set_value (GimpEnumLabel *label,
gint value)
{
const gchar *nick;
const gchar *desc;
g_return_if_fail (GIMP_IS_ENUM_LABEL (label));
if (! gimp_enum_get_value (G_TYPE_FROM_CLASS (label->enum_class), value,
NULL, NULL, &desc, NULL))
NULL, &nick, &desc, NULL))
{
g_warning ("%s: %d is not valid for enum of type '%s'",
G_STRLOC, value,
......@@ -211,5 +212,8 @@ gimp_enum_label_set_value (GimpEnumLabel *label,
return;
}
if (! desc)
desc = nick;
gtk_label_set_text (GTK_LABEL (label), desc);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment