diff options
| -rw-r--r-- | doc/Indicators.png | bin | 11206 -> 13819 bytes | |||
| -rw-r--r-- | doc/ScintillaDoc.html | 17 | ||||
| -rw-r--r-- | doc/ScintillaHistory.html | 9 | ||||
| -rw-r--r-- | include/Scintilla.h | 2 | ||||
| -rw-r--r-- | include/Scintilla.iface | 2 | ||||
| -rw-r--r-- | src/Indicator.cxx | 21 | 
6 files changed, 50 insertions, 1 deletions
| diff --git a/doc/Indicators.png b/doc/Indicators.pngBinary files differ index a1f68679a..541e3de62 100644 --- a/doc/Indicators.png +++ b/doc/Indicators.png diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 98c8df2a1..1aa57ef70 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -4470,6 +4470,23 @@ struct Sci_TextToFind {          </tr>          <tr> +          <td align="left"><code>INDIC_GRADIENT</code></td> + +          <td align="center">20</td> + +          <td>A vertical gradient between a colour and alpha at top to fully transparent at bottom.</td> +        </tr> + +        <tr> +          <td align="left"><code>INDIC_GRADIENTCENTRE</code></td> + +          <td align="center">21</td> + +          <td>A vertical gradient with the specified colour and alpha in the middle +          fading to fully transparent at top and bottom.</td> +        </tr> + +        <tr>            <td align="left"><code>INDIC_SQUIGGLEPIXMAP</code></td>            <td align="center">13</td> diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 030a6de53..7af06afcc 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -538,13 +538,20 @@        </li>      </ul>      <h3> -       <a href="https://www.scintilla.org/scite406.zip">Release 4.0.6</a> +       <a href="https://www.scintilla.org/scite410.zip">Release 4.1.0</a>      </h3>      <ul>  	<li>  	Released 10 May 2018.  	</li>  	<li> +	INDIC_GRADIENT and INDIC_GRADIENTCENTRE indicator types added. +	INDIC_GRADIENT starts with a specified colour and alpha at top of line and fades +	to fully transparent at bottom. +	INDIC_GRADIENTCENTRE starts with a specified colour and alpha at centre of line and fades +	to fully transparent at top and bottom. +	</li> +	<li>  	Indicators are drawn for line end characters when displayed.  	</li>  	<li> diff --git a/include/Scintilla.h b/include/Scintilla.h index df059e68d..58f58f43f 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -288,6 +288,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,  #define INDIC_TEXTFORE 17  #define INDIC_POINT 18  #define INDIC_POINTCHARACTER 19 +#define INDIC_GRADIENT 20 +#define INDIC_GRADIENTCENTRE 21  #define INDIC_IME 32  #define INDIC_IME_MAX 35  #define INDIC_MAX 35 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index 33f16e7bd..f211f852a 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -639,6 +639,8 @@ val INDIC_FULLBOX=16  val INDIC_TEXTFORE=17  val INDIC_POINT=18  val INDIC_POINTCHARACTER=19 +val INDIC_GRADIENT=20 +val INDIC_GRADIENTCENTRE=21  val INDIC_IME=32  val INDIC_IME_MAX=35  val INDIC_MAX=35 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; | 
