mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-22 13:24:42 +02:00
[SCINTILLA_NEW_FEATURE] Add the capacity of keeping line highlighting even when it loss its focus.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@142 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
147d885a44
commit
7d950fe5d8
@ -257,6 +257,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_GETMAXLINESTATE 2094
|
#define SCI_GETMAXLINESTATE 2094
|
||||||
#define SCI_GETCARETLINEVISIBLE 2095
|
#define SCI_GETCARETLINEVISIBLE 2095
|
||||||
#define SCI_SETCARETLINEVISIBLE 2096
|
#define SCI_SETCARETLINEVISIBLE 2096
|
||||||
|
#define SCI_GETCARETLINEVISIBLEALWAYS 3095
|
||||||
|
#define SCI_SETCARETLINEVISIBLEALWAYS 3096
|
||||||
#define SCI_GETCARETLINEBACK 2097
|
#define SCI_GETCARETLINEBACK 2097
|
||||||
#define SCI_SETCARETLINEBACK 2098
|
#define SCI_SETCARETLINEBACK 2098
|
||||||
#define SCI_STYLESETCHANGEABLE 2099
|
#define SCI_STYLESETCHANGEABLE 2099
|
||||||
|
@ -2247,7 +2247,7 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
|
|||||||
// the color for the highest numbered one is used.
|
// the color for the highest numbered one is used.
|
||||||
bool overrideBackground = false;
|
bool overrideBackground = false;
|
||||||
ColourAllocated background;
|
ColourAllocated background;
|
||||||
if (caret.active && vsDraw.showCaretLineBackground && (vsDraw.caretLineAlpha == SC_ALPHA_NOALPHA) && ll->containsCaret) {
|
if ((caret.active || vsDraw.showCaretLineBackgroundAlways) && vsDraw.showCaretLineBackground && (vsDraw.caretLineAlpha == SC_ALPHA_NOALPHA) && ll->containsCaret) {
|
||||||
overrideBackground = true;
|
overrideBackground = true;
|
||||||
background = vsDraw.caretLineBackground.allocated;
|
background = vsDraw.caretLineBackground.allocated;
|
||||||
}
|
}
|
||||||
@ -2630,7 +2630,7 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
|
|||||||
// Draw any translucent whole line states
|
// Draw any translucent whole line states
|
||||||
rcSegment.left = xStart;
|
rcSegment.left = xStart;
|
||||||
rcSegment.right = rcLine.right - 1;
|
rcSegment.right = rcLine.right - 1;
|
||||||
if (caret.active && vsDraw.showCaretLineBackground && ll->containsCaret) {
|
if ((caret.active || vsDraw.showCaretLineBackgroundAlways) && vsDraw.showCaretLineBackground && ll->containsCaret) {
|
||||||
SimpleAlphaRectangle(surface, rcSegment, vsDraw.caretLineBackground.allocated, vsDraw.caretLineAlpha);
|
SimpleAlphaRectangle(surface, rcSegment, vsDraw.caretLineBackground.allocated, vsDraw.caretLineAlpha);
|
||||||
}
|
}
|
||||||
int marks = pdoc->GetMark(line);
|
int marks = pdoc->GetMark(line);
|
||||||
@ -3174,6 +3174,7 @@ long Editor::FormatRange(bool draw, RangeToFormat *pfr) {
|
|||||||
vsPrint.whitespaceBackgroundSet = false;
|
vsPrint.whitespaceBackgroundSet = false;
|
||||||
vsPrint.whitespaceForegroundSet = false;
|
vsPrint.whitespaceForegroundSet = false;
|
||||||
vsPrint.showCaretLineBackground = false;
|
vsPrint.showCaretLineBackground = false;
|
||||||
|
vsPrint.showCaretLineBackgroundAlways = false;
|
||||||
|
|
||||||
// Set colours for printing according to users settings
|
// Set colours for printing according to users settings
|
||||||
for (size_t sty = 0;sty < vsPrint.stylesSize;sty++) {
|
for (size_t sty = 0;sty < vsPrint.stylesSize;sty++) {
|
||||||
@ -6983,6 +6984,13 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
|
|||||||
vs.showCaretLineBackground = wParam != 0;
|
vs.showCaretLineBackground = wParam != 0;
|
||||||
InvalidateStyleRedraw();
|
InvalidateStyleRedraw();
|
||||||
break;
|
break;
|
||||||
|
case SCI_GETCARETLINEVISIBLEALWAYS:
|
||||||
|
return vs.showCaretLineBackgroundAlways;
|
||||||
|
case SCI_SETCARETLINEVISIBLEALWAYS:
|
||||||
|
vs.showCaretLineBackgroundAlways = wParam != 0;
|
||||||
|
InvalidateStyleRedraw();
|
||||||
|
break;
|
||||||
|
|
||||||
case SCI_GETCARETLINEBACK:
|
case SCI_GETCARETLINEBACK:
|
||||||
return vs.caretLineBackground.desired.AsLong();
|
return vs.caretLineBackground.desired.AsLong();
|
||||||
case SCI_SETCARETLINEBACK:
|
case SCI_SETCARETLINEBACK:
|
||||||
|
@ -118,6 +118,7 @@ ViewStyle::ViewStyle(const ViewStyle &source) {
|
|||||||
selbarlight.desired = source.selbarlight.desired;
|
selbarlight.desired = source.selbarlight.desired;
|
||||||
caretcolour.desired = source.caretcolour.desired;
|
caretcolour.desired = source.caretcolour.desired;
|
||||||
showCaretLineBackground = source.showCaretLineBackground;
|
showCaretLineBackground = source.showCaretLineBackground;
|
||||||
|
showCaretLineBackgroundAlways = source.showCaretLineBackgroundAlways;
|
||||||
caretLineBackground.desired = source.caretLineBackground.desired;
|
caretLineBackground.desired = source.caretLineBackground.desired;
|
||||||
caretLineAlpha = source.caretLineAlpha;
|
caretLineAlpha = source.caretLineAlpha;
|
||||||
edgecolour.desired = source.edgecolour.desired;
|
edgecolour.desired = source.edgecolour.desired;
|
||||||
@ -192,6 +193,7 @@ void ViewStyle::Init(size_t stylesSize_) {
|
|||||||
styles[STYLE_LINENUMBER].back.desired = Platform::Chrome();
|
styles[STYLE_LINENUMBER].back.desired = Platform::Chrome();
|
||||||
caretcolour.desired = ColourDesired(0, 0, 0);
|
caretcolour.desired = ColourDesired(0, 0, 0);
|
||||||
showCaretLineBackground = false;
|
showCaretLineBackground = false;
|
||||||
|
showCaretLineBackgroundAlways = false;
|
||||||
caretLineBackground.desired = ColourDesired(0xff, 0xff, 0);
|
caretLineBackground.desired = ColourDesired(0xff, 0xff, 0);
|
||||||
caretLineAlpha = SC_ALPHA_NOALPHA;
|
caretLineAlpha = SC_ALPHA_NOALPHA;
|
||||||
edgecolour.desired = ColourDesired(0xc0, 0xc0, 0xc0);
|
edgecolour.desired = ColourDesired(0xc0, 0xc0, 0xc0);
|
||||||
|
@ -94,6 +94,7 @@ public:
|
|||||||
bool showMarkedLines;
|
bool showMarkedLines;
|
||||||
ColourPair caretcolour;
|
ColourPair caretcolour;
|
||||||
bool showCaretLineBackground;
|
bool showCaretLineBackground;
|
||||||
|
bool showCaretLineBackgroundAlways;
|
||||||
ColourPair caretLineBackground;
|
ColourPair caretLineBackground;
|
||||||
int caretLineAlpha;
|
int caretLineAlpha;
|
||||||
ColourPair edgecolour;
|
ColourPair edgecolour;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user