aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx16
-rw-r--r--src/Editor.h1
-rw-r--r--src/ViewStyle.cxx3
-rw-r--r--src/ViewStyle.h1
4 files changed, 17 insertions, 4 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 487a4c4f7..3f721d57e 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -61,7 +61,8 @@ Editor::Editor() {
selType = selStream;
xStartSelect = 0;
xEndSelect = 0;
-
+ primarySelection = true;
+
caretPolicy = CARET_SLOP;
caretSlop = 0;
@@ -842,8 +843,12 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
Font &textFont = vsDraw.styles[styleMain].font;
bool inSelection = (iDoc >= ll.selStart) && (iDoc < ll.selEnd) && (ll.selStart != ll.selEnd);
if (inSelection) {
- if (vsDraw.selbackset)
- textBack = vsDraw.selbackground.allocated;
+ if (vsDraw.selbackset) {
+ if (primarySelection)
+ textBack = vsDraw.selbackground.allocated;
+ else
+ textBack = vsDraw.selbackground2.allocated;
+ }
if (vsDraw.selforeset)
textFore = vsDraw.selforeground.allocated;
} else {
@@ -981,7 +986,10 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
rcSegment.right = xEol + vsDraw.aveCharWidth + xStart;
bool eolInSelection = (posLineEnd > ll.selStart) && (posLineEnd <= ll.selEnd) && (ll.selStart != ll.selEnd);
if (eolInSelection && vsDraw.selbackset && (line < pdoc->LinesTotal()-1)) {
- surface->FillRectangle(rcSegment, vsDraw.selbackground.allocated);
+ if (primarySelection)
+ surface->FillRectangle(rcSegment, vsDraw.selbackground.allocated);
+ else
+ surface->FillRectangle(rcSegment, vsDraw.selbackground2.allocated);
} else if (marks) {
surface->FillRectangle(rcSegment, markBack);
} else {
diff --git a/src/Editor.h b/src/Editor.h
index 4f42c80a0..fb5ac9d8b 100644
--- a/src/Editor.h
+++ b/src/Editor.h
@@ -123,6 +123,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
enum { selStream, selRectangle, selRectangleFixed } selType;
int xStartSelect;
int xEndSelect;
+ bool primarySelection;
int caretPolicy;
int caretSlop;
diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx
index da35a23fc..fae8eb53b 100644
--- a/src/ViewStyle.cxx
+++ b/src/ViewStyle.cxx
@@ -69,6 +69,7 @@ ViewStyle::ViewStyle(const ViewStyle &source) {
selforeground.desired = source.selforeground.desired;
selbackset = source.selbackset;
selbackground.desired = source.selbackground.desired;
+ selbackground2.desired = source.selbackground2.desired;
selbar.desired = source.selbar.desired;
selbarlight.desired = source.selbarlight.desired;
caretcolour.desired = source.caretcolour.desired;
@@ -113,6 +114,7 @@ void ViewStyle::Init() {
selforeground.desired = Colour(0xff, 0, 0);
selbackset = true;
selbackground.desired = Colour(0xc0, 0xc0, 0xc0);
+ selbackground2.desired = Colour(0xb0, 0xb0, 0xb0);
selbar.desired = Platform::Chrome();
selbarlight.desired = Platform::ChromeHighlight();
styles[STYLE_LINENUMBER].fore.desired = Colour(0, 0, 0);
@@ -166,6 +168,7 @@ void ViewStyle::RefreshColourPalette(Palette &pal, bool want) {
}
pal.WantFind(selforeground, want);
pal.WantFind(selbackground, want);
+ pal.WantFind(selbackground2, want);
pal.WantFind(selbar, want);
pal.WantFind(selbarlight, want);
pal.WantFind(caretcolour, want);
diff --git a/src/ViewStyle.h b/src/ViewStyle.h
index 68e59d29e..5b0ab1925 100644
--- a/src/ViewStyle.h
+++ b/src/ViewStyle.h
@@ -42,6 +42,7 @@ public:
ColourPair selforeground;
bool selbackset;
ColourPair selbackground;
+ ColourPair selbackground2;
ColourPair selbar;
ColourPair selbarlight;
// Margins are ordered: Line Numbers, Selection Margin, Spacing Margin