diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-02-08 06:16:47 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-02-08 06:16:47 +0800 |
commit | a48def7054eca0b4e6d68107cf14e0666b54cb95 (patch) | |
tree | 188a257dac31872f4c0b740260c13c10011343a0 /widgets/text | |
parent | b9e5bae616d4e1ac1e8fd10e565c4e12cd9a2e85 (diff) | |
download | gsoc2013-evolution-a48def7054eca0b4e6d68107cf14e0666b54cb95.tar.gz gsoc2013-evolution-a48def7054eca0b4e6d68107cf14e0666b54cb95.tar.zst gsoc2013-evolution-a48def7054eca0b4e6d68107cf14e0666b54cb95.zip |
Store the whole GdkColor instead of just the pixel.
2001-02-07 Christopher James Lahey <clahey@ximian.com>
* gal/e-text/e-text.c, gal/e-text/e-text.h (e_text_realize): Store
the whole GdkColor instead of just the pixel.
svn path=/trunk/; revision=8063
Diffstat (limited to 'widgets/text')
-rw-r--r-- | widgets/text/e-text.c | 20 | ||||
-rw-r--r-- | widgets/text/e-text.h | 2 |
2 files changed, 9 insertions, 13 deletions
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 263b84b99b..8edd06ca07 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -1115,13 +1115,10 @@ split_into_lines (EText *text) static void set_text_gc_foreground (EText *text) { - GdkColor c; - if (!text->gc) return; - c.pixel = text->pixel; - gdk_gc_set_foreground (text->gc, &c); + gdk_gc_set_foreground (text->gc, &text->color); } /* Sets the stipple pattern for the text */ @@ -1355,6 +1352,7 @@ e_text_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) (color.green & 0xff00) << 8 | (color.blue & 0xff00) | 0xff); + text->color = color; color_changed = TRUE; text->needs_redraw = 1; needs_update = 1; @@ -1364,14 +1362,13 @@ e_text_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) pcolor = GTK_VALUE_BOXED (*arg); if (pcolor) { color = *pcolor; - gdk_color_context_query_color (item->canvas->cc, &color); - have_pixel = TRUE; } text->rgba = ((color.red & 0xff00) << 16 | (color.green & 0xff00) << 8 | (color.blue & 0xff00) | 0xff); + text->color = color; color_changed = TRUE; text->needs_redraw = 1; needs_update = 1; @@ -1485,10 +1482,8 @@ e_text_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) } if (color_changed) { - if (have_pixel) - text->pixel = color.pixel; - else - text->pixel = gnome_canvas_get_color_pixel (item->canvas, text->rgba); + if (GNOME_CANVAS_ITEM_REALIZED & GTK_OBJECT_FLAGS(item)) + gdk_color_context_query_color (item->canvas->cc, &color); if (!item->canvas->aa) set_text_gc_foreground (text); @@ -1562,8 +1557,7 @@ e_text_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) case ARG_FILL_COLOR_GDK: color = g_new (GdkColor, 1); - color->pixel = text->pixel; - gdk_color_context_query_color (text->item.canvas->cc, color); + *color = text->color; GTK_VALUE_BOXED (*arg) = color; break; @@ -1773,6 +1767,8 @@ e_text_realize (GnomeCanvasItem *item) (* parent_class->realize) (item); text->gc = gdk_gc_new (item->canvas->layout.bin_window); + gdk_color_context_query_color (item->canvas->cc, &text->color); + gdk_gc_set_foreground (text->gc, &text->color); text->i_cursor = gdk_cursor_new (GDK_XTERM); text->default_cursor = gdk_cursor_new (GDK_LEFT_PTR); diff --git a/widgets/text/e-text.h b/widgets/text/e-text.h index 5a1e843b7d..7a383e7b89 100644 --- a/widgets/text/e-text.h +++ b/widgets/text/e-text.h @@ -128,7 +128,7 @@ struct _EText { double xofs, yofs; /* Text offset distance from anchor position */ - gulong pixel; /* Fill color */ + GdkColor color; /* Fill color */ GdkBitmap *stipple; /* Stipple for text */ GdkGC *gc; /* GC for drawing text */ |