aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2009-07-12 02:20:47 +0000
committernyamatongwe <unknown>2009-07-12 02:20:47 +0000
commit8bf93b50f043fc9e6d52ce07105f7b4dcd11687a (patch)
treeef6396e0715523878c30ee4eddb75154011c949c
parent339e18e1dfc8b2d0e1ac6683c0c93012cf53cac4 (diff)
downloadscintilla-mirror-8bf93b50f043fc9e6d52ce07105f7b4dcd11687a.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.
-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;