]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/renderer.cpp
Fix scrolling bug where client size was reported wrong
[wxWidgets.git] / src / gtk / renderer.cpp
index b5200d0d3564649a92b53b102741d35f59471feb..2c8c94ee1e4a269ad02aa70eb7ead03b8ff97330 100644 (file)
@@ -47,6 +47,7 @@ public:
                                   wxDC& dc,
                                   const wxRect& rect,
                                   int flags = 0,
+                                  wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE,
                                   wxHeaderButtonParams* params = NULL);
 
     // draw the expanded/collapsed icon for a tree control item
@@ -185,11 +186,16 @@ wxRendererGTK::DrawHeaderButton(wxWindow *win,
                                 wxDC& dc,
                                 const wxRect& rect,
                                 int flags,
+                                wxHeaderSortIconType sortArrow,
                                 wxHeaderButtonParams* params)
 {
 
     GtkWidget *button = GetButtonWidget();
 
+    int x_diff = 0;
+    if (win->GetLayoutDirection() == wxLayout_RightToLeft)
+        x_diff = rect.width;
+        
     gtk_paint_box
     (
         button->style,
@@ -201,10 +207,10 @@ wxRendererGTK::DrawHeaderButton(wxWindow *win,
         NULL,
         button,
         "button",
-        dc.LogicalToDeviceX(rect.x), rect.y, rect.width, rect.height
+        dc.LogicalToDeviceX(rect.x) - x_diff, rect.y, rect.width, rect.height
     );
 
-    DrawHeaderButtonContents(win, dc, rect, flags, params);
+    DrawHeaderButtonContents(win, dc, rect, flags, sortArrow, params);
 }
 
 // draw a ">" or "v" button