MozillaZine


Colours of categories in Sunbird.. filling the box!

For discussing the Mozilla Calendar, Sunbird and Lightning projects.
Mandie
 
Posts: 1
Joined: December 23rd, 2009, 8:17 am

Post Posted December 23rd, 2009, 8:22 am

Hi,
Okay. Trying for ages to get the category colours to fill the whole box on sunbird when I put in events, how is this done?

Searching the forum, I found this code from mattit:
/*
_________________________________________________________________________
/ This code is available to the community via the Open Source licensing. \
| The code has been adapted from several posts on the Net, a |
| German one in particular: |
| http://www.nadelundhirn.de/wp/2008/09/2 ... kategorien |
\_________________________________________________________________________/

The following code does the following:
* Adds a minimum height spec of 24px to the event boxes (20px pic + 2px border around the pic)
* Removes the margin
* Moves the text overlay to the right by 20px
* Adds category-dependent background colors and pictures
* Hides the category box that normally shows on the right

In the URL field, MAKE SURE you use single quotes: url('somepath/picture')
For some reason absent quotes won't work in the XUL CSS coding. Double-quotes seem to work
intermittently.

The !important tag is used to force the attributes to be static.

Pictures:
Locate the files you want to use for your category, regardless of size. Then load them into
Fireworks, Photoshop, IrFanView, etc. and erase the background (to make it transparent). Save this
file as just a PNG form of the file (if it's not already). Finally change the image size (height and/or
width) down to a MAXIMUM of 20 pixels. Make sure you name the mini-pic under a new name!
i.e. Thisismypic.png (full size) ==> Thisismypic20px.png
*/

/* Whatever you do, DON'T delete the namespace line!!! */
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

.calendar-event-box-container[categories] {
/* Modify the min-height & padding to suit the size of the pics you want to use */
min-height: 24px !important;
padding-left:20px !important;
/* Leave these next three lines alone */
margin: 0px !important;
background-position: top left !important;
background-repeat: no-repeat !important;
}

.calendar-event-box-container[categories~="Dinner"]{
color: white !important;
background-color: brown !important;
background-image:url('pics/TwoPeople20.png') !important;
}

.calendar-event-box-container[categories~="Birthday"]{
color: white !important;
background-color: #003366 !important;
background-image: url('pics/luftballons17x19.png') !important;
}

calendar-category-box[categories]{
display: none !important;
}

I copied that exactly into the userchrome.css in /chrome, in the default profile.. and no change!

What am I doing wrong? ](*,) Can anyone help?

Thanks!!

Mandie :)

vanceh
 
Posts: 10
Joined: October 8th, 2008, 12:19 pm

Post Posted December 29th, 2009, 10:40 am

I'm having the same problem, except it's in Lightning. I downloaded and installed the latest Thunderbird 3.0 yesterday (28 Dec 2009), then downloaded and installed the new Lightning beta (1.0 beta1 rc) to work with it. So far as I can tell, both Thunderbird and Lightning work fine. I, too, want to have the category color fill the entire event box on the calendar, so I composed a userchrome.css file, based on mattit's message on the forum, with the following code (I'm showing just one of my categories, to keep this short):

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */

.calendar-event-box-container[categories] {
/* Leave these next three lines alone */
margin: 0px !important;
background-position: top left !important;
background-repeat: no-repeat !important;
}

calendar-category-box[categories]{
display: none !important;
}

/* Category: Appointment */

.calendar-event-box-container[categories~="Appointment"] {
color: white !important;
background-color: #FF6600 !important;
}

I put the file in the /chrome directory for the default profile of the Lightning extension for Thunderbird and then re-started Thunderbird. Just as Mandie described, nothing changed. (The really odd thing is that I used a nearly identical userchrome file for Sunbird 0.9, and it worked just fine.) So my question is the same: What am I doing wrong?

As a side note, I agree with some previous messages in this forum that it would be very helpful to have this as a built-in option for Lightning, which is really an excellent program otherwise.

Thanks in advance for any available help.

Vance

ssitter

User avatar
 
Posts: 2495
Joined: October 19th, 2007, 12:24 am
Location: Germany

Post Posted December 29th, 2009, 5:23 pm

AFAIK the IDs are case sensitive. Maybe try "appointment" instead of "Appointment". But maybe the userChrome code just has to be updated for the new Lightning release.

vanceh
 
Posts: 10
Joined: October 8th, 2008, 12:19 pm

Post Posted December 30th, 2009, 8:18 am

Thanks for the quick reply and suggestion, ssitter. I tried changing the category names in the code to all lower-case, but the userchrome code still doesn't work. I even copied my old Sunbird userchrome file (which is similar to mattit's file) to the new Lightning chrome directory and changed my Lightning category names to exactly match my old Sunbird categories. Despite the fact that the old userchrome file still works perfectly in Sunbird 0.9, it doesn't work in Lightning 1.0 beta1 rc, so clearly there must be some sort of change in the userchrome code for this Lightning release. Is there anywhere we can find out what the necessary changes are? Thanks again for helping.

Vance

Return to Calendar


Who is online

Users browsing this forum: No registered users and 2 guests