]> Pileus Git - ~andy/gtk/commitdiff
Create new PangoContexts and set them on the layout, to catch changes in
authorMatthias Clasen <mclasen@redhat.com>
Sun, 6 Aug 2006 03:15:52 +0000 (03:15 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 6 Aug 2006 03:15:52 +0000 (03:15 +0000)
2006-08-05  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtktextview.c (gtk_text_view_style_set): Create new
PangoContexts and set them on the layout, to catch changes in
font options.  (#348278, Behdad Esfahbod)

ChangeLog
ChangeLog.pre-2-10
gtk/gtktextview.c

index cfee20ec5fc268c61d5b98b2dddb28f73d6ed077..782c5926cbd7dc309985cebef6c8bb9a771d6ae7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-08-05  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtktextview.c (gtk_text_view_style_set): Create new
+       PangoContexts and set them on the layout, to catch changes in
+       font options.  (#348278, Behdad Esfahbod)
+
        * gtk/gtkstyle.c (gtk_default_draw_flat_box): Add a 
        missing initialization.  (#349863, Benjamin Berg)
 
index cfee20ec5fc268c61d5b98b2dddb28f73d6ed077..782c5926cbd7dc309985cebef6c8bb9a771d6ae7 100644 (file)
@@ -1,5 +1,9 @@
 2006-08-05  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtktextview.c (gtk_text_view_style_set): Create new
+       PangoContexts and set them on the layout, to catch changes in
+       font options.  (#348278, Behdad Esfahbod)
+
        * gtk/gtkstyle.c (gtk_default_draw_flat_box): Add a 
        missing initialization.  (#349863, Benjamin Berg)
 
index 66232ca4da026cfc3c4ff78a9fa7745ce73aa97a..fa2986eeb1e3e537bf1d12916cba0294d05f87b6 100644 (file)
@@ -3584,6 +3584,7 @@ gtk_text_view_style_set (GtkWidget *widget,
                          GtkStyle  *previous_style)
 {
   GtkTextView *text_view = GTK_TEXT_VIEW (widget);
+  PangoContext *ltr_context, *rtl_context;
 
   if (GTK_WIDGET_REALIZED (widget))
     {
@@ -3595,7 +3596,17 @@ gtk_text_view_style_set (GtkWidget *widget,
       gtk_text_view_set_attributes_from_style (text_view,
                                                text_view->layout->default_style,
                                                widget->style);
-      gtk_text_layout_default_style_changed (text_view->layout);
+      
+      
+      ltr_context = gtk_widget_create_pango_context (widget);
+      pango_context_set_base_dir (ltr_context, PANGO_DIRECTION_LTR);
+      rtl_context = gtk_widget_create_pango_context (widget);
+      pango_context_set_base_dir (rtl_context, PANGO_DIRECTION_RTL);
+
+      gtk_text_layout_set_contexts (text_view->layout, ltr_context, rtl_context);
+
+      g_object_unref (ltr_context);
+      g_object_unref (rtl_context);
     }
 }
 
@@ -3608,6 +3619,7 @@ gtk_text_view_direction_changed (GtkWidget        *widget,
   if (text_view->layout)
     {
       text_view->layout->default_style->direction = gtk_widget_get_direction (widget);
+
       gtk_text_layout_default_style_changed (text_view->layout);
     }
 }