X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-scroll-text.c;h=a2b2c939636b1578005551340de6c33a7bdd18c7;hp=25f64265c324139486032602274c5c8c590b2fc9;hb=f6d386ff93e929092ba105385a29d760aeba9ff7;hpb=326ddf804e1bc2542650028660f4eb5cc82af96a diff --git a/src/widgets/modest-scroll-text.c b/src/widgets/modest-scroll-text.c index 25f6426..a2b2c93 100644 --- a/src/widgets/modest-scroll-text.c +++ b/src/widgets/modest-scroll-text.c @@ -97,14 +97,12 @@ size_request (GtkWidget *widget, /* Count lines in text view */ for (line = 0; line < line_limit; line++) { - if (!gtk_text_view_forward_display_line (GTK_TEXT_VIEW (text_view), &iter)) + if (!gtk_text_view_forward_display_line_end (GTK_TEXT_VIEW (text_view), &iter)) break; + else + gtk_text_view_forward_display_line (GTK_TEXT_VIEW (text_view), &iter); } - /* Put again the cursor in the first character. Also scroll to first line */ - gtk_text_buffer_place_cursor (buffer, &insert_iter); - gtk_text_view_place_cursor_onscreen (GTK_TEXT_VIEW (text_view)); - /* Change the adjustment properties for one line per step behavior */ adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (widget)); if (adj != NULL) { @@ -125,6 +123,10 @@ size_request (GtkWidget *widget, priv->line_height = iter_rectangle.height; + /* Put again the cursor in the first character. Also scroll to first line */ + gtk_text_buffer_place_cursor (buffer, &insert_iter); + gtk_text_view_scroll_mark_onscreen (GTK_TEXT_VIEW (text_view), insert_mark); + } static void