]> git.saurik.com Git - wxWidgets.git/commitdiff
Use wxRTC text colour if possible for caret
authorJulian Smart <julian@anthemion.co.uk>
Fri, 5 Jul 2013 16:26:37 +0000 (16:26 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 5 Jul 2013 16:26:37 +0000 (16:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74361 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextctrl.cpp

index 8ece5a710d7227a312fd338be5b1854447c3dde2..7657356d3527b925f81e7f5e08ea43c465d2f407 100644 (file)
@@ -4863,8 +4863,15 @@ void wxRichTextCaret::Refresh()
 
 void wxRichTextCaret::DoDraw(wxDC *dc)
 {
-    dc->SetBrush((m_hasFocus ? m_caretBrush : *wxTRANSPARENT_BRUSH));
-    dc->SetPen(m_caretPen);
+    wxBrush brush(m_caretBrush);
+    wxPen pen(m_caretPen);
+    if (m_richTextCtrl && m_richTextCtrl->GetBasicStyle().HasTextColour())
+    {
+        brush = wxBrush(m_richTextCtrl->GetBasicStyle().GetTextColour());
+        pen = wxPen(m_richTextCtrl->GetBasicStyle().GetTextColour());
+    }
+    dc->SetBrush((m_hasFocus ? brush : *wxTRANSPARENT_BRUSH));
+    dc->SetPen(pen);
 
     wxPoint pt(m_x, m_y);