mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-27 07:44:24 +02:00
Fix GDI leak in setStartupBgColor
- remove unneeded icon color constants Fix #16442, close #16443
This commit is contained in:
parent
4ddad4683b
commit
9f2326d30c
@ -54,12 +54,13 @@ void Notepad_plus_Window::setStartupBgColor(COLORREF BgColor)
|
||||
RECT windowClientArea;
|
||||
HDC hdc = GetDCEx(_hSelf, NULL, DCX_CACHE | DCX_LOCKWINDOWUPDATE); //lock window update flag due to PaintLocker
|
||||
GetClientRect(_hSelf, &windowClientArea);
|
||||
FillRect(hdc, &windowClientArea, CreateSolidBrush(BgColor));
|
||||
HBRUSH hBrush = ::CreateSolidBrush(BgColor);
|
||||
::FillRect(hdc, &windowClientArea, hBrush);
|
||||
::DeleteObject(hBrush);
|
||||
ReleaseDC(_hSelf, hdc);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const wchar_t *cmdLine, CmdLineParams *cmdLineParams)
|
||||
{
|
||||
Window::init(hInst, parent);
|
||||
|
@ -392,13 +392,8 @@ namespace NppDarkMode
|
||||
return opt;
|
||||
}
|
||||
|
||||
constexpr COLORREF cDefaultMainDark = RGB(0xDE, 0xDE, 0xDE);
|
||||
constexpr COLORREF cDefaultSecondaryDark = RGB(0x4C, 0xC2, 0xFF);
|
||||
constexpr COLORREF cDefaultMainLight = RGB(0x21, 0x21, 0x21);
|
||||
constexpr COLORREF cDefaultSecondaryLight = RGB(0x00, 0x78, 0xD4);
|
||||
|
||||
static COLORREF cAccentDark = cDefaultSecondaryDark;
|
||||
static COLORREF cAccentLight = cDefaultSecondaryLight;
|
||||
static COLORREF cAccentDark = g_cDefaultSecondaryDark;
|
||||
static COLORREF cAccentLight = g_cDefaultSecondaryLight;
|
||||
|
||||
static COLORREF adjustClrLightness(COLORREF clr, bool useDark)
|
||||
{
|
||||
@ -436,8 +431,8 @@ namespace NppDarkMode
|
||||
return true;
|
||||
}
|
||||
|
||||
cAccentDark = cDefaultSecondaryDark;
|
||||
cAccentLight = cDefaultSecondaryLight;
|
||||
cAccentDark = g_cDefaultSecondaryDark;
|
||||
cAccentLight = g_cDefaultSecondaryLight;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user