Possibility to use custom icons in buttons #1530
Labels
changelog:api
A changelog entry should be put in the API section of the changelog.
status:confirmed
An issue confirmed by the development team.
target:major
Any docs related issue that should be merged into a major branch.
type:feature
A feature request.
Milestone
Are you reporting a feature request or a bug?
Feature request
Provide detailed reproduction steps (if any)
At the moment button icons can be defined only in two ways:
Automatically based on button/command name like:
The icons used this way must be registered earlier via
CKEDITOR.skin.addIcon
. Registration happens automatically when icons are defined viapluginDefinition.icons
and this is the way it is used in all cases now:https://github.com/ckeditor/ckeditor-dev/blob/9409e28dadf1564ec35987bcd888dfe6df23ef0d/plugins/basicstyles/plugin.js#L6-L10
This mechanism also assumes that icons are placed under the following path
ckeditor_root_folder/plugins/plugin_name/icons/icon_name.png
andckeditor_root_folder/plugins/plugin_name/icons/hidpi/icon_name.png
for HiDPI versions.Reuse icons from other plugins
Button can be also defined like:
And then it will reuse the icons defined (as described above) in other plugin with a given name.
Solution
For more flexibility we would like to add possibility to defined button icon only by passing path to icon image/file to button definition:
For more detailed information how paths should be defined and how are resolved, you may refer to docs in the code (or CKEDITOR.ui.addButton SDK after 4.9.0 release):
https://github.com/ckeditor/ckeditor-dev/blob/9409e28dadf1564ec35987bcd888dfe6df23ef0d/plugins/button/plugin.js#L409-L435
The text was updated successfully, but these errors were encountered: