From 4e705edb0910461ebe675eb57d8fd08cc94495ec Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 15 Feb 2015 23:51:05 +1100 Subject: Add SC_INDICFLAG_VALUEFORE and INDIC_TEXTFORE to allow a wide range of indicator colours and to change the colour of text. --- src/Indicator.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/Indicator.cxx') diff --git a/src/Indicator.cxx b/src/Indicator.cxx index eea5877bb..62df0b716 100644 --- a/src/Indicator.cxx +++ b/src/Indicator.cxx @@ -23,8 +23,11 @@ static PRectangle PixelGridAlign(const PRectangle &rc) { return PRectangle::FromInts(int(rc.left + 0.5), int(rc.top), int(rc.right + 0.5), int(rc.bottom)); } -void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine, DrawState drawState) const { +void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine, DrawState drawState, int value) const { StyleAndColour sacDraw = sacNormal; + if (Flags() & SC_INDICFLAG_VALUEFORE) { + sacDraw.fore = value & SC_INDICVALUEMASK; + } if (drawState == drawHover) { sacDraw = sacHover; } @@ -108,7 +111,7 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r } else if (sacDraw.style == INDIC_STRIKE) { surface->MoveTo(static_cast(rc.left), static_cast(rc.top) - 4); surface->LineTo(static_cast(rc.right), static_cast(rc.top) - 4); - } else if (sacDraw.style == INDIC_HIDDEN) { + } else if ((sacDraw.style == INDIC_HIDDEN) || (sacDraw.style == INDIC_TEXTFORE)) { // Draw nothing } else if (sacDraw.style == INDIC_BOX) { surface->MoveTo(static_cast(rc.left), ymid + 1); @@ -172,3 +175,6 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r } } +void Indicator::SetFlags(int attributes_) { + attributes = attributes_; +} -- cgit v1.2.3