hide the Index label if the color index is -1 (happens with

2007-05-03  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpcolorframe.c (gimp_color_frame_update): hide the
	Index label if the color index is -1 (happens with sample_average).

svn path=/trunk/; revision=22387
This commit is contained in:
Sven Neumann 2007-05-03 09:26:06 +00:00 committed by Sven Neumann
parent 0d3026e817
commit cb9fb9f190
2 changed files with 13 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2007-05-03 Sven Neumann <sven@gimp.org>
* app/widgets/gimpcolorframe.c (gimp_color_frame_update): hide the
Index label if the color index is -1 (happens with sample_average).
2007-05-03 Sven Neumann <sven@gimp.org> 2007-05-03 Sven Neumann <sven@gimp.org>
* plug-ins/winicon/icosave.c * plug-ins/winicon/icosave.c

View file

@ -420,10 +420,16 @@ gimp_color_frame_update (GimpColorFrame *frame)
switch (GIMP_IMAGE_TYPE_BASE_TYPE (frame->sample_type)) switch (GIMP_IMAGE_TYPE_BASE_TYPE (frame->sample_type))
{ {
case GIMP_INDEXED: case GIMP_INDEXED:
names[4] = _("Index:"); names[4] = _("Index:");
if (frame->sample_valid) if (frame->sample_valid)
values[4] = g_strdup_printf ("%d", frame->color_index); {
/* color_index will be -1 for an averaged sample */
if (frame->color_index < 0)
names[4] = NULL;
else
values[4] = g_strdup_printf ("%d", frame->color_index);
}
/* fallthrough */ /* fallthrough */
case GIMP_RGB: case GIMP_RGB: