fix drawing bugs, and disable the stupid looking focus rect, since I can't
2003-03-07 Chris Toshok <toshok@ximian.com> * 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
This commit is contained in:
committed by
Chris Toshok
parent
518cb00c28
commit
c8a10fa6da
@ -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:
|
||||
|
||||
Reference in New Issue
Block a user