diff options
author | Miguel de Icaza <miguel@helixcode.com> | 2000-12-25 16:20:24 +0800 |
---|---|---|
committer | Miguel de Icaza <miguel@src.gnome.org> | 2000-12-25 16:20:24 +0800 |
commit | ca925e411cff837fd52e256d768f6895940bbbcc (patch) | |
tree | c4742241ae7263da31170dd29c0d48cf4d21f6e1 /widgets/text | |
parent | ccba11c01dfd352be50aec31c1cd7030ed01ad60 (diff) | |
download | gsoc2013-evolution-ca925e411cff837fd52e256d768f6895940bbbcc.tar.gz gsoc2013-evolution-ca925e411cff837fd52e256d768f6895940bbbcc.tar.zst gsoc2013-evolution-ca925e411cff837fd52e256d768f6895940bbbcc.zip |
Made the code CanvasItem correct: the code should not draw at arbitrary
2000-12-25 Miguel de Icaza <miguel@helixcode.com>
* gal/e-text/e-text.c (e_text_draw): Made the code CanvasItem
correct: the code should not draw at arbitrary positions in the
GdkWindow, it should instead draw from item->x1, item->y1 to
item->y1, item->y2 (Chris, we need to talk about this, I think my
current fix is passable, but might not be fully correct.
Specially the interpretation of the width, height arguments).
(e_text_class_init): Fix name.
(e_text_set_arg): Use correct name.
svn path=/trunk/; revision=7163
Diffstat (limited to 'widgets/text')
-rw-r--r-- | widgets/text/e-text.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 79499c71b7..b011a492c0 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -285,7 +285,7 @@ e_text_class_init (ETextClass *klass) gtk_object_add_arg_type ("EText::allow_newlines", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_ALLOW_NEWLINES); gtk_object_add_arg_type ("EText::draw_background", - GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_DRAW_BORDERS); + GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_DRAW_BACKGROUND); if (!clipboard_atom) clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE); @@ -1288,7 +1288,7 @@ e_text_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) break; case ARG_DRAW_BACKGROUND: - if (text->draw_borders != GTK_VALUE_BOOL (*arg)){ + if (text->draw_background != GTK_VALUE_BOOL (*arg)){ text->draw_background = GTK_VALUE_BOOL (*arg); text->needs_redraw = 1; } @@ -1766,7 +1766,8 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, fg_gc = GTK_WIDGET(canvas)->style->fg_gc[text->has_selection ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE]; if (text->draw_borders || text->draw_background) { - gdouble thisx = 0, thisy = 0; + gdouble thisx = item->x1 - x; + gdouble thisy = item->y1 - y; gdouble thiswidth, thisheight; GtkWidget *widget = GTK_WIDGET(item->canvas); @@ -1775,11 +1776,13 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, "height", &thisheight, NULL); - if (text->draw_background) + if (text->draw_background){ gtk_paint_flat_box (widget->style, drawable, GTK_WIDGET_STATE(widget), GTK_SHADOW_NONE, NULL, widget, "entry_bg", - 0, 0, thiswidth, thisheight); + thisx, thisy, thiswidth, thisheight); + } + if (text->editing) { thisx += 1; thisy += 1; @@ -1794,9 +1797,16 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, thisx - x, thisy - y, thiswidth, thisheight); if (text->editing) { + /* + * Chris: I am here "filling in" for the additions + * and substractions done in the previous if (text->editing). + * but you might have other plans for this. Please enlighten + * me as to whether it should be: + * thiswidth + 2 or thiswidth + 1. + */ gtk_paint_focus (widget->style, drawable, NULL, widget, "entry", - - x, - y, thiswidth + 1, thisheight + 1); + thisx - 1, thisy - 1, thiswidth + 2, thisheight + 2); } } } |