Icon Theme Support

Tom Eugelink tbee at tbee.org
Sun Oct 21 00:01:07 PDT 2012

I wrote such a library for swing.

Icon packs are interesting when you allow the users to select their skin. I have an custom ERP application which is 10 years old. It initially was using Metal, but since that looks kinda old fashion, I've had a number of goes at trying to use another skin (synthentica is brilliant). The problem was that some of the more, ah, experienced users wanted to keep using Metal, while newcomers were open to a fresher look. Hence they get to choose between 30 something skins. And when they switch skin, they also switch icon pack.

Icon packs can be large indeed, but considering the ERP's all-in-one jar that is distributed is about 10MB, a few KB more or less is no issue. It of course depends on the context; maybe if you're developing for mobile, than icons packs may be too much (otoh, the Ensemble app is almost 70MB I believe?). The advantage is that you have all icons available and can simply pick one if you need a new one vs having to copy a new file into the source tree. And you can -if you like- provide a tuned icon pack with only the sizes and icons that are required. So it does offer the best of both worlds; easily switchable, easily distributable but still tuneable.


On 2012-10-21 04:36, Jonathan Giles wrote:
> I'm interested to hear if this is common practice. In one of my past lives as a Swing client application developer I would always cherry pick the icons I wanted to use out of the icon packs I had available to me, rather than try to ship an entire icon pack (or multiple icon packs). From my experience icon packs tend to be rather large (when taking into account they normally ship with some permutation of 16x16, 24x24, 32x32, 48x48, 64x64 pixel .png, .svg and .ico files).
> So, in short, is shipping an entire, or multiple, icon packs something that people actually want to do, and if so, would some kind of library support for this be beneficial?
> As a secondary question / comment: this seems like something that a third party library could offer - rather than being necessarily included in JavaFX itself?
> -- Jonathan
> On 21/10/2012 5:58 a.m., Mark Fortner wrote:
>> I was wondering if anyone had given any thought to supporting Icon Themes
>> in JavaFX?  When you look at Swing apps (and now JavaFX apps) you find a
>> lot of the same icons borrowed from various Linux icon themes. Invariably
>> someone has taken apart the theme's archive, and extracted the icons that
>> they wanted and simply added them as resources to their project.  However,
>> that misses some of advantages of having a theme in the first place --
>> namely that if you use the standard naming conventions for icons, then you
>> should be able to do drop-in replacements of the icons without having to
>> change your code.  This makes is possible to freshen up the look of your
>> app, or to use icon themes that fit a specific OS.  After all, do you
>> really want Tango icons on your nice clean OS X app?  Moreover, it would
>> make it possible for user's to customize the look of their apps without
>> developer involvement.
>> Which brings me rather circuitously back to my point -- is there a way to
>> support icon themes in CSS?  For example, I'd like to simply drop *
>> AwOken.tar.gz* into my classpath, and have an icon reference like this
>> resolve properly: *-fx-image: url('clear/24x24/apps/ubuntuone-client.png');*
>> *
>> *
>> Ideally, this should happen without having to repackage the icon themes
>> into a JAR since themes are often stored in a variety of formats tar.gz,
>> rar, zip, etc.
>> Cheers,
>> Mark

More information about the openjfx-dev mailing list