Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tree icons and icon rotation features with miscellaneous changes #10

Merged
merged 1 commit into from Sep 3, 2019

Conversation

johanbenschop
Copy link
Contributor

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 the TreeIconAttribute 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:

  • Added a new setting FontThumbnail.EnableTreeIcons to turn on the tree icons feature.
  • Added TreeIconAttribute to allow to turn it on per icon or override the value of the ThumbnailIconAttribute.
  • Added TreeIconUIDescriptorInitialization where the icon CSS classes get added to the UI descriptors.
  • Added a VirtualPathProvider that provides the font files from the embedded resources. This code is essentially taken from Poweslice.
  • Added an IClientResourceProvider that only adds the required CSS file(s) when the tree icon feature is on and actively in use.
  • Added the CSS and all the font files for both Font Awesome version 4 and 5.
  • Changed the FontThumbnailService to rotate or flip the icon depending on the setting from the attribute.
  • Added install and uninstall scripts to the .nuspec file.
  • Changed the namespace of ThumbnailIconAttribute to align with the namespace of the enums. This way there is only a single namespace for users to include.
  • General code cleanup, using more of the modern C# features and such.
  • Removed the module.config and Web.Module.config files as they seemingly don't do anything (correct me if I'm wrong here)
  • Added unit tests for:
    • the tree icons feature with 13 different scenarios
    • the VirtualPathProvider
    • the IClientResourceProvider

@johanbenschop
Copy link
Contributor Author

Hello, I know I created this PR in the middle of the summer, but since there hasn't been any activity for more than a month now I just thought I'd post a quick reminder.

@degborta
Copy link
Collaborator

Hello, I know I created this PR in the middle of the summer, but since there hasn't been any activity for more than a month now I just thought I'd post a quick reminder.

Hey @johanbenschop !

Thanks a bunch for your contributions! I was on summer holiday and must have completely missed this. I'll take a look on monday!

Sorry for the delay!

Copy link
Collaborator

@degborta degborta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @johanbenschop !

I have now taken a look at the pull and it looks really good!

The treeicon-feature is something I have glared at myself in the past and this implementation is way much easier than the approach I explored earlier. Nice work!

@degborta degborta merged commit a229e79 into Geta:master Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants