@@ -47,12 +47,12 @@ ColoredArea::ColoredArea(qint64 posStart, qint64 posEnd, QPen pen, QBrush backgr
4747 _areaStyle = background;
4848}
4949
50- QPen ColoredArea::fontPen ()
50+ QPen ColoredArea::fontPen () const
5151{
5252 return _fontColor;
5353}
5454
55- QColor ColoredArea::fontColor ()
55+ QColor ColoredArea::fontColor () const
5656{
5757 return _fontColor.color ();
5858}
@@ -62,12 +62,12 @@ void ColoredArea::setFontColor(QColor color)
6262 _fontColor = QPen (color);
6363}
6464
65- QColor ColoredArea::areaColor ()
65+ QColor ColoredArea::areaColor () const
6666{
6767 return _areaStyle.color ();
6868}
6969
70- QBrush ColoredArea::areaStyle ()
70+ QBrush ColoredArea::areaStyle () const
7171{
7272 return _areaStyle;
7373}
@@ -82,21 +82,21 @@ void ColoredArea::setAreaStyle(QBrush backround)
8282 _areaStyle = backround;
8383}
8484
85- qint64 ColoredArea::posStart ()
85+ qint64 ColoredArea::posStart () const
8686{
8787 return _posStart;
88- };
88+ }
8989
90- qint64 ColoredArea::posEnd ()
90+ qint64 ColoredArea::posEnd () const
9191{
9292 return _posEnd;
93- };
93+ }
9494
9595void ColoredArea::setRange (qint64 posStart, qint64 posEnd)
9696{
9797 _posStart = posStart;
9898 _posEnd = posEnd;
99- };
99+ }
100100
101101void ColoredArea::clear ()
102102{
@@ -111,7 +111,7 @@ ColorManager::ColorManager()
111111{
112112 QPalette palette = qApp->palette ();
113113 setPalette (palette);
114- };
114+ }
115115
116116void ColorManager::setPalette (const QPalette &palette)
117117{
@@ -123,7 +123,7 @@ void ColorManager::setPalette(const QPalette &palette)
123123}
124124
125125// read only, copy of relevant ColoredArea is returned: you can't change anything
126- ColoredArea ColorManager::markedArea (qint64 pos, Area area, Chunks *chunks)
126+ ColoredArea ColorManager::markedArea (qint64 pos, Area area, Chunks *chunks) const
127127{
128128 // prio 1 selection
129129 if (pos >= _selection.posStart () && pos < _selection.posEnd ())
@@ -145,9 +145,9 @@ ColoredArea ColorManager::markedArea(qint64 pos, Area area, Chunks *chunks)
145145 }
146146 // nothing found -> standard colors
147147 return this ->notMarked (area);
148- };
148+ }
149149
150- ColoredArea& ColorManager::notMarked (Area area)
150+ const ColoredArea & ColorManager::notMarked (Area area) const
151151{
152152 switch (area) {
153153 case Area::Address:
@@ -163,15 +163,25 @@ ColoredArea& ColorManager::notMarked(Area area)
163163 return _hex; // should never happen
164164}
165165
166- ColoredArea& ColorManager::selection ()
166+ const ColoredArea &ColorManager::selection () const
167+ {
168+ return _selection;
169+ }
170+
171+ ColoredArea &ColorManager::selection ()
167172{
168173 return _selection;
169- };
174+ }
175+
176+ const ColoredArea& ColorManager::highlighting () const
177+ {
178+ return _highlighting;
179+ }
170180
171181ColoredArea& ColorManager::highlighting ()
172182{
173183 return _highlighting;
174- };
184+ }
175185
176186void ColorManager::addUserArea (qint64 posStart, qint64 posEnd, QColor fontColor, QBrush areaStyle)
177187{
@@ -182,4 +192,4 @@ void ColorManager::addUserArea(qint64 posStart, qint64 posEnd, QColor fontColor,
182192void ColorManager::clearUserAreas ()
183193{
184194 _userAreas.clear ();
185- }
195+ }
0 commit comments