diff options
author | Havoc Pennington <hp@redhat.com> | 2002-02-22 16:12:13 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2002-02-22 16:12:13 +0000 |
commit | 5109ff026258965af56e72a0397151335c5685e3 (patch) | |
tree | 4dbbd218753f50bd30361e4964e6a18b2cf26630 /gtk/gtktextview.c | |
parent | a07ef43710e83bcb039ff758812138c88a90f276 (diff) | |
download | gtk+-5109ff026258965af56e72a0397151335c5685e3.tar.gz |
implement more cleanly by using text_window->allocation.x/y instead of
2002-02-22 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (buffer_to_widget): implement more cleanly by
using text_window->allocation.x/y instead of recomputing it.
Fixes a bug caused by leaving out the border width here.
Diffstat (limited to 'gtk/gtktextview.c')
-rw-r--r-- | gtk/gtktextview.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index eb45173af7..6ef7ca1d55 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -43,6 +43,7 @@ #include "gtktextview.h" #include "gtkimmulticontext.h" #include "gdk/gdkkeysyms.h" +#include "gtksizegroup.h" /* FIXME http://bugzilla.gnome.org/show_bug.cgi?id=72258 */ #include "gtktextutil.h" #include "gtkwindow.h" #include <string.h> @@ -6710,33 +6711,17 @@ buffer_to_widget (GtkTextView *text_view, gint buffer_y, gint *window_x, gint *window_y) -{ - gint focus_edge_width; - gboolean interior_focus; - gint focus_width; - - gtk_widget_style_get (GTK_WIDGET (text_view), - "interior_focus", &interior_focus, - "focus_line_width", &focus_width, - NULL); - - if (interior_focus) - focus_edge_width = 0; - else - focus_edge_width = focus_width; - +{ if (window_x) { - *window_x = buffer_x - text_view->xoffset + focus_edge_width; - if (text_view->left_window) - *window_x += text_view->left_window->allocation.width; + *window_x = buffer_x - text_view->xoffset; + *window_x += text_view->text_window->allocation.x; } if (window_y) { - *window_y = buffer_y - text_view->yoffset + focus_edge_width; - if (text_view->top_window) - *window_y += text_view->top_window->allocation.height; + *window_y = buffer_y - text_view->yoffset; + *window_y += text_view->text_window->allocation.y; } } |