diff options
author | Yair Hershkovitz <yairhr@gmail.com> | 2008-09-06 21:31:30 +0000 |
---|---|---|
committer | Yair Hershkovitz <yairhr@src.gnome.org> | 2008-09-06 21:31:30 +0000 |
commit | 0816ffe74277ccf60e340850f5ced05b70f91c23 (patch) | |
tree | 414d29f0d77d4718f9b92514be33d24f659159a5 /gtk/gtkcalendar.c | |
parent | ad7880a590742646ecc1c870a9fc935318a9b174 (diff) | |
download | gtk+-0816ffe74277ccf60e340850f5ced05b70f91c23.tar.gz |
Bug 319849 - gtkcalendar look in RTL locales
2008-09-07 Yair Hershkovitz <yairhr@gmail.com>
Bug 319849 - gtkcalendar look in RTL locales
* gtk/gtkcalendar.c (calendar_realize_week_numbers),
(gtk_calendar_realize): added missing RTL code to handle week numbers
from gtk_calendar_size_alloc.
svn path=/trunk/; revision=21306
Diffstat (limited to 'gtk/gtkcalendar.c')
-rw-r--r-- | gtk/gtkcalendar.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index 964b4bcbbd..cf06ed6086 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -1542,7 +1542,10 @@ calendar_realize_week_numbers (GtkCalendar *calendar) attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; - attributes.x = widget->style->xthickness + INNER_BORDER; + if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) + attributes.x = widget->style->xthickness + INNER_BORDER; + else + attributes.x = widget->allocation.width - priv->week_width - (widget->style->xthickness + INNER_BORDER); attributes.y = (priv->header_h + priv->day_name_h + (widget->style->ythickness + INNER_BORDER)); attributes.width = priv->week_width; @@ -1598,11 +1601,18 @@ gtk_calendar_realize (GtkWidget *widget) | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK); - attributes.x = priv->week_width + (widget->style->ythickness + INNER_BORDER); + if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) + attributes.x = priv->week_width + (widget->style->ythickness + INNER_BORDER); + else + attributes.x = widget->style->ythickness + INNER_BORDER; + attributes.y = (priv->header_h + priv->day_name_h + (widget->style->ythickness + INNER_BORDER)); attributes.width = (widget->allocation.width - attributes.x - (widget->style->xthickness + INNER_BORDER)); + if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) + attributes.width -= priv->week_width; + attributes.height = priv->main_h; priv->main_win = gdk_window_new (widget->window, &attributes, attributes_mask); |