[PATCH 0/2] MR10950: Draft: shell32: Add an Info icon.
Hi Alex, I ran into an application that needed SIID_INFO. I noticed you added a lot of icons to shell32, so maybe you can help me with two issues: 1) On my WinXP and Win11, the (i) Icon has index 221, not 215. The power off icon however has index 215. Can you double check if you used the correct value for IDI_SHELL_POWER_OFF back in 9954c08dc8dc? 2) It seems the other shell icon SVGs have a rasterized image embedded, which tools/buildimage needs. For this .svg it writes "no render directive found in dlls/shell32/resources/info.svg". How did you generate those for the icons you added? Other Wikimedia Commons Tango icons don't seem to have them, so I guess they were added by one of us. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10950
From: Stefan Dösinger <stefan@codeweavers.com> The icon itself originates from the Tano Icons found at https://commons.wikimedia.org/wiki/Tango_icons#/ On my Win11 and Win XP installations this icon has index 221 in shell32. The power off icon is 215. I've placed the (i) icon at 215, but I would like to know if there is a proper definition of the indices somewhere in the Windows SDK. --- dlls/shell32/Makefile.in | 1 + dlls/shell32/resources/info.svg | 23 +++++++++++++++++++++++ dlls/shell32/shell32.rc | 3 +++ dlls/shell32/shresdef.h | 3 ++- 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 dlls/shell32/resources/info.svg diff --git a/dlls/shell32/Makefile.in b/dlls/shell32/Makefile.in index 54059b73dc3..84615e29e3e 100644 --- a/dlls/shell32/Makefile.in +++ b/dlls/shell32/Makefile.in @@ -45,6 +45,7 @@ SOURCES = \ resources/folder_open.svg \ resources/help.svg \ resources/image.svg \ + resources/info.svg \ resources/internet.svg \ resources/log_off.svg \ resources/menu.svg \ diff --git a/dlls/shell32/resources/info.svg b/dlls/shell32/resources/info.svg new file mode 100644 index 00000000000..46ddc74c7e4 --- /dev/null +++ b/dlls/shell32/resources/info.svg @@ -0,0 +1,23 @@ +<?xml version="1.0"?> +<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"> +<defs> +<radialGradient id="b" gradientUnits="userSpaceOnUse" cy="28.46" cx="26.54" gradientTransform="matrix(1.156 .005968 -.005968 1.261 -4.845 -7.341)" r="22.38"> +<stop stop-color="#9cbcde" offset="0"/> +<stop stop-color="#204a87" offset="1"/> +</radialGradient> +<radialGradient id="a" gradientUnits="userSpaceOnUse" cy="17.68" cx="-9.5" gradientTransform="matrix(4.446 0 0 6.866 67.3-104.4)" r="8.75"> +<stop stop-color="#fff" offset="0"/> +<stop stop-color="#b8b8b8" offset="1"/> +</radialGradient> +<radialGradient id="c" gradientUnits="userSpaceOnUse" cy="42" cx="31.55" gradientTransform="matrix(1 0 0 .3333 -7.55 28)" r="18"> +<stop offset="0"/> +<stop stop-opacity="0" offset="1"/> +</radialGradient> +</defs> +<ellipse opacity="0.63" rx="18" ry="6" cy="42" cx="24" fill="url(#c)"/> +<circle cy="24" cx="24" r="21.5" fill="#204a87"/> +<g stroke-linejoin="round" stroke="#fff"> +<circle stroke-opacity=".94" r="18.6" cy="24" cx="24" stroke-width="2.5" fill="url(#b)"/> +<path stroke-width=".8" d="m21.5 19.4h5v15.9h-5v-15.9zm0-6.6h5v4.2h-5v-4.2z" stroke-opacity=".78" fill="url(#a)"/> +</g> +</svg> \ No newline at end of file diff --git a/dlls/shell32/shell32.rc b/dlls/shell32/shell32.rc index fe80339568b..4036df4be5d 100644 --- a/dlls/shell32/shell32.rc +++ b/dlls/shell32/shell32.rc @@ -794,6 +794,9 @@ IDI_SHELL_RESTRICTED ICON resources/restricted.ico /* @makedep: resources/folder.ico */ IDI_SHELL_DEFAULT_FOLDER ICON resources/folder.ico +/* @makedep: resources/info.ico */ +IDI_SHELL_USERS ICON resources/info.ico + /* @makedep: resources/users.ico */ IDI_SHELL_USERS ICON resources/users.ico diff --git a/dlls/shell32/shresdef.h b/dlls/shell32/shresdef.h index deabe568022..08d15eeb876 100644 --- a/dlls/shell32/shresdef.h +++ b/dlls/shell32/shresdef.h @@ -293,7 +293,8 @@ #define IDI_SHELL_RESTRICTED 200 /* 201 - 209 not used on Windows */ #define IDI_SHELL_DEFAULT_FOLDER 210 -/* 211 - 219 not used on Windows */ +/* FIXME: IDI_SHELL_INFO and IDI_SHELL_POWER_OFF might be swapped. */ +#define IDI_SHELL_INFO 215 #define IDI_SHELL_USERS 220 #define IDI_SHELL_POWER_OFF 221 #define IDI_SHELL_DVD 222 -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10950
From: Stefan Dösinger <stefan@codeweavers.com> --- dlls/shell32/iconcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/shell32/iconcache.c b/dlls/shell32/iconcache.c index 9433361440c..873f1a12a12 100644 --- a/dlls/shell32/iconcache.c +++ b/dlls/shell32/iconcache.c @@ -1037,7 +1037,7 @@ static INT stock_icon_id_to_resource_id(SHSTOCKICONID id) MISSING_ICON(SIID_FOLDERFRONT); case SIID_SHIELD: return IDI_SHELL_SHIELD; MISSING_ICON(SIID_WARNING); - MISSING_ICON(SIID_INFO); + case SIID_INFO: return IDI_SHELL_INFO; case SIID_ERROR: return IDI_SHELL_RESTRICTED; MISSING_ICON(SIID_KEY); MISSING_ICON(SIID_SOFTWARE); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10950
Hi Stefan! Since you're at least the second person who has asked me about icon creation, I've now added step-by-step instructions to the [Create Icons](https://gitlab.winehq.org/wine/wine/-/wikis/Create-Icons) wiki page based on the notes I shared in these two emails: * https://list.winehq.org/hyperkitty/list/wine-devel@list.winehq.org/message/D... * https://list.winehq.org/hyperkitty/list/wine-devel@list.winehq.org/thread/BT... I used [Resource Hacker](https://www.angusj.com/resourcehacker/) to get the icon group IDs. I just double-checked and 221 is indeed the "power off" icon in Windows XP, Windows 7, and Windows 10. And on all three, the "info balloon" icon is number 1001. The problem is that your program expects the info balloon icon to be the 222nd icon. Currently Wine's shell32.dll has 189 icons, and if you add just the info balloon icon it will be the 190th. To make it the 222nd, you'll also have to add the missing icons 248, 249, 250, 253, 255, 256, 257, 259, 265, 268, 270, 274, 275, 277, 278, 282, 283, 284, 290, 299, 300, 301, 303, 305, 306, 307, 308, 309, 310, 314, 315, 316, and 317 and correct IDI_SHELL_SHIELD which was incorrectly added as 78 but should be 16747. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10950#note_140747
Oh wow that icon procedure is complicated. Thanks for creating the wiki page. My application doesn't care about the position in the shell32 resources at all. It only needs SHGetStockIconInfo(SIID_INFO). I guess the 221/215 conflict is an artifact of how I tried to find that number: Create a .lnk, set the icon of the .lnk and then look at the index in the .lnk. I guess that retrieved the 221st icon in shell32 rather than the resource index. Anyway, I'll update this MR in the next days. I should be able to add it as icon number 1001 without issues and hook it up to SHGetStockIconInfo. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10950#note_140750
participants (3)
-
Alex Henrie (@alexhenrie) -
Stefan Dösinger -
Stefan Dösinger (@stefan)