aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-10-23 17:00:27 +0800
committerChris Lahey <clahey@src.gnome.org>2001-10-23 17:00:27 +0800
commitc9960102767d1a99302981dbfa1bdcf04dc921cd (patch)
tree4a1d73e61d37c5bd58d3787389c17aa45d286831
parentf359ee16bbcbb42f48ebaccc8517d253faf78dfd (diff)
downloadgsoc2013-evolution-c9960102767d1a99302981dbfa1bdcf04dc921cd.tar.gz
gsoc2013-evolution-c9960102767d1a99302981dbfa1bdcf04dc921cd.tar.zst
gsoc2013-evolution-c9960102767d1a99302981dbfa1bdcf04dc921cd.zip
Use the widget's style's text_gc for drawing text if either
2001-10-23 Christopher James Lahey <clahey@ximian.com> * gal/e-text/e-text.c (e_text_draw): Use the widget's style's text_gc for drawing text if either draw_background or draw_button is on. svn path=/trunk/; revision=13937
-rw-r--r--widgets/text/e-text.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c
index c6259fc3e0..119e6bb2ed 100644
--- a/widgets/text/e-text.c
+++ b/widgets/text/e-text.c
@@ -1994,7 +1994,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
int start_char, end_char;
int sel_start, sel_end;
GdkRectangle sel_rect;
- GdkGC *fg_gc;
+ GdkGC *fg_gc, *main_gc;
GnomeCanvas *canvas;
GtkWidget *widget;
@@ -2003,7 +2003,12 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
widget = GTK_WIDGET(canvas);
fg_gc = widget->style->fg_gc[text->has_selection ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE];
-
+ if (text->draw_background || text->draw_button) {
+ main_gc = widget->style->text_gc[GTK_STATE_NORMAL];
+ } else {
+ main_gc = text->gc;
+ }
+
if (text->draw_borders || text->draw_background) {
gdouble thisx = item->x1 - x;
gdouble thisy = item->y1 - y;
@@ -2167,7 +2172,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
rect.width = text->clip_cwidth;
rect.height = text->clip_cheight;
- gdk_gc_set_clip_rectangle (text->gc, &rect);
+ gdk_gc_set_clip_rectangle (main_gc, &rect);
gdk_gc_set_clip_rectangle (fg_gc, &rect);
clip_rect = &rect;
}
@@ -2179,7 +2184,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
ypos -= text->yofs_edit;
if (text->stipple)
- gnome_canvas_set_stipple_origin (item->canvas, text->gc);
+ gnome_canvas_set_stipple_origin (item->canvas, main_gc);
for (i = 0; i < text->num_lines; i++) {
@@ -2226,7 +2231,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
text_draw_with_objects (text->model,
drawable,
text->font, text->style,
- text->gc,
+ main_gc,
xpos - x,
ypos - y,
lines->text,
@@ -2245,7 +2250,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
text_draw_with_objects (text->model,
drawable,
text->font, text->style,
- text->gc,
+ main_gc,
xpos - x + text_width_with_objects (text->model,
text->font, text->style,
lines->text,
@@ -2257,7 +2262,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
text_draw_with_objects (text->model,
drawable,
text->font, text->style,
- text->gc,
+ main_gc,
xpos - x,
ypos - y,
lines->text,
@@ -2268,7 +2273,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
text->selection_start <= end_char &&
text->show_cursor) {
gdk_draw_rectangle (drawable,
- text->gc,
+ main_gc,
TRUE,
xpos - x + text_width_with_objects (text->model,
text->font, text->style,
@@ -2283,14 +2288,14 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
text_draw_with_objects (text->model,
drawable,
text->font, text->style,
- text->gc,
+ main_gc,
xpos - x,
ypos - y,
lines->text,
lines->ellipsis_length);
e_font_draw_utf8_text (drawable,
text->font, text->style,
- text->gc,
+ main_gc,
xpos - x + lines->width - text->ellipsis_width,
ypos - y,
text->ellipsis ? text->ellipsis : "...",
@@ -2299,7 +2304,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
text_draw_with_objects (text->model,
drawable,
text->font, text->style,
- text->gc,
+ main_gc,
xpos - x,
ypos - y,
lines->text,
@@ -2309,7 +2314,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
if (text->strikeout)
gdk_draw_rectangle (drawable,
- text->gc,
+ main_gc,
TRUE,
xpos - x,
ypos - y - e_font_ascent (text->font) / 2,
@@ -2319,7 +2324,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
}
if (text->clip) {
- gdk_gc_set_clip_rectangle (text->gc, NULL);
+ gdk_gc_set_clip_rectangle (main_gc, NULL);
gdk_gc_set_clip_rectangle (fg_gc, NULL);
}
}
span>2-1/+10 * *** empty log message ***Damon Chaplin2001-10-021-0/+2 * Updated russian translation.Valek Frob2001-10-022-432/+270 * unref the page objects here, instead of in close_dialog(). (This was fixedDamon Chaplin2001-10-022-4/+13 * create storages for providers that are STORAGE and aren't EXTERNAL, ratherDan Winship2001-10-026-62/+97 * Fix up the provider flags to specify things more completely so we don'tDan Winship2001-10-024-9/+32 * Set the window state to sticky. Thanks to Peter Teichman for theFederico Mena Quintero2001-10-022-0/+12 * added basic URI management functionsRodrigo Moya2001-10-024-0/+203 * Don't use mail_tool_get_folder_name here since that function only existedDan Winship2001-10-024-66/+32 * Updates.JP Rosevear2001-10-021-0/+10 * Applied patch from Takuo KitameIain Holmes2001-10-022-3/+14 * updated NEWSJeffrey Stedfast2001-10-021-0/+5 * Convert the comp exceptions to the pilot record (comp_from_remote_record):JP Rosevear2001-10-022-6/+55 * Don't pass the CREATE flag, we shouldn't ever need this...Jeffrey Stedfast2001-10-022-2/+6 * if there is a db error, assume deletion (pas_backend_file_changes): writeJP Rosevear2001-10-022-7/+9 * strdup the uid to avoid double free, write out only after everything isJP Rosevear2001-10-022-3/+9 * if gnome-vfs returns application/octet-stream with the magic check, useLarry Ewing2001-10-022-7/+21 * Don't munge the URL; CamelSession's caching relies on it not changing.Dan Winship2001-10-027-42/+49 * updated NEWS for mailerJeffrey Stedfast2001-10-021-0/+15 * don't use gnome_vfs_uri_is_local on URIs created withRodrigo Moya2001-10-024-8/+7 * New, copied/renamed from mailer and gnome-libs.Dan Winship2001-10-023-0/+121 * Order the linkline to be the same as the order in Mozilla (it is suggestedJeffrey Stedfast2001-10-022-3/+9 * removed hidden Debug submenu, it was causing empty little popup menuRadek Doulik2001-10-013-11/+8 * Updated Brazilian Portuguese translation.Gustavo Maciel Dias Vieira2001-10-012-1886/+1748 * if STAT returns 0, don't bother sending UIDL. Speeds things up slightlyDan Winship2001-10-012-0/+14 * fix typoTakuro Kitame2001-10-011-1/+1 * update ja.poTakuro Kitame2001-10-012-331/+267 * update ja.poTakuro Kitame2001-09-302-203/+195 * add e-passwords.[ch]Chris Toshok2001-09-302-0/+6 * copy/rename the mail specific password stuff here.Chris Toshok2001-09-30