mirror of
https://github.com/glfw/glfw.git
synced 2025-10-04 05:36:35 +00:00
Create a single HICON if the small and big icon images are the same
This commit is contained in:
parent
9323778a15
commit
1b51ef3d0e
@ -1040,14 +1040,15 @@ void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window,
|
|||||||
|
|
||||||
void _glfwPlatformSetWindowIcons(_GLFWwindow* window, GLFWimage* icons, int count)
|
void _glfwPlatformSetWindowIcons(_GLFWwindow* window, GLFWimage* icons, int count)
|
||||||
{
|
{
|
||||||
GLFWimage* normalicon;
|
GLFWimage* imgBig;
|
||||||
GLFWimage* smallicon;
|
GLFWimage* imgSmall;
|
||||||
|
|
||||||
normalicon = bestFit(icons, count, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON));
|
imgBig = bestFit(icons, count, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON));
|
||||||
smallicon = bestFit(icons, count, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON));
|
imgSmall = bestFit(icons, count, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON));
|
||||||
|
|
||||||
SendMessage(window->win32.handle, WM_SETICON, ICON_BIG, (LPARAM) createIcon(normalicon));
|
HICON icon = createIcon(imgBig);
|
||||||
SendMessage(window->win32.handle, WM_SETICON, ICON_SMALL, (LPARAM) createIcon(smallicon));
|
SendMessage(window->win32.handle, WM_SETICON, ICON_BIG, (LPARAM) icon);
|
||||||
|
SendMessage(window->win32.handle, WM_SETICON, ICON_SMALL, (LPARAM) (imgSmall == imgBig ? icon : createIcon(imgSmall)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformIconifyWindow(_GLFWwindow* window)
|
void _glfwPlatformIconifyWindow(_GLFWwindow* window)
|
||||||
|
Loading…
Reference in New Issue
Block a user