Change logo in About dialog and make it dark-modable

This commit is contained in:
Don Ho 2021-07-30 23:53:53 +02:00
parent 19f40fdeae
commit 53576f5b18
5 changed files with 18 additions and 7 deletions

View File

@ -52,6 +52,7 @@ END
// remains consistent on all systems. // remains consistent on all systems.
IDI_M30ICON ICON "icons/npp.ico" IDI_M30ICON ICON "icons/npp.ico"
IDI_CHAMELEON ICON "icons/chameleon.ico" IDI_CHAMELEON ICON "icons/chameleon.ico"
IDI_CHAMELEON_DM ICON "icons/darkMode/about/chameleon.ico"
//IDI_JESUISCHARLIE ICON "icons/Je_suis_Charlie.ico" //IDI_JESUISCHARLIE ICON "icons/Je_suis_Charlie.ico"
//IDI_GILETJAUNE ICON "icons/giletJaune.ico" //IDI_GILETJAUNE ICON "icons/giletJaune.ico"
//IDI_SAMESEXMARRIAGE ICON "icons/same-sexMarriageTaiwan.ico" //IDI_SAMESEXMARRIAGE ICON "icons/same-sexMarriageTaiwan.ico"
@ -1189,18 +1190,19 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_BORDER | WS_SYSMENU
FONT 8, TEXT("MS Shell Dlg"), 0, 0, 0x1 FONT 8, TEXT("MS Shell Dlg"), 0, 0, 0x1
BEGIN BEGIN
EDITTEXT IDC_BUILD_DATETIME,150,2,150,10, ES_READONLY | NOT WS_BORDER EDITTEXT IDC_BUILD_DATETIME,150,2,150,10, ES_READONLY | NOT WS_BORDER
CONTROL "",IDI_CHAMELEON,"Static",SS_OWNERDRAW,20,5,64,64 CONTROL "",IDI_CHAMELEON,"Static",SS_OWNERDRAW,20,10,128,128
CONTROL "",IDI_CHAMELEON_DM "Static",SS_OWNERDRAW,20,10,128,128
//CONTROL "",IDI_JESUISCHARLIE,"Static",SS_OWNERDRAW,20,5,64,64 //CONTROL "",IDI_JESUISCHARLIE,"Static",SS_OWNERDRAW,20,5,64,64
//CONTROL "",IDI_GILETJAUNE,"Static",SS_OWNERDRAW,20,5,64,64 //CONTROL "",IDI_GILETJAUNE,"Static",SS_OWNERDRAW,20,5,64,64
//CONTROL "", IDI_SAMESEXMARRIAGE,"Static",SS_OWNERDRAW,20,5,64,64 //CONTROL "", IDI_SAMESEXMARRIAGE,"Static",SS_OWNERDRAW,20,5,64,64
LTEXT NOTEPAD_PLUS_VERSION, IDC_STATIC,70,20,140,11 LTEXT NOTEPAD_PLUS_VERSION, IDC_STATIC,85,20,140,11
LTEXT "bit",IDC_VERSION_BIT,150,20,140,11 LTEXT "bit",IDC_VERSION_BIT,160,20,140,11
//LTEXT "Author :",IDC_STATIC,21,45,31,8 //LTEXT "Author :",IDC_STATIC,21,45,31,8
//LTEXT "FREE UYGHUR",IDC_AUTHOR_NAME,70,32,70,8 //LTEXT "FREE UYGHUR",IDC_AUTHOR_NAME,70,32,70,8
//LTEXT "Stand with Hong Kong",IDC_AUTHOR_NAME,70,32,80,8 //LTEXT "Stand with Hong Kong",IDC_AUTHOR_NAME,70,32,80,8
//LTEXT "pour Samuel Paty",IDC_AUTHOR_NAME,70,32,80,8 //LTEXT "pour Samuel Paty",IDC_AUTHOR_NAME,70,32,80,8
LTEXT "Home:",IDC_STATIC,21,52,47,8 LTEXT "Home:",IDC_STATIC,21,55,47,8
LTEXT "https://notepad-plus-plus.org/",IDC_HOME_ADDR,50,52,126,8 LTEXT "https://notepad-plus-plus.org/",IDC_HOME_ADDR,50,55,126,8
GROUPBOX "GNU General Public Licence",IDC_STATIC,19,75,231,131,BS_CENTER GROUPBOX "GNU General Public Licence",IDC_STATIC,19,75,231,131,BS_CENTER
DEFPUSHBUTTON "OK",IDOK,106,215,50,14,BS_FLAT DEFPUSHBUTTON "OK",IDOK,106,215,50,14,BS_FLAT
// IDC_LICENCE_EDIT should be the last line, don't know why // IDC_LICENCE_EDIT should be the last line, don't know why

View File

@ -90,13 +90,21 @@ INT_PTR CALLBACK AboutDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara
case WM_DRAWITEM : case WM_DRAWITEM :
{ {
DPIManager& dpiManager = NppParameters::getInstance()._dpiManager; DPIManager& dpiManager = NppParameters::getInstance()._dpiManager;
int iconSideSize = 64;
int w = dpiManager.scaleX(iconSideSize);
int h = dpiManager.scaleY(iconSideSize);
HICON hIcon;
if (NppDarkMode::isEnabled())
hIcon = (HICON)::LoadImage(_hInst, MAKEINTRESOURCE(IDI_CHAMELEON_DM), IMAGE_ICON, w, h, LR_DEFAULTSIZE);
else
hIcon = (HICON)::LoadImage(_hInst, MAKEINTRESOURCE(IDI_CHAMELEON), IMAGE_ICON, w, h, LR_DEFAULTSIZE);
HICON hIcon = (HICON)::LoadImage(_hInst, MAKEINTRESOURCE(IDI_CHAMELEON), IMAGE_ICON, 64, 64, LR_DEFAULTSIZE);
//HICON hIcon = (HICON)::LoadImage(_hInst, MAKEINTRESOURCE(IDI_JESUISCHARLIE), IMAGE_ICON, 64, 64, LR_DEFAULTSIZE); //HICON hIcon = (HICON)::LoadImage(_hInst, MAKEINTRESOURCE(IDI_JESUISCHARLIE), IMAGE_ICON, 64, 64, LR_DEFAULTSIZE);
//HICON hIcon = (HICON)::LoadImage(_hInst, MAKEINTRESOURCE(IDI_GILETJAUNE), IMAGE_ICON, 64, 64, LR_DEFAULTSIZE); //HICON hIcon = (HICON)::LoadImage(_hInst, MAKEINTRESOURCE(IDI_GILETJAUNE), IMAGE_ICON, 64, 64, LR_DEFAULTSIZE);
//HICON hIcon = (HICON)::LoadImage(_hInst, MAKEINTRESOURCE(IDI_SAMESEXMARRIAGE), IMAGE_ICON, 64, 64, LR_DEFAULTSIZE); //HICON hIcon = (HICON)::LoadImage(_hInst, MAKEINTRESOURCE(IDI_SAMESEXMARRIAGE), IMAGE_ICON, 64, 64, LR_DEFAULTSIZE);
DRAWITEMSTRUCT *pdis = (DRAWITEMSTRUCT *)lParam; DRAWITEMSTRUCT *pdis = (DRAWITEMSTRUCT *)lParam;
::DrawIconEx(pdis->hDC, 0, 0, hIcon, dpiManager.scaleX(48), dpiManager.scaleY(48), 0, NULL, DI_NORMAL); ::DrawIconEx(pdis->hDC, 0, 0, hIcon, w, h, 0, NULL, DI_NORMAL);
return TRUE; return TRUE;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

View File

@ -35,6 +35,7 @@
#define IDI_M30ICON 100 #define IDI_M30ICON 100
#define IDI_CHAMELEON 101 #define IDI_CHAMELEON 101
#define IDI_CHAMELEON_DM 102
//#define IDI_JESUISCHARLIE 102 //#define IDI_JESUISCHARLIE 102
//#define IDI_GILETJAUNE 102 //#define IDI_GILETJAUNE 102
//#define IDI_SAMESEXMARRIAGE 102 //#define IDI_SAMESEXMARRIAGE 102