diff options
author | Matthias Clasen <mclasen@redhat.com> | 2012-09-21 23:53:11 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2012-09-21 23:53:11 -0400 |
commit | d03ceb8b2c61ada3e39c0cd76bde6c8c28a91658 (patch) | |
tree | 3f5a36210ec6c2fa9554b185185dc8546654d68b /gtk/gtkmenubutton.c | |
parent | 72d8deb606404477ab37f554a493f29fbab52469 (diff) | |
download | gtk+-d03ceb8b2c61ada3e39c0cd76bde6c8c28a91658.tar.gz |
GtkMenuButton: improve rtl support
Show the menu at the side the arrow points to,
also in rtl locales.
https://bugzilla.gnome.org/show_bug.cgi?id=684606
Diffstat (limited to 'gtk/gtkmenubutton.c')
-rw-r--r-- | gtk/gtkmenubutton.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c index 0edd78b7ca..051b9da864 100644 --- a/gtk/gtkmenubutton.c +++ b/gtk/gtkmenubutton.c @@ -336,12 +336,14 @@ menu_position_side_func (GtkMenu *menu, GdkScreen *screen; GdkWindow *window; GtkAlign align; + GtkTextDirection direction; gtk_widget_get_preferred_size (GTK_WIDGET (priv->popup), &menu_req, NULL); window = gtk_widget_get_window (widget); + direction = gtk_widget_get_direction (widget); align = gtk_widget_get_valign (GTK_WIDGET (menu)); screen = gtk_widget_get_screen (GTK_WIDGET (menu)); monitor_num = gdk_screen_get_monitor_at_window (screen, window); @@ -353,7 +355,9 @@ menu_position_side_func (GtkMenu *menu, gtk_widget_get_allocation (widget, &allocation); - if (priv->arrow_type == GTK_ARROW_RIGHT) + if ((priv->arrow_type == GTK_ARROW_RIGHT && direction == GTK_TEXT_DIR_LTR) || + (priv->arrow_type == GTK_ARROW_LEFT && direction == GTK_TEXT_DIR_RTL)) + { if (*x + allocation.width + menu_req.width <= monitor.x + monitor.width) *x += allocation.width; |