changed the logic that sets the default for "Custom Palette" so it goes

2000-11-20  Sven Neumann  <sven@gimp.org>

	* app/convert.c (build_palette_button): changed the logic that sets
	the default for "Custom Palette" so it goes through the whole list
	instead of stopping at the "Web" palette. The Indexed-Conversion
	dialog now also remembers palettes appearing after the "Web" palette.
This commit is contained in:
Sven Neumann 2000-11-20 12:06:45 +00:00 committed by Sven Neumann
parent 7b646b3450
commit 54f243d76c
4 changed files with 78 additions and 40 deletions

View File

@ -1,3 +1,10 @@
2000-11-20 Sven Neumann <sven@gimp.org>
* app/convert.c (build_palette_button): changed the logic that sets
the default for "Custom Palette" so it goes through the whole list
instead of stopping at the "Web" palette. The Indexed-Conversion
dialog now also remembers palettes appearing after the "Web" palette.
2000-11-19 Nick Lamb <njl195@zepler.org.uk>
* plug-ins/common/tiff.c: Little-endian fix for 16bit TIFF
@ -5,7 +12,8 @@
2000-11-19 Michael Natterer <mitch@gimp.org>
* libgimp/gimpenv.c: a missing newline confused gtk-doc. Minor doc fixes.
* libgimp/gimpenv.c: a missing newline confused gtk-doc. Minor doc
fixes.
2000-11-18 Nick Lamb <njl195@zepler.org.uk>

View File

@ -789,6 +789,7 @@ build_palette_button (void)
{
GSList *list;
PaletteEntries *entries;
PaletteEntries *theWebPalette = NULL;
int i, default_palette;
UserHasWebPal = FALSE;
@ -812,10 +813,10 @@ build_palette_button (void)
entries = (PaletteEntries *) list->data;
/* Preferentially, the initial default is 'Web' if available */
if (default_palette==-1 &&
g_strcasecmp (entries->name, "Web")==0)
if (theWebPalette == NULL &&
g_strcasecmp (entries->name, "Web") == 0)
{
theCustomPalette = entries;
theWebPalette = entries;
UserHasWebPal = TRUE;
}
@ -829,23 +830,32 @@ build_palette_button (void)
}
}
/* default to first one with <= 256 colors (only used if 'web' palette not avail.) */
/* default to first one with <= 256 colors
(only used if 'web' palette not available) */
if (default_palette == -1)
{
for (i = 0, list = palette_entries_list;
list && default_palette == -1;
i++, list = g_slist_next (list))
if (theWebPalette)
{
entries = (PaletteEntries *) list->data;
if (entries->n_colors <= 256)
theCustomPalette = theWebPalette;
default_palette = 1; /* dummy value */
}
else
{
for (i = 0, list = palette_entries_list;
list && default_palette == -1;
i++, list = g_slist_next (list))
{
theCustomPalette = entries;
default_palette = i;
entries = (PaletteEntries *) list->data;
if (entries->n_colors <= 256)
{
theCustomPalette = entries;
default_palette = i;
}
}
}
}
if (default_palette == -1)
return NULL;
else

View File

@ -789,6 +789,7 @@ build_palette_button (void)
{
GSList *list;
PaletteEntries *entries;
PaletteEntries *theWebPalette = NULL;
int i, default_palette;
UserHasWebPal = FALSE;
@ -812,10 +813,10 @@ build_palette_button (void)
entries = (PaletteEntries *) list->data;
/* Preferentially, the initial default is 'Web' if available */
if (default_palette==-1 &&
g_strcasecmp (entries->name, "Web")==0)
if (theWebPalette == NULL &&
g_strcasecmp (entries->name, "Web") == 0)
{
theCustomPalette = entries;
theWebPalette = entries;
UserHasWebPal = TRUE;
}
@ -829,23 +830,32 @@ build_palette_button (void)
}
}
/* default to first one with <= 256 colors (only used if 'web' palette not avail.) */
/* default to first one with <= 256 colors
(only used if 'web' palette not available) */
if (default_palette == -1)
{
for (i = 0, list = palette_entries_list;
list && default_palette == -1;
i++, list = g_slist_next (list))
if (theWebPalette)
{
entries = (PaletteEntries *) list->data;
if (entries->n_colors <= 256)
theCustomPalette = theWebPalette;
default_palette = 1; /* dummy value */
}
else
{
for (i = 0, list = palette_entries_list;
list && default_palette == -1;
i++, list = g_slist_next (list))
{
theCustomPalette = entries;
default_palette = i;
entries = (PaletteEntries *) list->data;
if (entries->n_colors <= 256)
{
theCustomPalette = entries;
default_palette = i;
}
}
}
}
if (default_palette == -1)
return NULL;
else

View File

@ -789,6 +789,7 @@ build_palette_button (void)
{
GSList *list;
PaletteEntries *entries;
PaletteEntries *theWebPalette = NULL;
int i, default_palette;
UserHasWebPal = FALSE;
@ -812,10 +813,10 @@ build_palette_button (void)
entries = (PaletteEntries *) list->data;
/* Preferentially, the initial default is 'Web' if available */
if (default_palette==-1 &&
g_strcasecmp (entries->name, "Web")==0)
if (theWebPalette == NULL &&
g_strcasecmp (entries->name, "Web") == 0)
{
theCustomPalette = entries;
theWebPalette = entries;
UserHasWebPal = TRUE;
}
@ -829,23 +830,32 @@ build_palette_button (void)
}
}
/* default to first one with <= 256 colors (only used if 'web' palette not avail.) */
/* default to first one with <= 256 colors
(only used if 'web' palette not available) */
if (default_palette == -1)
{
for (i = 0, list = palette_entries_list;
list && default_palette == -1;
i++, list = g_slist_next (list))
if (theWebPalette)
{
entries = (PaletteEntries *) list->data;
if (entries->n_colors <= 256)
theCustomPalette = theWebPalette;
default_palette = 1; /* dummy value */
}
else
{
for (i = 0, list = palette_entries_list;
list && default_palette == -1;
i++, list = g_slist_next (list))
{
theCustomPalette = entries;
default_palette = i;
entries = (PaletteEntries *) list->data;
if (entries->n_colors <= 256)
{
theCustomPalette = entries;
default_palette = i;
}
}
}
}
if (default_palette == -1)
return NULL;
else