diff options
author | Neil <nyamatongwe@gmail.com> | 2018-05-22 11:52:51 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-05-22 11:52:51 +1000 |
commit | c8bb8d0fbba6d41ac0cb83a62ae805a466ce4f99 (patch) | |
tree | e8a112613c88add0aa5d3c5170db3630cdf8588c /src | |
parent | 2e2e70c7ee89b353ad0e6ef409cb9621729d72f8 (diff) | |
download | scintilla-mirror-c8bb8d0fbba6d41ac0cb83a62ae805a466ce4f99.tar.gz |
Add INDIC_GRADIENT and INDIC_GRADIENTCENTRE indicator types.
Diffstat (limited to 'src')
-rw-r--r-- | src/Indicator.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Indicator.cxx b/src/Indicator.cxx index 91f98ac58..eef4048e8 100644 --- a/src/Indicator.cxx +++ b/src/Indicator.cxx @@ -138,6 +138,27 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r rcBox.right = rc.right; surface->AlphaRectangle(rcBox, (sacDraw.style == INDIC_ROUNDBOX) ? 1 : 0, sacDraw.fore, fillAlpha, sacDraw.fore, outlineAlpha, 0); + } else if (sacDraw.style == INDIC_GRADIENT || + sacDraw.style == INDIC_GRADIENTCENTRE) { + PRectangle rcBox = rc; + rcBox.top = rcLine.top + 1; + rcBox.bottom = rcLine.bottom; + const Surface::GradientOptions options = Surface::GradientOptions::topToBottom; + const ColourAlpha start(sacNormal.fore, fillAlpha); + const ColourAlpha end(sacNormal.fore, 0); + std::vector<ColourStop> stops; + switch (sacDraw.style) { + case INDIC_GRADIENT: + stops.push_back(ColourStop(0.0, start)); + stops.push_back(ColourStop(1.0, end)); + break; + case INDIC_GRADIENTCENTRE: + stops.push_back(ColourStop(0.0, end)); + stops.push_back(ColourStop(0.5, start)); + stops.push_back(ColourStop(1.0, end)); + break; + } + surface->GradientRectangle(rcBox, stops, options); } else if (sacDraw.style == INDIC_DOTBOX) { PRectangle rcBox = PixelGridAlign(rc); rcBox.top = rcLine.top + 1; |