From e3cc6be8d4b82f65c747ffba1f1c193714de644a Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Thu, 13 Jul 2000 05:42:06 +0000 Subject: Showing selection in grey when its not the primary selection on GTK+. --- src/Editor.cxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/Editor.cxx') 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 { -- cgit v1.2.3