mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
+add: allow Line Number color to be alpha blended (e.g. DarkMode)
This commit is contained in:
parent
fb37a52e0c
commit
3e27626cf1
@ -20,7 +20,7 @@
|
||||
16=#BE944E
|
||||
[Common Base]
|
||||
Default Style=font:$Code
|
||||
Margins and Line Numbers=size:-2; fore:#A5FAFA; back:#454545
|
||||
Margins and Line Numbers=size:-2; fore:#A5FAFA; back:#454545; alpha:180
|
||||
Matching Braces (Indicator)=fore:#0DF145; alpha:80; alpha2:80; indic_roundbox
|
||||
Matching Braces Error (Indicator)=fore:#F20C80; alpha:140; alpha2:140; indic_roundbox
|
||||
Control Characters (Font)=size:-1
|
||||
@ -42,7 +42,7 @@ Change History Marker Reverted to Origin=fore:#40A0BF; back:#40A0BF
|
||||
Inline-IME Color=fore:#4EF64D
|
||||
[2nd Common Base]
|
||||
2nd Default Style=font:Consolas
|
||||
2nd Margins and Line Numbers=size:-1; fore:#A5FAFA; back:#454545
|
||||
2nd Margins and Line Numbers=size:-1; fore:#A5FAFA; back:#454545; alpha:180
|
||||
2nd Matching Braces (Indicator)=fore:#0DF145; alpha:80; alpha2:220; indic_roundbox
|
||||
2nd Matching Braces Error (Indicator)=fore:#F20C80; alpha:140; alpha2:220; indic_roundbox
|
||||
2nd Control Characters (Font)=size:-1
|
||||
|
||||
18
src/Styles.c
18
src/Styles.c
@ -2115,23 +2115,23 @@ void Style_SetMargin(HWND hwnd, LPCWSTR lpszStyle) /// iStyle == STYLE_LINENUMBE
|
||||
int alpha;
|
||||
COLORREF colorRead;
|
||||
|
||||
// foreground
|
||||
if (!Style_StrGetColor(lpszStyle, FOREGROUND_LAYER, &colorRead, NULL, false)) {
|
||||
colorRead = GetModeTextColor(UseDarkMode());
|
||||
}
|
||||
COLORREF const clrLineNumFore = colorRead;
|
||||
SciCall_StyleSetFore(STYLE_LINENUMBER, clrLineNumFore);
|
||||
|
||||
// background
|
||||
if (!Style_StrGetColor(lpszStyle, BACKGROUND_LAYER, &colorRead, NULL, false)) {
|
||||
colorRead = GetModeBtnfaceColor(UseDarkMode());
|
||||
}
|
||||
COLORREF const clrMarginBack = colorRead;
|
||||
COLORREF const clrMarginBack = colorRead; // (=clrLineNumBack)
|
||||
|
||||
// foreground
|
||||
if (!Style_StrGetColor(lpszStyle, FOREGROUND_LAYER, &colorRead, NULL, false)) {
|
||||
colorRead = GetModeTextColor(UseDarkMode());
|
||||
}
|
||||
Style_StrGetAlpha(lpszStyle, &alpha, SC_ALPHA_OPAQUE, true);
|
||||
COLORREF const clrLineNumFore = Style_RgbAlpha(colorRead, clrMarginBack, alpha);
|
||||
|
||||
// --- Line Numbers ---
|
||||
SciCall_StyleSetFore(STYLE_LINENUMBER, clrLineNumFore);
|
||||
SciCall_StyleSetBack(STYLE_LINENUMBER, clrMarginBack);
|
||||
SciCall_SetMarginBackN(MARGIN_SCI_LINENUM, clrMarginBack);
|
||||
//~SciCall_SetMarginBackN(MARGIN_SCI_LINENUM, clrLineNumBack);
|
||||
SciCall_SetMarginSensitiveN(MARGIN_SCI_LINENUM, false); /// (!) false: allow selection drag
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user