(Note: While I'm not entirely sure if this be better asked on SuperUser, I guess the fact that you probably will have to mess around in the xpi/jar file with the css settings, should make it suitable for SO.)
Mozilla Thunderbird's Calendar extension, Lightning, will use different colors for different calendars, and just use a narrow vertical bar for the category color: (Light blue as calendar color and red as category color)
What I would like to find out is how I could go about changing/"hacking" the css styles that - surely - must be associated with this, buried somewhere in the plugin directory, so that in the example above, the event would be fully colored red.
Anyone know how to achieve this?
Image of daily calendar
Image of weekly calendar
ALL CODE BY: TOUT SÉLECTIONNER
This is a several step process that I have translated from a french website. I am simply making a note of what worked for me. This is for thunderbird 3.1.9. for the lightning-1-1.0b2-tb-macosx.xpi plugin. These directions were written April 8th, 2011. These directions are specifically for Mac users, although you can probably use them for windows as well.
Anything in ALL CAPS, means that you need to swap out your own information. Example: YOUREMAIL@gmail.com
Part 1:
/* */
is not recognized as code by thunderbird (or anything that reads .css) It is only there as a notation by the person(s) that coded it. Example/*TEXT*/
The Code:
Part 2: Now comes the complex part - taking apart the lightening plugin, one step at a time, putting it back together and loading it as a modified plugin into Thunderbird.
/content/calendar/calendar-month-view.xml
/content/calendar/calendar-multiday-view.xml
/content/calendar/calendar-view-core.xml
The symbol "<" means remove this line
The symbol ">" means add this line in it's place
CODE BY: TOUT SÉLECTIONNER
-> calendar/content/calendar/calendar-month-view.xml
-> calendar/content/calendar/calendar-multiday-view.xml
-> calendar/content/calendar/calendar-view-core.xml
Part 3:
Select the contents of the ORIGINALPLUGIN FOLDER.
Right-click the selected items and select "compress 8 items"
. . . and that should be it. It worked for me. I will check back to see if anyone else had luck with this, if not, I will double check my notes.Thanks to TOUT SÉLECTIONNER for writing the oringial code.
I am not a programming person so I found a way around modifying codes.
You can go around that by creating several individual calendars (e.g. that you can call work, personal, birthdays, etc.). You can choose the background color of each calendar. If you make the calendars all visible at the same time (by checking the calendar boxes on the left side), what you enter in each calendar will have a different background color, not just a stripe to the right.
When you create a new event, instead of selecting a category, leave 'none' for category but select a calendar in the calendar dropdown menu and assign your event to a particular calendar (each have different background colors).
The only downside of that is that you need to export all individual calendars if you would like to export your calendars at some point. But otherwise it works.
This extension looks perfect for the functionality you want.
https://addons.mozilla.org/en-us/thunderbird/addon/calendar-tweaks/
To have just this, uncheck all the options, and check these:
Just updated the way i've done things with the different ideas on this page... I was the author of the "french post" and I just needed another way to inverse colors...
So there it is for your pleasure (and my users too !!)
This is a unified diff ouptut of the modifications made on the lightning xpi (more precisely the calendar.jar package inside of it)
You may find all the informations on the original post : http://www.geckozone.org/forum/viewtopic.php?f=22&t=89384&start=15#p646027
For the non french speakers, here is some translation : Hello everybody,
Here is a more correct version of the changes. The big plus compared to my previous proposal is that we do not need anymore to define the colors of categories / calendars in the file userChrome.css that is also not used at all!
Overall:
Apply changes to XML files to allow the use of "calendar-id" and "categories" on the various elements of the DOM.
Update the file "calendar-views.js" to apply the parameterized color categories and calendars but by inverting them.
Finally, some css changes in "calendar-views.css" for:
Also, the image /skin/calendar/category-overlay.png has been expanded to increase the size of the border ...
Note: It only remains to put all this stuff as an option, but I did not have time to look over there at the moment ... But if one of you can give me some avenues of research, I will give it a try !
All the best :)
Vincent
You should install the DOM Inspector addon to understand the XUL structure of an event. Together with userChrome.css you should be able to style it the way you want it.
The category-overlay.png image is merely a gradient overlay to give the category bar the right looks.
Two options here. One more easy but not as reliable, the other a bit more difficult:
Option A: Easy
Create a userChrome.css in your $profile/chrome/ directory. It should contain the following:
You'll need to do this for each category you'd like to change the color for. Note that changing the color of the category in the Lightning options won't change the category color you set here.
Option B: More complete
You'll need to modify some files inside lightning.xpi here. This solution merely requires you to set the category colors in Lightning and will also work for newly added categories. Note that this way events without a category are transparent, if you want more you'll have to do it on your own.
If you'd rather see a patch, this applies to the latest comm-central source:
Option C: Change Javascript
This would be the best working hack, although it requires javascript changes. Open calendar.jar as described in Option B and check out calendar-views.js, there are two functions:
updateStyleSheetForViews()
andupdateStyleSheetForCategory()
. I'll leave this to people that want to tinker with it themselves, but the idea would be to add a rule for.calendar-color-box[categories~=...]
that overrides the default rule in case there are categories. This way if there is no category set, the calendar color is used, otherwise the desired category color.Have fun :)