It turns out that it is desirable to be able to specify icon+emblem
combinations in many places. E.g. when returning icons for disks, a
backend may want to return a harddisk icon with a padlock emblem to
represent an encrypted harddisk.

This could certainly solved with a drive-harddisk-encrypted-locked
icon in this instance, but there are diverse other devices that might be
encrypted, leaving us with a plethora of <device>-encrypted-locked
icons (and also <device>-encrypted-unlocked, and other variants).

One intriguing possibility to solve this is to use some kind of escape
in icon names, and do something like 

  drive-harddisk+encrypted-locked

which is currently not an allowed icon name (since the + is not allowed
in icon-naming-spec-compliant icon names). It would be interpreted as 

  If you can't find an icon for drive-harddisk+encrypted-locked, 
  find the drive-harddisk icon and combine it with the 
  emblem-encrypted-locked emblem. 

This has the advantage that it nicely interacts with fallback (ie if the
specific icons are missing, you may still get the drive icon with the
encrypted emblem), and allows themes to provide pre-composed icon/emblem
combinations. 

If people think this is a good idea, here is patch that adds suitable
language to the icon naming spec (the patch is against 0.8, since I
couldn't find the source repository for the latest spec...).


Matthias

--- icon-naming-spec-0.8.xml.1	2006-08-22 15:46:16.000000000 -0400
+++ icon-naming-spec-0.8.xml	2008-06-16 15:24:21.000000000 -0400
@@ -173,8 +173,8 @@
 Icon names are in the en_US.US_ASCII locale. This means that the
 allowable characters in the icon names, must fall withing the
 US-ASCII character set. As a further restriction, all icon names
-may only contain lowercase letters, numbers, underscore, dash, or
-period characters. Spaces, colons, slashes, and backslashes are
+may only contain lowercase letters, numbers, underscore, dash, plus 
+or period characters. Spaces, colons, slashes, and backslashes are
 not allowed. Also, icon names must be spelled as they are in the
 en_US dictionary.
 	  </para>
@@ -192,6 +192,18 @@
 	</listitem>
         <listitem>
           <para>
+The plus <quote>+</quote> character can be used to name icon/emblem
+combinations. E.g. drive-harddisk+readonly means a drive-harddisk
+icon with the emblem-readonly emblem. To look up an icon/emblem
+combination like that, an application should look for drive-harddisk 
+and emblem-readonly and combine the two in a suitable way (possibly
+using attachment point information specified in the drive-harddisk.icon 
+file). It is possible to specify multiple emblems by using several
+plus characters, e.g. drive-harddisk+readonly+important.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
 Icons for branded applications should be named the same as the binary
 executable for the application.
 	  </para>
_______________________________________________
xdg mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/xdg

Reply via email to