[gtk+/wip/combobox-css-cleanups: 11/12] combobox: fix dropdown menu alignment for RTL languages



commit aa16f469bcc655f105c2c05316c70feed1072dd5
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Jan 31 19:09:24 2012 -0500

    combobox: fix dropdown menu alignment for RTL languages
    
    We need to add in the left padding, instead of subtracting it in that
    case.

 gtk/gtkcombobox.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 9b222bb..a69489c 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -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);



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