+2006-07-19 Kristian Rietveld <kris@imendio.com>
+
+ * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_init),
+ (gtk_cell_renderer_text_[gs]et_property), (get_layout): add
+ align_set field to keep track whether the align property was
+ set by the user, if not we will use the alignment by looking
+ at the direction of the widget. (#157439)
+
2006-07-19 Matthias Clasen <mclasen@redhat.com>
* modules/printbackends/file/gtkprintbackendfile.c
+2006-07-19 Kristian Rietveld <kris@imendio.com>
+
+ * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_init),
+ (gtk_cell_renderer_text_[gs]et_property), (get_layout): add
+ align_set field to keep track whether the align property was
+ set by the user, if not we will use the alignment by looking
+ at the direction of the widget. (#157439)
+
2006-07-19 Matthias Clasen <mclasen@redhat.com>
* modules/printbackends/file/gtkprintbackendfile.c
guint language_set : 1;
guint markup_set : 1;
guint ellipsize_set : 1;
+ guint align_set : 1;
gulong focus_out_id;
PangoLanguage *language;
priv->width_chars = -1;
priv->wrap_width = -1;
priv->align = PANGO_ALIGN_LEFT;
+ priv->align_set = FALSE;
}
static void
case PROP_ALIGN:
priv->align = g_value_get_enum (value);
+ priv->align_set = TRUE;
break;
case PROP_BACKGROUND_SET:
pango_layout_set_wrap (layout, PANGO_WRAP_CHAR);
}
- pango_layout_set_alignment (layout, priv->align);
+ if (priv->align_set)
+ pango_layout_set_alignment (layout, priv->align);
+ else
+ {
+ PangoAlignment align;
+
+ if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
+ align = PANGO_ALIGN_RIGHT;
+ else
+ align = PANGO_ALIGN_LEFT;
+
+ pango_layout_set_alignment (layout, align);
+ }
pango_layout_set_attributes (layout, attr_list);