From 39b5648ed2b396e7a7e67806dbb2d3b6452dafe6 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sat, 14 Oct 2006 13:22:37 +0000 Subject: [PATCH] Forgot border when reversing coordinates for RTL. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42003 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/win_gtk.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/gtk/win_gtk.c b/src/gtk/win_gtk.c index 39388f98d3..02e277c659 100644 --- a/src/gtk/win_gtk.c +++ b/src/gtk/win_gtk.c @@ -242,6 +242,7 @@ void gtk_pizza_set_yoffset (GtkPizza *pizza, gint yoffset) gint gtk_pizza_get_rtl_offset (GtkPizza *pizza) { gint width; + gint border; g_return_val_if_fail ( (pizza != NULL), 0 ); g_return_val_if_fail ( (GTK_IS_PIZZA (pizza)), 0 ); @@ -250,7 +251,15 @@ gint gtk_pizza_get_rtl_offset (GtkPizza *pizza) gdk_window_get_geometry( pizza->bin_window, NULL, NULL, &width, NULL, NULL ); - return width; + if (pizza->shadow_type == GTK_MYSHADOW_NONE) + border = 0; + else + if (pizza->shadow_type == GTK_MYSHADOW_THIN) + border = 1; + else + border = 2; + + return width-border*2; } @@ -737,8 +746,20 @@ gtk_pizza_allocate_child (GtkPizza *pizza, if (gtk_widget_get_direction( GTK_WIDGET(pizza) ) == GTK_TEXT_DIR_RTL) { /* reverse horizontal placement */ - /* printf( "alloc width %d\n", GTK_WIDGET(pizza)->allocation.width ); */ - allocation.x = GTK_WIDGET(pizza)->allocation.width - child->x - allocation.width - pizza->m_xoffset; + gint offset,border; + + offset = GTK_WIDGET(pizza)->allocation.width; + + if (pizza->shadow_type == GTK_MYSHADOW_NONE) + border = 0; + else + if (pizza->shadow_type == GTK_MYSHADOW_THIN) + border = 1; + else + border = 2; + offset -= border*2; + + allocation.x = offset - child->x - allocation.width - pizza->m_xoffset; } gtk_widget_size_allocate (child->widget, &allocation); -- 2.47.2