Skip to content

Commit

Permalink
Fixed a bug that caused toolbar icons to be small in the hidpi enviro…
Browse files Browse the repository at this point in the history
…nment.
  • Loading branch information
funap committed Mar 4, 2023
1 parent f83410c commit 3a5c9cc
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/Explorer/Explorer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,17 @@ extern "C" __declspec(dllexport) void beNotified(SCNotification *notifyCode)
case NPPN_FILEOPENED:
UpdateDocs();
break;
case NPPN_TBMODIFICATION:
g_explorerIcons.hToolbarBmp = (HBITMAP) ::LoadImage(g_hInst, MAKEINTRESOURCE(IDB_TB_EXPLORER), IMAGE_BITMAP, 0, 0, (LR_DEFAULTSIZE | LR_LOADMAP3DCOLORS));
g_explorerIcons.hToolbarIcon = (HICON) ::LoadImage(g_hInst, MAKEINTRESOURCE(IDI_TB_FLUENT_EXPLORER), IMAGE_ICON, 0, 0, (LR_DEFAULTSIZE | LR_LOADMAP3DCOLORS));
g_explorerIcons.hToolbarIconDarkMode = (HICON) ::LoadImage(g_hInst, MAKEINTRESOURCE(IDI_TB_FLUENT_EXPLORER_DARKMODE), IMAGE_ICON, 0, 0, (LR_DEFAULTSIZE | LR_LOADMAP3DCOLORS));
g_favesIcons.hToolbarBmp = (HBITMAP) ::LoadImage(g_hInst, MAKEINTRESOURCE(IDB_TB_FAVES), IMAGE_BITMAP, 0, 0, (LR_DEFAULTSIZE | LR_LOADMAP3DCOLORS));
g_favesIcons.hToolbarIcon = (HICON) ::LoadImage(g_hInst, MAKEINTRESOURCE(IDI_TB_FLUENT_FAVES), IMAGE_ICON, 0, 0, (LR_DEFAULTSIZE | LR_LOADMAP3DCOLORS));
g_favesIcons.hToolbarIconDarkMode = (HICON) ::LoadImage(g_hInst, MAKEINTRESOURCE(IDI_TB_FLUENT_FAVES_DARKMODE), IMAGE_ICON, 0, 0, (LR_DEFAULTSIZE | LR_LOADMAP3DCOLORS));
case NPPN_TBMODIFICATION: {
SIZE smallIconSize = {
.cx = GetSystemMetrics(SM_CXSMICON),
.cy = GetSystemMetrics(SM_CYSMICON),
};
g_explorerIcons.hToolbarBmp = (HBITMAP) ::LoadImage(g_hInst, MAKEINTRESOURCE(IDB_TB_EXPLORER), IMAGE_BITMAP, smallIconSize.cx, smallIconSize.cy, LR_LOADMAP3DCOLORS);
g_explorerIcons.hToolbarIcon = (HICON) ::LoadImage(g_hInst, MAKEINTRESOURCE(IDI_TB_FLUENT_EXPLORER), IMAGE_ICON, smallIconSize.cx, smallIconSize.cy, LR_LOADMAP3DCOLORS);
g_explorerIcons.hToolbarIconDarkMode = (HICON) ::LoadImage(g_hInst, MAKEINTRESOURCE(IDI_TB_FLUENT_EXPLORER_DARKMODE), IMAGE_ICON, smallIconSize.cx, smallIconSize.cy, LR_LOADMAP3DCOLORS);
g_favesIcons.hToolbarBmp = (HBITMAP) ::LoadImage(g_hInst, MAKEINTRESOURCE(IDB_TB_FAVES), IMAGE_BITMAP, smallIconSize.cx, smallIconSize.cy, LR_LOADMAP3DCOLORS);
g_favesIcons.hToolbarIcon = (HICON) ::LoadImage(g_hInst, MAKEINTRESOURCE(IDI_TB_FLUENT_FAVES), IMAGE_ICON, smallIconSize.cx, smallIconSize.cy, LR_LOADMAP3DCOLORS);
g_favesIcons.hToolbarIconDarkMode = (HICON) ::LoadImage(g_hInst, MAKEINTRESOURCE(IDI_TB_FLUENT_FAVES_DARKMODE), IMAGE_ICON, smallIconSize.cx, smallIconSize.cy, LR_LOADMAP3DCOLORS);

/* change menu language */
if (NppInterface::isSupportFluentUI()) {
Expand All @@ -273,6 +277,7 @@ extern "C" __declspec(dllexport) void beNotified(SCNotification *notifyCode)
::SendMessage(g_nppData._nppHandle, NPPM_ADDTOOLBARICON_DEPRECATED, (WPARAM)funcItem[DOCKABLE_FAVORTIES_INDEX]._cmdID, (LPARAM)&g_favesIcons);
}
break;
}
case NPPN_READY:
UpdateThemeColor();
explorerDlg.initFinish();
Expand Down

0 comments on commit 3a5c9cc

Please sign in to comment.