aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Indicator.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-05-22 11:52:51 +1000
committerNeil <nyamatongwe@gmail.com>2018-05-22 11:52:51 +1000
commitd08e0385d664dd33aeee88794fd065e3696cb435 (patch)
tree72c9b3156578b0ef6b9db7089169a6f0a2b29b26 /src/Indicator.cxx
parentfba451a1d76be9b6945c9d5d7e219f7d7d1a4260 (diff)
downloadscintilla-mirror-d08e0385d664dd33aeee88794fd065e3696cb435.tar.gz
Backport: Add INDIC_GRADIENT and INDIC_GRADIENTCENTRE indicator types.
Backport of changeset 6966:872900d3ceb0.
Diffstat (limited to 'src/Indicator.cxx')
-rw-r--r--src/Indicator.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Indicator.cxx b/src/Indicator.cxx
index 35b2c3e5b..224083c31 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;