aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2009-07-12 02:20:47 +0000
committernyamatongwe <devnull@localhost>2009-07-12 02:20:47 +0000
commitd1e32126e5af8125ee993b7825e767b22dcfd162 (patch)
treeef6396e0715523878c30ee4eddb75154011c949c /src
parent1a21ea5097c2cd657b9edc16ef7379430edcd40a (diff)
downloadscintilla-mirror-d1e32126e5af8125ee993b7825e767b22dcfd162.tar.gz
Use additional selection colour for additional selections
even when window is primary. When selection alpha is set, set additional selection alpha to same value so that editors unaware of multiple selection behave OK.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 976ec0c7c..ad9437a6a 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -2122,9 +2122,9 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou
}
ColourAllocated Editor::SelectionBackground(ViewStyle &vsDraw, bool main) {
- return primarySelection ?
- (main ? vsDraw.selbackground.allocated : vsDraw.selAdditionalBackground.allocated) :
- vsDraw.selbackground2.allocated;
+ return main ?
+ (primarySelection ? vsDraw.selbackground.allocated : vsDraw.selbackground2.allocated) :
+ vsDraw.selAdditionalBackground.allocated;
}
ColourAllocated Editor::TextBackground(ViewStyle &vsDraw, bool overrideBackground,
@@ -2258,7 +2258,7 @@ void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, Lin
if (!hideSelection && ((vsDraw.selAlpha == SC_ALPHA_NOALPHA) || (vsDraw.selAdditionalAlpha == SC_ALPHA_NOALPHA))) {
SelectionSegment virtualSpaceRange(SelectionPosition(pdoc->LineEnd(line)), SelectionPosition(pdoc->LineEnd(line), sel.VirtualSpaceFor(pdoc->LineEnd(line))));
for (size_t r=0; r<sel.Count(); r++) {
- int alpha = (r == sel.Main()) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha;
+ int alpha = (r == sel.Main()) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha;
if (alpha == SC_ALPHA_NOALPHA) {
SelectionSegment portion = sel.Range(r).Intersect(virtualSpaceRange);
if (!portion.Empty()) {
@@ -2888,7 +2888,7 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
}
SelectionSegment virtualSpaceRange(SelectionPosition(posLineStart), SelectionPosition(posLineStart + lineEnd, virtualSpaces));
for (size_t r=0; r<sel.Count(); r++) {
- int alpha = (r == sel.Main()) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha;
+ int alpha = (r == sel.Main()) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha;
if (alpha != SC_ALPHA_NOALPHA) {
SelectionSegment portion = sel.Range(r).Intersect(virtualSpaceRange);
if (!portion.Empty()) {
@@ -7484,6 +7484,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_SETSELALPHA:
vs.selAlpha = wParam;
+ vs.selAdditionalAlpha = wParam;
InvalidateStyleRedraw();
break;