Add tree icons and icon rotation features with miscellaneous changes #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds one prominent new feature where the icons specified in the
ThumbnailIconAttribute
will also be shown in the content tree (and a few other places) when this feature is turned on. Also, there is theTreeIconAttribute
to allow for finer control over the tree icons. This works for both Font Awesome version 4 and 5.Another small new feature is that the icons can now be rotated and flipped as this is a Font Awesome feature that was easy enough to include. This applies to both the images generated and the new tree icons.
I've been careful not to make any breaking changes and consequently, the tree icon feature is off by default.
Of course, I've made plenty of unit tests to make certain the new functionality works as expected. Also, we've been using a private build of this ourselves for a few weeks.
Changes summarized:
FontThumbnail.EnableTreeIcons
to turn on the tree icons feature.TreeIconAttribute
to allow to turn it on per icon or override the value of theThumbnailIconAttribute
.TreeIconUIDescriptorInitialization
where the icon CSS classes get added to the UI descriptors.VirtualPathProvider
that provides the font files from the embedded resources. This code is essentially taken from Poweslice.IClientResourceProvider
that only adds the required CSS file(s) when the tree icon feature is on and actively in use.FontThumbnailService
to rotate or flip the icon depending on the setting from the attribute.ThumbnailIconAttribute
to align with the namespace of the enums. This way there is only a single namespace for users to include.VirtualPathProvider
IClientResourceProvider