]> Pileus Git - ~andy/gtk/commitdiff
combobox: fix dropdown menu alignment for RTL languages
authorCosimo Cecchi <cosimoc@gnome.org>
Wed, 1 Feb 2012 00:09:24 +0000 (19:09 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Wed, 1 Feb 2012 01:30:43 +0000 (20:30 -0500)
We need to add in the left padding, instead of subtracting it in that
case.

gtk/gtkcombobox.c

index 9b222bbcbe038efffe5bb57c8d1a98fad3b8dc39..a69489c193ff3167754b258ec256b5ea76a47718 100644 (file)
@@ -1883,7 +1883,11 @@ gtk_combo_box_menu_position_below (GtkMenu  *menu,
   gdk_window_get_root_coords (gtk_widget_get_window (child),
                               sx, sy, &sx, &sy);
   get_widget_padding_and_border (GTK_WIDGET (combo_box), &padding);
-  sx -= padding.left;
+
+  if (gtk_widget_get_direction (GTK_WIDGET (combo_box)) == GTK_TEXT_DIR_RTL)
+    sx += padding.left;
+  else
+    sx -= padding.left;
 
   if (combo_box->priv->popup_fixed_width)
     gtk_widget_get_preferred_size (GTK_WIDGET (menu), &req, NULL);