[gtksourceview] Use new GtkScrollable interface
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] Use new GtkScrollable interface
- Date: Sat, 23 Oct 2010 15:13:34 +0000 (UTC)
commit f00362880dd4307df7e29a4591bac4614821fa7d
Author: Paolo Borelli <pborelli gnome org>
Date: Sat Oct 23 17:14:29 2010 +0200
Use new GtkScrollable interface
configure.ac | 2 +-
gtksourceview/gtksourceview.c | 10 ++++++++--
2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index d69cf02..ad974f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,7 +30,7 @@ LT_INIT([disable-static])
AC_CHECK_HEADERS([unistd.h])
# Dependencies
-GTK_REQUIRED_VERSION=2.91.0
+GTK_REQUIRED_VERSION=2.91.2
LIBXML_REQUIRED_VERSION=2.6.0
GLADE_UI_REQUIRED=3.2
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 2c0614b..3752604 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -1912,7 +1912,7 @@ scroll_to_insert (GtkSourceView *view,
* _scroll_to_iter will cause it to move and the
* insert mark is already visible vertically. */
- adjustment = gtk_text_view_get_vadjustment (GTK_TEXT_VIEW (view));
+ adjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (view));
position = gtk_adjustment_get_value (adjustment);
/* Must use _to_iter as _to_mark scrolls in an
@@ -2412,7 +2412,7 @@ gtk_source_view_paint_line_background (GtkTextView *text_view,
GdkRectangle line_rect;
gint win_y;
gint margin;
- GtkAdjustment *hadjustment = gtk_text_view_get_hadjustment (text_view);
+ GtkAdjustment *hadjustment;
gtk_text_view_get_visible_rect (text_view, &visible_rect);
@@ -2428,11 +2428,17 @@ gtk_source_view_paint_line_background (GtkTextView *text_view,
line_rect.y = win_y;
line_rect.height = height;
+ hadjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (text_view));
+
if (hadjustment)
+ {
margin = gtk_text_view_get_left_margin (text_view) -
(int) gtk_adjustment_get_value (hadjustment);
+ }
else
+ {
margin = gtk_text_view_get_left_margin (text_view);
+ }
line_rect.x += MAX (0, margin - 1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]