The category image-overlay.png is just a gradient overlay so that the category bar looks right.
Two options. Another simple, but not so reliable, the other is a bit more complicated:
Option A: Simple
Create userChrome.css in the $ profile / chrome / directory. It should contain the following:
.calendar-color-box [categories ~ = "mycategory"],
.calendar-event-box-container [categories ~ = "mycategory"] {
background-color: # abc123! important;
}
You will need to do this for each category for which you want to change the color. Please note that changing the color of a category in the Lightning options will not change the color of the category that you set here.
Option B: more complete
You need to change some files inside lightning.xpi here. This solution just requires that you set the category colors in Lightning and also work for the newly added categories. Please note that in this way events without a category are transparent, if you want more, you will have to do it yourself.
- Open lightning.xpi with zip program
- Enter the chrome / directory
- Open the calendar.jar file with a zip program.
- Descent to the content / calendar /
- Open calendar-multiday-view.xml
- find "calendar-color-box" and remove it from the class attribute
- a few lines above there is a <content> tag, add class = "category-color-box" to it
- Open calendar-month-view.xml and calendar-view-core.xml and do the same
- Save the files back to calendar.jar
- Save calendar.jar back to lightning.xpi
- Install the modified lightning.xpi
If you want to see the patch, this refers to the last central-central source:
diff --git a/calendar/base/content/calendar-month-view.xml b/calendar/base/content/calendar-month-view.xml --- a/calendar/base/content/calendar-month-view.xml +++ b/calendar/base/content/calendar-month-view.xml @@ -52,21 +52,20 @@ <bindings id="calendar-month-view-bindings" xmlns="http://www.mozilla.org/xbl" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:xbl="http://www.mozilla.org/xbl"> <binding id="calendar-month-day-box-item" extends="chrome://calendar/content/calendar-view-core.xml#calendar-editable-item"> - <content mousethrough="never" tooltip="itemTooltip"> + <content mousethrough="never" tooltip="itemTooltip" class="category-color-box"> <xul:vbox flex="1"> <xul:hbox> <xul:box anonid="event-container" - class="calendar-color-box" xbl:inherits="calendar-uri,calendar-id" flex="1"> <xul:box class="calendar-event-selection" orient="horizontal" flex="1"> <xul:stack anonid="eventbox" class="calendar-event-box-container" xbl:inherits="readonly,flashing,alarm,allday,priority,progress,status,calendar,categories" flex="1"> <xul:hbox class="calendar-event-details"> diff --git a/calendar/base/content/calendar-multiday-view.xml b/calendar/base/content/calendar-multiday-view.xml --- a/calendar/base/content/calendar-multiday-view.xml +++ b/calendar/base/content/calendar-multiday-view.xml @@ -2119,20 +2119,19 @@ ]]></handler> </handlers> </binding> <!-- - An individual event box, to be inserted into a column. --> <binding id="calendar-event-box" extends="chrome://calendar/content/calendar-view-core.xml#calendar-editable-item"> - <content mousethrough="never" tooltip="itemTooltip"> + <content mousethrough="never" tooltip="itemTooltip" class="category-color-box"> <xul:box xbl:inherits="orient,width,height" flex="1"> <xul:box anonid="event-container" - class="calendar-color-box" xbl:inherits="orient,readonly,flashing,alarm,allday,priority,progress,status,calendar,categories,calendar-uri,calendar-id" flex="1"> <xul:box class="calendar-event-selection" orient="horizontal" flex="1"> <xul:stack anonid="eventbox" align="stretch" class="calendar-event-box-container" flex="1" xbl:inherits="context,parentorient=orient,readonly,flashing,alarm,allday,priority,progress,status,calendar,categories"> diff --git a/calendar/base/content/calendar-view-core.xml b/calendar/base/content/calendar-view-core.xml --- a/calendar/base/content/calendar-view-core.xml +++ b/calendar/base/content/calendar-view-core.xml @@ -46,21 +46,21 @@ xmlns="http://www.mozilla.org/xbl" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:xbl="http://www.mozilla.org/xbl"> <binding id="calendar-editable-item"> <content mousethrough="never" tooltip="itemTooltip" - tabindex="-1"> + tabindex="-1" + class="category-color-box"> <xul:vbox flex="1"> <xul:hbox> <xul:box anonid="event-container" - class="calendar-color-box" xbl:inherits="calendar-uri,calendar-id" flex="1"> <xul:box class="calendar-event-selection" orient="horizontal" flex="1"> <xul:stack anonid="eventbox" class="calendar-event-box-container" flex="1" xbl:inherits="readonly,flashing,alarm,allday,priority,progress,status,calendar,categories"> <xul:hbox class="calendar-event-details">
Option C: Change Javascript
This would be a better working hack, although it does require changes to JavaScript. Open calendar.jar as described in Option B, and check calendar-views.js, there are two functions: updateStyleSheetForViews() and updateStyleSheetForCategory() . I will leave this to people who want to work with them themselves, but the idea is to add a rule for .calendar-color-box[categories~=...] , which overrides the default rule if there are categories. Thus, if there is no set of categories, the calendar color is used, otherwise the desired category color.
Good luck :)