]> git.saurik.com Git - wxWidgets.git/commitdiff
Forgot border when reversing coordinates for RTL.
authorRobert Roebling <robert@roebling.de>
Sat, 14 Oct 2006 13:22:37 +0000 (13:22 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 14 Oct 2006 13:22:37 +0000 (13:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42003 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/win_gtk.c

index 39388f98d37054023df06214e98b83ae6156ce07..02e277c6594f5a3fa9707086f5eeef47546b2944 100644 (file)
@@ -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);