Skip to content

Commit

Permalink
Change alpha value for current line outline frame to outline, leavi…
Browse files Browse the repository at this point in the history
…ng `alpha` to background color only.
  • Loading branch information
zufuliu committed Apr 7, 2020
1 parent 532b69e commit a512f2d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Binary file modified doc/Notepad2 DarkTheme.ini
Binary file not shown.
4 changes: 2 additions & 2 deletions src/EditLexers/stlDefault.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static EDITSTYLE Styles_Global[] = {
{ STYLE_INDENTGUIDE, NP2StyleX_IndentationGuide, L"fore:#FF8000" },
{ SCI_SETSELFORE + SCI_SETSELBACK, NP2StyleX_SelectedText, L"eolfilled; alpha:95" },
{ SCI_SETWHITESPACEFORE + SCI_SETWHITESPACEBACK + SCI_SETWHITESPACESIZE, NP2StyleX_Whitespace, L"size:1; fore:#FF4000" },
{ SCI_SETCARETLINEBACK, NP2StyleX_CurrentLine, L"size:2; fore:#C2C0C3; back:#FFFF00; alpha:90" },
{ SCI_SETCARETLINEBACK, NP2StyleX_CurrentLine, L"size:2; fore:#C2C0C3; back:#FFFF00; alpha:90; outline:90" },
{ SCI_SETCARETFORE + SCI_SETCARETWIDTH, NP2StyleX_Caret, L"" },
{ 0, NP2StyleX_IMEIndicator, L"fore:#108010" },
{ SCI_SETEDGECOLOUR, NP2StyleX_LongLineMarker, L"fore:#FFC000" },
Expand All @@ -39,7 +39,7 @@ static EDITSTYLE Styles_2ndGlobal[] = {
{ STYLE_INDENTGUIDE, NP2StyleX_IndentationGuide, L"fore:#605F63" },
{ SCI_SETSELFORE + SCI_SETSELBACK, NP2StyleX_SelectedText, L"eolfilled; alpha:95" },
{ SCI_SETWHITESPACEFORE + SCI_SETWHITESPACEBACK + SCI_SETWHITESPACESIZE, NP2StyleX_Whitespace, L"size:1; fore:#FF4000" },
{ SCI_SETCARETLINEBACK, NP2StyleX_CurrentLine, L"size:2; fore:#C2C0C3; back:#FFFF00; alpha:25" },
{ SCI_SETCARETLINEBACK, NP2StyleX_CurrentLine, L"size:2; fore:#C2C0C3; back:#FFFF00; alpha:25; outline:25" },
{ SCI_SETCARETFORE + SCI_SETCARETWIDTH, NP2StyleX_Caret, L"fore:#FFFFFF" },
{ 0, NP2StyleX_IMEIndicator, L"fore:#108010" },
{ SCI_SETEDGECOLOUR, NP2StyleX_LongLineMarker, L"fore:#605F63" },
Expand Down
10 changes: 5 additions & 5 deletions src/Styles.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ enum DefaultStyleIndex {
Style_IndentationGuide, // inherited style. `fore`, `back`
Style_Selection, // standalone style. `fore`, `back`, `alpha`, `eolfilled`
Style_Whitespace, // standalone style. `fore`, `back`, `size`: dot size
Style_CurrentLine, // standalone style. frame (`fore`, `size`, `alpha`), background (`back`, `alpha`)
Style_CurrentLine, // standalone style. frame (`fore`, `size`, `outline`), background (`back`, `alpha`)
Style_Caret, // standalone style. `fore`: caret color
Style_IMEIndicator, // indicator style. `fore`: IME indicator color
Style_LongLineMarker, // standalone style. `fore`: edge line color, `back`: edge background color
Expand Down Expand Up @@ -3005,11 +3005,11 @@ void Style_HighlightCurrentLine(void) {
if (iHighlightCurrentLine != 0) {
LPCWSTR szValue = pLexGlobal->Styles[Style_CurrentLine].szValue;
// 1: background color, 2: outline frame
const BOOL foreColor = iHighlightCurrentLine != 1;
const BOOL outline = iHighlightCurrentLine != 1;
COLORREF rgb;
if (Style_StrGetColor(foreColor, szValue, &rgb)) {
if (Style_StrGetColor(outline, szValue, &rgb)) {
int size = 0;
if (foreColor) {
if (outline) {
Style_StrGetRawSize(szValue, &size);
size = max_i(1, RoundToCurrentDPI(size));
}
Expand All @@ -3018,7 +3018,7 @@ void Style_HighlightCurrentLine(void) {
SciCall_SetCaretLineBack(rgb);

int alpha;
if (!Style_StrGetAlpha(szValue, &alpha)) {
if (!Style_StrGetAlphaEx(outline, szValue, &alpha)) {
alpha = SC_ALPHA_NOALPHA;
}
SciCall_SetCaretLineBackAlpha(alpha);
Expand Down

0 comments on commit a512f2d

Please sign in to comment.