Commit eaf1b680 authored by Simon Budig's avatar Simon Budig Committed by Simon Budig
Browse files

Removed check for len % 3 == 0, so that the entry accepts hex colors

2004-09-18  Simon Budig  <simon@gimp.org>

	* libgimpwidgets/gimpcolorhexentry.c: Removed check for len % 3 == 0,
	so that the entry accepts hex colors starting with "#" again.
	Untabbified.
parent adf71de0
2004-09-18 Simon Budig <simon@gimp.org>
* libgimpwidgets/gimpcolorhexentry.c: Removed check for len % 3 == 0,
so that the entry accepts hex colors starting with "#" again.
Untabbified.
2004-09-18 Manish Singh <yosh@gimp.org>
* app/Makefile.am: remove LDFLAGS references to now private
......
......@@ -73,14 +73,14 @@ gimp_color_hex_entry_get_type (void)
static const GTypeInfo entry_info =
{
sizeof (GimpColorHexEntryClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_color_hex_entry_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpColorHexEntry),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_color_hex_entry_init,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_color_hex_entry_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpColorHexEntry),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_color_hex_entry_init,
};
entry_type = g_type_register_static (GTK_TYPE_ENTRY,
......@@ -156,11 +156,11 @@ gimp_color_hex_entry_init (GimpColorHexEntry *entry)
gtk_entry_set_text (GTK_ENTRY (entry), "000000");
g_signal_connect (entry, "focus_out_event",
G_CALLBACK (gimp_color_hex_entry_events),
NULL);
G_CALLBACK (gimp_color_hex_entry_events),
NULL);
g_signal_connect (entry, "key_press_event",
G_CALLBACK (gimp_color_hex_entry_events),
NULL);
G_CALLBACK (gimp_color_hex_entry_events),
NULL);
g_signal_connect (completion, "match_selected",
G_CALLBACK (gimp_color_hex_entry_matched),
......@@ -264,12 +264,12 @@ gimp_color_hex_entry_events (GtkWidget *widget,
GimpRGB color;
gsize len = strlen (text);
if (len > 0&&
((len % 3 == 0 && gimp_rgb_parse_hex (&color, text, len)) ||
(gimp_rgb_parse_name (&color, text, -1))))
{
if (len > 0 &&
(gimp_rgb_parse_hex (&color, text, len) ||
gimp_rgb_parse_name (&color, text, -1)))
{
gimp_color_hex_entry_set_color (entry, &color);
}
}
else
{
gtk_entry_set_text (GTK_ENTRY (entry), buffer);
......
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