<AWT Dev> RFR: 8182043: Access to Windows Large Icons [v3]

Alexander Zuev kizune at openjdk.java.net
Fri May 7 17:39:10 UTC 2021


On Fri, 30 Apr 2021 20:34:01 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> Alexander Zuev has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp
>>   
>>   Select one icon at a time.
>>   
>>   Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk at users.noreply.github.com>
>
> src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java line 213:
> 
>> 211:      * Returns the icon of the specified size used to display this shell folder.
>> 212:      *
>> 213:      * @param size size of the icon > 0 (Valid range: 1 to 256)
> 
> I'm unsure the valid range of 1 to 256 makes sense provided the icon smaller than 16×16 is never returned (on Windows at least).

Well, user still can request 1x1 icon - we will return the multiresolution image with minimal (1x1) icon inside that will be scaled every time the actual painting occurs. The size will define the layout of the component with the icon and can be auto-generated from the user code so i do not see why we should limit the lowest requested size - especially in the shared instance that not only specific for Windows platform.

> src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 1193:
> 
>> 1191:     static Image getShell32Icon(int iconID, int size) {
>> 1192:         Toolkit toolkit = Toolkit.getDefaultToolkit();
>> 1193:         String shellIconBPP = (String)toolkit.getDesktopProperty("win.icon.shellIconBPP");
> 
> Looks like these lines aren't used any more and should be removed too.

Yes. Fixed.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2875


More information about the awt-dev mailing list