aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/ScintillaDoc.html15
-rw-r--r--include/Scintilla.h2
-rw-r--r--include/Scintilla.iface6
-rw-r--r--src/Editor.cxx10
-rw-r--r--src/Indicator.cxx2
-rw-r--r--src/Indicator.h3
6 files changed, 35 insertions, 3 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index ffa409f71..c56669ba3 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -3022,6 +3022,10 @@ struct TextToFind {
<a class="message" href="#SCI_INDICSETFORE">SCI_INDICSETFORE(int indicatorNumber, int
colour)</a><br />
<a class="message" href="#SCI_INDICGETFORE">SCI_INDICGETFORE(int indicatorNumber)</a><br />
+ <a class="message" href="#SCI_INDICSETALPHA">SCI_INDICSETALPHA(int indicatorNumber, int alpha)</a><br />
+ <a class="message" href="#SCI_INDICGETALPHA">SCI_INDICGETALPHA(int indicatorNumber)</a><br />
+ <a class="message" href="#SCI_INDICSETUNDER">SCI_INDICSETUNDER(int indicatorNumber, bool under)</a><br />
+ <a class="message" href="#SCI_INDICGETUNDER">SCI_INDICGETUNDER(int indicatorNumber)</a><br />
</code>
<p><b id="SCI_INDICSETSTYLE">SCI_INDICSETSTYLE(int indicatorNumber, int
@@ -3104,7 +3108,9 @@ struct TextToFind {
<td align="center">7</td>
<td>A rectangle with rounded corners around the text using translucent drawing with the
- interior more transparent than the border.</td>
+ interior more transparent than the border. You can use
+ <a class="message" href="#SCI_INDICSETALPHA">SCI_INDICSETALPHA</a>
+ to control the alpha transparency value. The default alpha value is 30.
</tr>
</tbody>
</table>
@@ -3123,6 +3129,13 @@ struct TextToFind {
<code>SCI_INDICSETFORE(1, 0xff0000);</code> (light blue)<br />
<code>SCI_INDICSETFORE(2, 0x0000ff);</code> (light red)</p>
+ <p><b id="SCI_INDICSETALPHA">SCI_INDICSETALPHA(int indicatorNumber, int alpha)</b><br />
+ <b id="SCI_INDICGETALPHA">SCI_INDICGETALPHA(int indicatorNumber)</b><br />
+ These two messages set and get the alpha transparency used for drawing the
+ fill color of the INDIC_ROUNDBOX rectangle. The alpha value can range from
+ 0 (completely transparent) to 100 (no transparency).
+ </p>
+
<p><b id="SCI_INDICSETUNDER">SCI_INDICSETUNDER(int indicatorNumber, bool under)</b><br />
<b id="SCI_INDICGETUNDER">SCI_INDICGETUNDER(int indicatorNumber)</b><br />
These two messages set and get whether an indicator is drawn under text or over(default).
diff --git a/include/Scintilla.h b/include/Scintilla.h
index c4188337e..fa28c1dbc 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -671,6 +671,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_GETCHARACTERPOINTER 2520
#define SCI_SETKEYSUNICODE 2521
#define SCI_GETKEYSUNICODE 2522
+#define SCI_INDICSETALPHA 2523
+#define SCI_INDICGETALPHA 2524
#define SCI_STARTRECORD 3001
#define SCI_STOPRECORD 3002
#define SCI_SETLEXER 4001
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 73783f6ba..21e3d719e 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -1810,6 +1810,12 @@ set void SetKeysUnicode=2521(bool keysUnicode,)
# Are keys always interpreted as Unicode?
get bool GetKeysUnicode=2522(,)
+# Set the alpha fill colour of the given indicator.
+set void IndicSetAlpha=2523(int indicator, int alpha)
+
+# Get the alpha fill colour of the given indicator.
+get int IndicGetAlpha=2524(int indicator,)
+
# Start notifying the container of all key presses and commands.
fun void StartRecord=3001(,)
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 8910a5b53..c4c3a8179 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -7229,6 +7229,16 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_INDICGETUNDER:
return (wParam <= INDIC_MAX) ? vs.indicators[wParam].under : 0;
+ case SCI_INDICSETALPHA:
+ if (wParam <= INDIC_MAX && lParam >=0 && lParam <= 100) {
+ vs.indicators[wParam].fillAlpha = lParam;
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_INDICGETALPHA:
+ return (wParam <= INDIC_MAX) ? vs.indicators[wParam].fillAlpha : 0;
+
case SCI_SETINDICATORCURRENT:
pdoc->decorations.SetCurrentIndicator(wParam);
break;
diff --git a/src/Indicator.cxx b/src/Indicator.cxx
index 139e2b0ea..da9531224 100644
--- a/src/Indicator.cxx
+++ b/src/Indicator.cxx
@@ -72,7 +72,7 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r
rcBox.top = rcLine.top + 1;
rcBox.left = rc.left;
rcBox.right = rc.right;
- surface->AlphaRectangle(rcBox, 1, fore.allocated, 30, fore.allocated, 50, 0);
+ surface->AlphaRectangle(rcBox, 1, fore.allocated, fillAlpha, fore.allocated, 50, 0);
} else { // Either INDIC_PLAIN or unknown
surface->MoveTo(rc.left, ymid);
surface->LineTo(rc.right, ymid);
diff --git a/src/Indicator.h b/src/Indicator.h
index 2081db544..42b56f07e 100644
--- a/src/Indicator.h
+++ b/src/Indicator.h
@@ -19,7 +19,8 @@ public:
int style;
bool under;
ColourPair fore;
- Indicator() : style(INDIC_PLAIN), under(false), fore(ColourDesired(0,0,0)) {
+ int fillAlpha;
+ Indicator() : style(INDIC_PLAIN), under(false), fore(ColourDesired(0,0,0)), fillAlpha(30) {
}
void Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine);
};