gtk+ r21364 - in branches/gtk-2-12: . gtk



Author: matthiasc
Date: Fri Sep 12 04:11:20 2008
New Revision: 21364
URL: http://svn.gnome.org/viewvc/gtk+?rev=21364&view=rev

Log:
        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. Patch by Yair Hershkovitz




Modified:
   branches/gtk-2-12/ChangeLog
   branches/gtk-2-12/gtk/gtkcalendar.c

Modified: branches/gtk-2-12/gtk/gtkcalendar.c
==============================================================================
--- branches/gtk-2-12/gtk/gtkcalendar.c	(original)
+++ branches/gtk-2-12/gtk/gtkcalendar.c	Fri Sep 12 04:11:20 2008
@@ -1417,7 +1417,10 @@
       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;
@@ -1473,11 +1476,18 @@
 			    | 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]