-
Notifications
You must be signed in to change notification settings - Fork 235
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
Replaceable icons set #348
Comments
+1 Great feature |
Have you considered adding something similar to FontAwesomeFX? It is a JavaFX library that allows the use of scalable font characters from FontAwesome as images. If you're unfamiliar, see: |
I did look into it briefly, but I am pretty sure there are some issues/limitations with fonts in older JDK versions - remember that WebLaF supports JDK 6 update 30 +. They do have SVG version for the glyphs though which I might actually implement at some point since I am working towards scaleable SVG images as a replacement for non-scaleable raster images because they have a good potential:
You can actually already see some SVG icon being used in new demo application from the Anyway, implementation of FontAwesome and similar things is certainly not something that will be around soon as it will take some significant time and will have to be constantly supported. |
This feature will be provided by Also while working on the v1.29 release I got a small idea that might enhance this feature even further - allow providing icons within the skin files. That will be a pretty nice addition to <skin>
...
<SvgIcon id="spinner-up" src="icons/spinner-up.svg" />
<ImageIcon id="spinner-down" src="icons/spinner-down.png" />
....
</skin> And then use it within the skin description: <style type="button" id="next" extends="button">
<component>
<icon>spinner-up</icon>
</component>
...
</style> |
First preview of It will receive major improvements in the next few updates to include most of the features mentioned in this issue. |
Last week I've started looking into As a result of these changes (that will be going live today):
All these changes will basically allow any existing icons from |
I'll be posting more extensive guide on wiki once snapshot versions with these changes are available. |
- IconManager.java - Simplified `IconSet` addition and removal and it is now strict - IconManager.java - Any `find*` methods can return `null`, while `get*` methods will either return non-`null` value or throw exception - IconSet.java - Made into a proper base interface for any icon sets and is now used across all related classes instead of `AbstractIconSet` - XmlIconSet.java - Now uses new `Resource` interface as a source for XML, all path operations were moved into converters - XmlIconSetConverter.java - New custom converter for `XmlIconSet` that provides necessary context settings for icon converters - IconSetData.java - Removed as redundant, all icons are read directly into `XmlIconSet` - AbstractIconDataConverter.java - New custom abstract converter for any kinds of icon data - XmlUtils.java - Added method for reading various `Resource` types from node attributes for convenience and backward compatibility - RuntimeIconSet.java - New `IconSet` implementation for convenient runtime icon set creation - ImageIconData.java, SvgIconData.java - Added various constructors for convenient runtime icon data creation API - Resource.java - New interface for any custom resource, provides `InputStream` for reading the resource - Resource.java - Fully replaced old inconvenient `Resource` (old) class, all related places across the code have been adjusted accordingly - Resource.java (old), ResourceLocation.java - Removed and replaced by `Resource` interface in API - UrlResource.java, FileResource.java, ClassResource.java - New `Resource` implementations for most common use cases - ResourceException.java - Custom `RuntimeException` used for `Resource` implementations exclusively - DisabledCopySupplier.java - New interface for classes that can return disabled copy of themselves, currently used for complex `Icon`s - TransparentCopySupplier.java - New interface for classes that can return transparent copy of themselves, currently used for complex `Icon`s Skins - WebSkin.java, DarkSkin.java - Renamed to `WebLightSkin` and `WebDarkSkin` accordingly for consistency reasons - WebLightSkin.java - Moved from `com.alee.skin.web` to `com.alee.skin.light` package for consistency - web-light-skin.xml - Identifier changed from `weblaf.web.skin` to `weblaf.light.skin` for consistency - All XML files of different skins and extensions renamed from `skin.xml` and `extension.xml` to more specific names - Names of placeholder skins like `ModenaSkin` or `FlatSkin` were preserved, but their XML files were renamed SVG - SvgIcon.java - Added method for attribute removal - SvgIcon.java - Will now use separate `SVGUniverse` for each instance - SvgIconData.java, SvgIconData.xsd - Removed `universe` setting - AbstractSvgColorAdjustment.java - New abstract adjustment for all `SvgIcon` colors - SvgColorOpacity.java - New adjustment for `SvgIcon` to change opacity of all colors in the icon - SvgGrayscale.java - Now based on `SvgColorAdjustment` to simplify code - SvgOpacity.java - New adjustment for `SvgIcon` to change `opacity` attribute of selected elements - AbstractSvgAdjustment.java, AbstractSvgAttributeAdjustment.java and other adjustments - Added constructors for convenient usage in code - pom.xml - Added dependency on SVG Salamander v1.1.2.2 release based on my fork (see https://github.com/mgarin/svgSalamander) GIF - GifIcon.java - Now uses `Resource` in constructors instead of hardcoded options - GifIcon.java - Refactored code and added `@NotNull` and `@Nullable` usage - GifFrame.java - Moved into separate class for use convenience - FrameChangeListener.java - Renamed from `RepaintListener` to clarify what kind of events it listens to - FrameChangeListener.java - Added some basic arguments for usage convenience - GifDecoder.java - Potential NPE fix and minor code refactoring NinePatch - NinePatchIcon.java - Now uses `Resource` in constructors instead of hardcoded options - NinePatchIcon.java - Replaced static creation method with a proper constructor - NinePatchIconConverter.java, NinePatchUtils.java - Adjusted for `NinePatchIcon` changes Icons - ColorIcon.java - Replaces some old `ImageUtils` methods for creating decorated icon for a specific `Color` - ColorIcon.java - Now supports "alpha" background for `null`, fully-transparent and semi-transparent `Color`s Decorations - AlphaLayerBackground.java - Separated static method for alpha texture creation for reuse in other places TabbedPane - WTabbedPaneInputListener.java - Fixed exception that occurs when using mouse wheel on top of tabbed pane with zero tabs - TabbedPaneLayout.java - Disabled icon will only receive updates if tab is disabled to avoid preemptively generating disabled icon Tree - TreePainter.java - Node selection will not occur on disabled tree anymore - TreePainter.java - Removed unnecessary checks, adjusted used utility methods - WebTreeCellRenderer.java - Removed redundant logic for disabled icon retrieval, it will become disabled on it's own through renderer component (label) DateField - WebDateFieldUI.java - Replaced raster hardcoded button icon with configurable `calendar` and `calendar-hover` icons from `IconManager` Calendar - WebCalendar.java - Replaced raster hardcoded button icons with configurable `double-left-big`, `left-big`, `right-big` and `double-right-big` icons from `IconManager` ColorChooserField - WebColorChooserField.java - Added support for `null` color, it can be set as `null` or user can erase text in the field to change color to `null` - WebColorChooserField.java - Default selected color is now `null` instead of `Color.WHITE` - WebColorChooserField.java - Added support for color's alpha in the text field and on the color icon, popup chooser will have that support added later - WebColorChooserField.java - Replaced utility color icon with a custom `ColorIcon` implementation ImageGallery - WebImageGallery.java - Now stores `BufferedImage` instead of `ImageIcon` for usage convenience and less conversion operations - WebImageGallery.java - New images are now added to the end by default - WebImageGallery.java - Removed dead-end try-catch on image addition LanguageManager - Dictionary.java - Now uses `Resource` in constructors instead of hardcoded options PluginManager - PluginManager.java, Plugin.java, DetectedPlugin.java - Replaced `ImageIcon` usage with simple `Icon` for wider icon types support StyleEditor - StyleEditor.java - Minor size adjustment for the left side of split - StyleEditor.java - Now properly launched on EDT - magnifierImage.png - Removed as redundant Utilities - ImageUtils.java - Completely revamped to provide adequate JavaDoc and consistent approach to image read/creation/modification - ImageUtils.java - Multiple outdated/unnecessary methods have been removed, they can be replaced with new `ImageUtils` methods and/or common image API - ImageUtils.java - Multiple old auto-cached image retrieval methods have been removed, image cache should not be handled globally like that - ImageUtils.java - Icon merge methods were replaced with `StackIcon` implementation, caching must now be done locally if necessary - ImageUtils.java - Icon combine methods were replaced with `FlowIcon` implementation, caching must now be done locally if necessary - IOUtils.java - New utility class for working with streams - ColorUtils.java - Adapted hex color conversion methods to RGBA format, previously only RGB was supported - ColorUtils.java - Removed redundant color cache, there is no point to cache colors as it only makes their usage slower - FileUtils.java - Refactored all remaining old code, added `@NotNull` and `@Nullable` annotations to clarify use cases - FileUtils.java - Modified some methods to use `Resource` instead of hardcoded options - Scale.java, ScaleConverter.java, XmlUtils.java - New data class for `double` X/Y axis scale values - Clone.java - Added new preconfigured `reflective` option of `Clone` for cloning any chaotic object structures, `Cloneable` or not - Clone.java - Removed preconfigured `adaptive` option of `Clone` as redundant - Clone.java - Clarified use cases in JavaDoc for the class - NetUtils.java - Converted to fail-fast approach to avoid hiding exceptions - JavaVersion.java - Added `versionString ()` method to retrieve clean version string separately - JavaVersion.java - Added logging for possible issues with version read - JavaVersion.java - Improved text output for JDK version 9 and higher - Objects.java - Minor code refactoring Tests - ColorUtils.java - New test for checking validity of various color-related utilities - ComponentInstantiationTest.java - Adjusted according to `SvgIcon` API changes General - WebLookAndFeel.java - Simplified disabled icon retrieval, cache is now implemented within `ImageUtils` - WebLookAndFeel.java - Simplified library icons/images retrieval code - AboutLibraryDialog.java - Renamed for convenience, slightly refactored code - Added `@NotNull` and `@Nullable` usage across all modified classes DemoApplication - DemoApplication.java, demo-language.xml - Removed outdated text in the overlay with library and VM version - DemoApplication.java - Fixed title updated upon closing last preview in document pane - demo-dark-extension.xml - Added washed wall background for dark extension to mirror light one Project - README.md - Added information about all dependencies and 3rd-party code use in WebLaF library - README.md - Added a few helpful notes about source code and JavaDoc - README.md - Added two more JVM options necessary to avoid warnings on JDK9+ - README.md - Added Maven Central release badge with link to search for convenience - CONTRIBUTING.md - Added new and updated some old notes about code philosophy
All icons provided through To do that - you simply need to provide icon with the same identifier in another set and add it later than the first set have been added with an exception of skin/extension There is also a new |
Detailed article with all information about these changes can be found on wiki: |
There is already a huge set of icons used within WebLaF and there is no convenient way to replace them altogether or sometimes there is no way to replace them at all.
This should certainly be addressed along with introduction of the fresh UI icons set based on SVG images in addition to existing PNG images set.
It is also a good opportunity to get rid of some deprecated or/and unused icons within library to reduce its size and make it cleaner overall.
The text was updated successfully, but these errors were encountered: