aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2014-09-22 17:49:03 +1000
committerNeil <nyamatongwe@gmail.com>2014-09-22 17:49:03 +1000
commitfc18df4e0657d994445f21f2dca0168c5c4b4b52 (patch)
tree514a268aef7dacae3fb433c1ac89e39279bf3c59
parent23c0477cdd3b7eac08d7ed69806885b23ad8ab8d (diff)
downloadscintilla-mirror-fc18df4e0657d994445f21f2dca0168c5c4b4b52.tar.gz
Add a constructor that takes arguments for each attribute to make it easier to
set up indicators. Changed field order so that the colour, which is likely to be set, is before under which is likely to be left default.
-rw-r--r--src/Indicator.h7
-rw-r--r--src/ViewStyle.cxx12
2 files changed, 8 insertions, 11 deletions
diff --git a/src/Indicator.h b/src/Indicator.h
index beda8214b..96cba3c05 100644
--- a/src/Indicator.h
+++ b/src/Indicator.h
@@ -17,11 +17,14 @@ namespace Scintilla {
class Indicator {
public:
int style;
- bool under;
ColourDesired fore;
+ bool under;
int fillAlpha;
int outlineAlpha;
- Indicator() : style(INDIC_PLAIN), under(false), fore(ColourDesired(0,0,0)), fillAlpha(30), outlineAlpha(50) {
+ Indicator() : style(INDIC_PLAIN), fore(ColourDesired(0,0,0)), under(false), fillAlpha(30), outlineAlpha(50) {
+ }
+ Indicator(int style_, ColourDesired fore_=ColourDesired(0,0,0), bool under_=false, int fillAlpha_=30, int outlineAlpha_=50) :
+ style(style_), fore(fore_), under(under_), fillAlpha(fillAlpha_), outlineAlpha(outlineAlpha_) {
}
void Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine) const;
};
diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx
index e3c1d65d7..b60905caf 100644
--- a/src/ViewStyle.cxx
+++ b/src/ViewStyle.cxx
@@ -192,15 +192,9 @@ void ViewStyle::Init(size_t stylesSize_) {
// There are no image markers by default, so no need for calling CalcLargestMarkerHeight()
largestMarkerHeight = 0;
- indicators[0].style = INDIC_SQUIGGLE;
- indicators[0].under = false;
- indicators[0].fore = ColourDesired(0, 0x7f, 0);
- indicators[1].style = INDIC_TT;
- indicators[1].under = false;
- indicators[1].fore = ColourDesired(0, 0, 0xff);
- indicators[2].style = INDIC_PLAIN;
- indicators[2].under = false;
- indicators[2].fore = ColourDesired(0xff, 0, 0);
+ indicators[0] = Indicator(INDIC_SQUIGGLE, ColourDesired(0, 0x7f, 0));
+ indicators[1] = Indicator(INDIC_TT, ColourDesired(0, 0, 0xff));
+ indicators[2] = Indicator(INDIC_PLAIN, ColourDesired(0xff, 0, 0));
technology = SC_TECHNOLOGY_DEFAULT;
lineHeight = 1;