]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/window.cpp
vertically centered miniframe close button
[wxWidgets.git] / src / gtk / window.cpp
index d986f1f4a658101219d9d4c66073de5373879135..6ed4187ebaa2f1259e0aa806c4b3f876b820bdb4 100644 (file)
@@ -4235,6 +4235,28 @@ void wxWindowGTK::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
         gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy );
 
     m_clipPaintRegion = false;
+
+#if wxUSE_CARET
+    bool restoreCaret = (GetCaret() != NULL && GetCaret()->IsVisible());
+    if (restoreCaret)
+    {
+        wxRect caretRect(GetCaret()->GetPosition(), GetCaret()->GetSize());
+        if (dx > 0)
+            caretRect.width += dx;
+        else
+       {
+            caretRect.x += dx; caretRect.width -= dx;
+       }
+        if (dy > 0)
+            caretRect.height += dy;
+        else
+       {
+            caretRect.y += dy; caretRect.height -= dy;
+       }
+     
+        RefreshRect(caretRect);
+    }
+#endif
 }
 
 void wxWindowGTK::GtkScrolledWindowSetBorder(GtkWidget* w, int wxstyle)