[Dev] Sidebar icon naming conventions

John Anderson john at osafoundation.org
Fri Sep 23 14:38:52 PDT 2005


Hi:

The sidebar naming conventions continue to evolve (and become more 
complicate), so here's the latest description, copied from the code:

        The rules for naming icons are complicated, which is a
        reflection of complexity of our sidebar design, so here is a
        summary of the rules:

        Names are made up of the following pieces:

        'Sidebar', ButtonName, IconName, 'MouseDown', 'MouseOver', '.png'

        They all begin with 'Sidebar', followed by ButtonName. Today,
        we only have two buttons named: 'Icon', and 'SharingIcon'. The
        rules for Icon follow -- see getButtonImage for the SharingIcon
        rules

        The ButtonName is followed by IconName. IconName is a property
        of the collection, e.g. the AllCollection has an IconName of
        'All'. The In, Out, and Trash collections have names 'In',
        'Out' and 'Trash' respectively. Currently, new collections
        have no icon name, so the IconName can be empty. Another
        property of the collection is whether or not the IconName has
        a kind variation, in which case the IconName is appended with
        the Kind, e.g. CalendarEventMixin, MailMessageMixin,
        TaskMixin.  Currently, only the All collection has this
        property, so the IconNames for the AllCollection are 'All',
        'AllCalendarEventMixin', 'AllMailMessageMixin' and
        'AllTaskMixin'.

        IconButtons are checkable. The checked state is indicated by
        adding "MouseDown".

        Next comes 'MouseOver' if a different image is necessary for
        the state when the mouse is over the item.

        Here are the rules for defaults:

        First we lookup the fully qualified name, e.g. 'Sidebar',
        ButtonName, IconName, 'MouseDown', 'MouseOver', '.png'

        If we don't find an image by that name we next lookup the name
        without the IconName, e.g. 'Sidebar', ButtonName, 'MouseDown',
        'MouseOver', '.png'. This allows us to specify a default icon
        for MouseDown and MouseOver that is applied by default if you
        don't have a special one for a particular icon.

        If we still don't find an image, we next lookup the full image
        name without MouseOver, e.g. 'Sidebar', ButtonName, IconName,
        'MouseDown', '.png'. So if you don't have MouseOver icons they
        don't get displayed.

        Finally if we still don't have an image, we try to lookup the
        name without an IconName or MouseOver, e.g 'Sidebar',
        ButtonName, 'MouseDown', '.png'. This allows us to have a
        default for buttons without MouseOver.



       SharingIcon are made of the same parts as the Icon buttons, but have
       slightly different rules for how the parts are determined

        'Sidebar', ButtonName, IconName, 'MouseDown', 'MouseOver', '.png'

        The ButtonName is followed by IconName. IconName may take on
        the following values depending upon the state of the collection

        "UploadOffline"
        "UploadOfflineNotMine"
        "DownloadOffline"
        "DownloadOfflineNotMine"
       
        "Error"
        "ErrorNotMine"
       
        "Upload"
        "UploadNotMine"
        "Download"
        "DownloadNotMine"
        "UploadPartial"
        "UploadPartialNotMine"
        "DownloadPartial"
        "DownloadPartialNotMine"

        ""
        "NotMine"
       
        Offline icons take precedence over the Error icon. The Error icon
        takes precedence over the remaining icons. Partial indicates that
        only some of the items in the collection are shared, e.g. when
        viewing All only calendar events are shared. If the collection
        isn't shared then the IconName is empty, i.e. "". NotMine is 
appended
        to the IconName if the collection is in the NotMine set of items.

        SharingIcon are momentary switches, i.e. you can click them and
        while the mouse is down they show a down state icon. When the mouse
        is and the button is pressed "MouseDown" is appended.

        Next comes 'MouseOver' if a different image is necessary for
        the state when the mouse is over the item.

        Here are the rules for defaults:

        First we lookup the fully qualified name, e.g. 'Sidebar',
        ButtonName, IconName, 'MouseDown', 'MouseOver', '.png'

        If we don't find an image by that name we next lookup the name
        without the MouseOver, e.g. 'Sidebar', ButtonName, 'MouseDown',
        '.png'. So for Icons that don't have a special MouseOver state
        we use theMouseDown variation of the icon.

        Finally if we still don't find an image, we next lookup the full
        image name without MouseDown or MouseOver, e.g. 'Sidebar',
        ButtonName, IconName, '.png'. So if the button doesn't have a
        special icon for MouseDown or MouseOver you don't need to specify
        one.




More information about the Dev mailing list