diff --git a/uppsrc/CtrlLib/RichText.h b/uppsrc/CtrlLib/RichText.h index 8719efa3b..4f667aafe 100644 --- a/uppsrc/CtrlLib/RichText.h +++ b/uppsrc/CtrlLib/RichText.h @@ -18,6 +18,7 @@ public: private: Rect margin; Color background; + Color textcolor; Zoom zoom; int cx; ScrollBar sb; @@ -89,6 +90,7 @@ public: RichTextView& PageWidth(int cx); RichTextView& SetZoom(Zoom z); RichTextView& Background(Color _color); + RichTextView& TextColor(Color _color); RichTextView& VCenter(bool b = true); RichTextView& NoVCenter() { return VCenter(false); } RichTextView& Margins(const Rect& m); diff --git a/uppsrc/CtrlLib/RichTextView.cpp b/uppsrc/CtrlLib/RichTextView.cpp index 790b93dee..e1918fa0a 100644 --- a/uppsrc/CtrlLib/RichTextView.cpp +++ b/uppsrc/CtrlLib/RichTextView.cpp @@ -26,6 +26,7 @@ void RichTextView::Paint(Draw& w) pi.indexentry = Null; pi.highlightpara = highlight; pi.zoom = GetZoom(); + pi.textcolor = textcolor; int q = sb * pi.zoom; scroller.Set(q); w.Offset(0, -q); @@ -372,6 +373,13 @@ RichTextView& RichTextView::Background(Color c) return *this; } +RichTextView& RichTextView::TextColor(Color _color) +{ + textcolor = _color; + Refresh(); + return *this; +} + RichTextView& RichTextView::VCenter(bool b) { vcenter = b; @@ -416,6 +424,7 @@ RichTextView::RichTextView() sb.WhenScroll = THISBACK(Scroll); zoom = Null; background = SColorPaper; + textcolor = Null; vcenter = false; margin = Rect(0, 0, 0, 0); highlight = -1;