]> 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 6661e7ff53f259fb7be6edb4bc7c1521a51c1dcd..2c8c94ee1e4a269ad02aa70eb7ead03b8ff97330 100644 (file)
@@ -46,7 +46,9 @@ public:
     virtual void DrawHeaderButton(wxWindow *win,
                                   wxDC& dc,
                                   const wxRect& rect,
-                                  int flags = 0);
+                                  int flags = 0,
+                                  wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE,
+                                  wxHeaderButtonParams* params = NULL);
 
     // draw the expanded/collapsed icon for a tree control item
     virtual void DrawTreeItemButton(wxWindow *win,
@@ -183,11 +185,17 @@ void
 wxRendererGTK::DrawHeaderButton(wxWindow *win,
                                 wxDC& dc,
                                 const wxRect& rect,
-                                int flags)
+                                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,
@@ -199,8 +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, sortArrow, params);
 }
 
 // draw a ">" or "v" button
@@ -216,6 +226,10 @@ wxRendererGTK::DrawTreeItemButton(wxWindow* win,
     else
         state = GTK_STATE_NORMAL;
 
+    int x_diff = 0;
+    if (win->GetLayoutDirection() == wxLayout_RightToLeft)
+        x_diff = rect.width;
+        
     // VZ: I don't know how to get the size of the expander so as to centre it
     //     in the given rectangle, +2/3 below is just what looks good here...
     gtk_paint_expander
@@ -226,7 +240,7 @@ wxRendererGTK::DrawTreeItemButton(wxWindow* win,
         NULL,
         tree,
         "treeview",
-        dc.LogicalToDeviceX(rect.x) + 2,
+        dc.LogicalToDeviceX(rect.x) + 2 - x_diff,
         dc.LogicalToDeviceY(rect.y) + 3,
         flags & wxCONTROL_EXPANDED ? GTK_EXPANDER_EXPANDED
                                    : GTK_EXPANDER_COLLAPSED