From c8a10fa6da81431061b55c131cd3ce737ec8f1df Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Fri, 7 Mar 2003 22:57:40 +0000 Subject: fix drawing bugs, and disable the stupid looking focus rect, since I can't 2003-03-07 Chris Toshok * gal/e-text/e-text.c (e_text_draw): fix drawing bugs, and disable the stupid looking focus rect, since I can't find a theme that uses them. (e_text_event): force redraw in the focus-out case if the cursor is shown (so we can erase it), and also trick ourselves into drawing it immediately (by setting it to FALSE) in the focus-in case. svn path=/trunk/; revision=20223 --- widgets/text/e-text.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'widgets/text/e-text.c') diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 7a434fdcae..77be073c89 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -1279,23 +1279,18 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, if (text->draw_borders){ - if (text->editing) { - thisx += 1; - thisy += 1; - thiswidth -= 2; - thisheight -= 2; - } - gtk_paint_shadow (widget->style, drawable, GTK_STATE_NORMAL, GTK_SHADOW_IN, NULL, widget, "entry", thisx, thisy, thiswidth, thisheight); +#if 1 if (text->editing) { - thisx -= 1; - thisy -= 1; - thiswidth += 2; - thisheight += 2; + thisx += 1; + thisy += 1; + thiswidth -= 2; + thisheight -= 2; + /* * Chris: I am here "filling in" for the additions * and substractions done in the previous if (text->editing). @@ -1305,8 +1300,9 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, */ gtk_paint_focus (widget->style, drawable, GTK_STATE_NORMAL, NULL, widget, "entry", - thisx, thisy, thiswidth - 1, thisheight - 1); + thisx, thisy, thiswidth, thisheight); } +#endif } if (text->draw_background) { @@ -2063,12 +2059,18 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) focus_event = (GdkEventFocus *) event; if (focus_event->in) { start_editing (text); + text->show_cursor = FALSE; /* so we'll redraw and the cursor will be shown */ } else { e_text_stop_editing (text); if (text->timeout_id) { g_source_remove(text->timeout_id); text->timeout_id = 0; } + if (text->show_cursor || text->draw_borders) { + text->show_cursor = FALSE; + text->needs_redraw = 1; + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(text)); + } } if ( text->line_wrap ) text->needs_split_into_lines = 1; @@ -2112,8 +2114,6 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) return ret; } - else - return 0; break; case GDK_BUTTON_PRESS: /* Fall Through */ case GDK_BUTTON_RELEASE: -- cgit v1.2.3