View Full Version : Seems Icons not available in other themes
mehdy
Aug 30, 2021, 9:46 AM
Hi
I use gray theme in 7.2, and seems icons not available in gray theme.
Should I add another lib or something?
fabricio.murta
Aug 30, 2021, 6:18 PM
Hello @mehdy!
The Gray theme icons should be available in the gray theme. But they are used a bit differently in Ext.NET 7. If you show a simple scenario in v5- where you use a icon that you want to replicate in v7, we can show you how to do it.
Basically you'd be using iconCls with a reference to the icon, instead of just Icon="Add" in previous versions. As it was a complete rewrite of the Ext.NET engine to .NET Core (.NET 5), we simply couldn't implement some syntax sugar previous versions uses for that and other features. Besides, the newer themes (Spotless, Material, Triton, Graphite, Aria) uses font icons, so these "old themes" icons can't be automatically mapped between the themes.
But again, the old themes are still there, and their icons too. Just tell us what your scenario is and we'll tell you what to do. Then you probably will be able to expand the usage to other components where you use them.
Looking forward to your follow-up!
mehdy
Aug 31, 2021, 6:39 AM
This is old syntax :
X.ITLButton().Icon(Icon.PageExcel) // PageExcel == 1149
This is new which not working in gray theme:
X.ITLButton().IconCls("x-md md-icon-lock")
fabricio.murta
Aug 31, 2021, 8:01 PM
Hello @mehdy!
Sorry, I provided you wrong information in the last post. In fact, Ext.NET 7 does not support the famfamfam icon set (https://examples5.ext.net/#/Miscellaneous/Icon/Icon_Summary/) as previous Ext.NET versions did.
This was stated by Ext.NET's CEO in a related GitHub issue (https://github.com/extnet/Ext.NET/issues/1696#issuecomment-688002355) and I only found that while reviewing the code to make icons show.
Although not supported, the famfamfam icon set (http://www.famfamfam.com/) is still available for free download and you can just download and use it an it should look just like old Ext.NET did in the old themes, where the icon set fit perfectly!
Hope this helps!
fabricio.murta
Aug 31, 2021, 9:28 PM
And, in case you're not happy with the news, I've just written a guide on how to set up famfamfam icons back to Ext.NET 7!
Take a look, any feedback is appreciated: [guide] How to enable old FamFamFam icons in new Ext.NET 7 Classic (https://forums.ext.net/showthread.php?63182)
It is not that difficult, and I went a bit verbose to help with most cases, hopefully fulfilling yours and many others' requirements to mesh up icons with the old Ext.NET themes.
Hope this helps!
mehdy
Sep 01, 2021, 6:33 AM
That's awesome, thank you.
I hoped there is way to add font icons, Is there any way that we can add font icons too? (Like spotless theme)
fabricio.murta
Sep 01, 2021, 5:50 PM
Hello again, @mehdy!
For that, we don't even need a guide! @Z was able in this 4.x thread, using iconCls, to use the Awesome fonts in the Gray theme. A similar approach will do for the material one.
- Fonts Awesome in Gray Theme (https://forums.ext.net/showthread.php?62562)
The steps are also similar to the guide to famfamfam -- except now you're installing a font file instead of 1,000 pngs -- and the CSS is already provided by the icon font package.
Hope this helps!
fabricio.murta
Sep 01, 2021, 5:54 PM
Oh, and this v5 example wraps up the awesome font whenever the theme does not include it, so it might be interesting to investigate:
- Tree Panel > List > Overview (https://examples5.ext.net/#/TreePanel/List/Overview/)
mehdy
Sep 11, 2021, 7:19 AM
Thanks, really helpful
fabricio.murta
Sep 14, 2021, 5:14 AM
Glad it helped, and thanks for the feedback!
Powered by vBulletin® Version 4.2.3 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.