summaryrefslogtreecommitdiff
path: root/gtk/gtkimagemenuitem.c
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2002-11-02 00:18:14 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2002-11-02 00:18:14 +0000
commit00943af834ae457e5989daf7836cda0feb007544 (patch)
tree3bc4928450fd091fed2762131187556980872772 /gtk/gtkimagemenuitem.c
parentca00536f34bfbb895b8b5e01b1faf9c1c60545bf (diff)
downloadgtk+-00943af834ae457e5989daf7836cda0feb007544.tar.gz
Automatic RTL flipping for some more widgets.
Diffstat (limited to 'gtk/gtkimagemenuitem.c')
-rw-r--r--gtk/gtkimagemenuitem.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gtk/gtkimagemenuitem.c b/gtk/gtkimagemenuitem.c
index e9b923151d..f12dd540ba 100644
--- a/gtk/gtkimagemenuitem.c
+++ b/gtk/gtkimagemenuitem.c
@@ -235,7 +235,7 @@ gtk_image_menu_item_size_allocate (GtkWidget *widget,
if (image_menu_item->image)
{
- gint width, height, x, y;
+ gint width, height, x, y, offset;
GtkAllocation child_allocation;
/* Man this is lame hardcoding action, but I can't
@@ -244,10 +244,15 @@ gtk_image_menu_item_size_allocate (GtkWidget *widget,
width = image_menu_item->image->requisition.width;
height = image_menu_item->image->requisition.height;
-
- x = (GTK_CONTAINER (image_menu_item)->border_width +
- widget->style->xthickness) +
- (GTK_MENU_ITEM (image_menu_item)->toggle_size - width) / 2;
+ offset = GTK_CONTAINER (image_menu_item)->border_width +
+ widget->style->xthickness;
+
+ if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
+ x = offset + (GTK_MENU_ITEM (image_menu_item)->toggle_size - width) / 2;
+ else
+ x = widget->allocation.width -
+ GTK_MENU_ITEM (image_menu_item)->toggle_size - offset +
+ (GTK_MENU_ITEM (image_menu_item)->toggle_size - width) / 2;
y = (widget->allocation.height - height) / 2;
child_allocation.width = width;