Add a small section to Working with Icons and Images article describing animated icons (#799)

* added a small section to Working with Icons and Images article describing animated icons
This commit is contained in:
Makhnev Petr 2022-06-30 15:24:41 +03:00 committed by GitHub
parent b9338e8892
commit 91acfc2830
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View File

@ -27,6 +27,7 @@ Minor Changes and Additions
: :
- Add a small section to [](php_open_api.md#utility-classes) describing `PhpFilePathUtils` utility class. - Add a small section to [](php_open_api.md#utility-classes) describing `PhpFilePathUtils` utility class.
- Add mention of the way to programmatically open an autocomplete popup to [](code_completion.md). - Add mention of the way to programmatically open an autocomplete popup to [](code_completion.md).
- Add a small section to [](work_with_icons_and_images.md) describing animated icons.
### May-22 ### May-22

View File

@ -156,3 +156,25 @@ Here are examples of <path>toolWindowStructure.png</path> icon representations:
| Darcula | <path>toolWindowStructure_dark.png</path> | ![Tool Window Structure, dark](toolWindowStructure_dark.png) | | Darcula | <path>toolWindowStructure_dark.png</path> | ![Tool Window Structure, dark](toolWindowStructure_dark.png) |
| Default + Retina | <path>toolWindowStructure@2x.png</path> | ![Tool Window Structure, retina](toolWindowStructure@2x.png) | | Default + Retina | <path>toolWindowStructure@2x.png</path> | ![Tool Window Structure, retina](toolWindowStructure@2x.png) |
| Darcula + Retina | <path>toolWindowStructure@2x_dark.png</path> | ![Tool Window Structure, retina, dark](toolWindowStructure@2x_dark.png) | | Darcula + Retina | <path>toolWindowStructure@2x_dark.png</path> | ![Tool Window Structure, retina, dark](toolWindowStructure@2x_dark.png) |
## Animated Icons
Animated icons are a way to show that plugin is now performing some long-time action.
For example, when plugin is loading some data.
Any animated icon is a set of frames that loop with some delay.
To create a new animated icon, use the
[`AnimatedIcon`](upsource:///platform/platform-impl/src/com/intellij/ui/AnimatedIcon.java).
If you want to create an icon where frames follow each other with the same delay, use a constructor that accepts a delay and icons:
```java
AnimatedIcon icon = new AnimatedIcon(500, AllIcons.Ide.Macro.Recording_1, AllIcons.Ide.Macro.Recording_2);
```
To create an icon from frames with different delays, use `AnimatedIcon.Frame`.
Each frame represents an icon, and a delay until the next frame.
If you want to show somewhere that there is a long process, you can use the predefined `AnimatedIcon.Default` loader icon.
This icon has a larger `AnimatedIcon.Big` version.