Color Coding of Tasks and Events (multiple classification)



16 years ago
10 years ago


(Reporter: andre, Assigned: Fallen)




(Whiteboard: [userChrome])


(3 attachments, 2 obsolete attachments)



16 years ago
1) Tasks and Events should be colourable
a) manually - individually
b) by Categories (assign colour to categories)
c) by Calendars
d) by Priority (Red == High etc.)

This is in the views, in the events and in the task lists. It should be possible
to switch it of individually for any one of these lists/views.

Then, what happens if multiple colours apply say, blue from the waterski
calendar and red from high priority and red from invoice from categories.

I don't know for the list views, but for the week/multi/day etc. one could
attach coloured small dots, which onmouseover reveal their meaning. (Red dot,
onhover shows "Category: invoice").
For the list views one should be able to decide on *one" classification that
"colours" events and tasks.

Comment 1

16 years ago
This might be done in a way similar to how Mail/News does message labels.
Severity: normal → enhancement

Comment 2

16 years ago
Shouldn't the platform/OS be set for all/all?

Comment 3

16 years ago
Bug 171657 seems to have one feature (color coding by categories) mentioned in
this bug. Should that bug be marked a duplicate? (Even though it was created
before this one.)

And for Raj, I'll make that Platform and OS change to "All." ;-)
OS: Windows XP → All
Hardware: PC → All

Comment 4

16 years ago
New contact from to
Filter on string OttawaMBA to get rid of these messages. 
Sorry for the spam.
Assignee: mikep → mostafah
*** Bug 222855 has been marked as a duplicate of this bug. ***

Comment 6

14 years ago
*** Bug 285332 has been marked as a duplicate of this bug. ***
QA Contact: gurganbl → general

Comment 7

13 years ago
The colorcoding of events based on the calendar-name is working perfectly, but tasks aren't colorcoded yet. The last duplicates are meant for the tasks, not for the events. 

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051104 Mozilla Sunbird/0.3a1
Reassigning all automatically assigned bugs from Mostafa to nobody@m.o

Bugspam filter: TorontoMostafaMove
Assignee: mostafah → nobody
Duplicate of this bug: 375632


12 years ago
Duplicate of this bug: 400269
Posted patch Add atoms and attributes - v1 (obsolete) β€” β€” Splinter Review
This patch adds a bunch of attributes and atoms to the task tree and view, allowing easy user or extension customization.
Assignee: nobody → philipp
Attachment #319416 - Flags: review?(Berend.Cornelius)
Posted file Example useChrome.css to modify events (obsolete) β€”
This attachments shows some examples on how one could customize their events based on certain criteria.

Comment 13

11 years ago
It will be great to have this power to control the appearance of our calendars.  Thanks a lot, Philipp.

For month view, does anyone know if it's better (e.g. more efficient) to use what I'm using now:

[item-category="Birthday"] .calendar-event-box-container {
     color: blue !important; }

or to use the example css in this bug:

.calendar-event-box-container[categories|="birthday"] {
     color: blue !important; }
Pete, the rules are pretty interchangable. It might even be worth getting rid of item-category.

the lower rule lets you handle items that have multiple categories (while not possible via interface, it should at some point. Imported ICS might contain multiple categories).

For example, if you have an item that is "Birthday" and "Personal", item-category will either contain only one of both, or "Birthday,Personal". Now you still want to color all "Birthday" items blue, independent of if they are personal or not. Using the example I attached, you can check if the item is "birthday" regardless of the other categories.

Comment 15

11 years ago
I am not about, that you moved getProgressAtom to calUtils.js since this file has meanwhile become a container for virtually everything, with more than 2300 lines of sourcecode. I can see why you did this but (you demand it from outside the taskview) but we should really try to tidy up that file.

I could see some redundant code in calendar-month-view.xml and calendar-multiday-view.xml. I think we should consolidate this somehow - probably into the "calendar-editable-item" (the common parent) of "calendar-view-core.js" and try to keep it separate.

Comment 16

11 years ago
Comment on attachment 319416 [details] [diff] [review]
Add atoms and attributes - v1

r=berend based on my previous comments
Attachment #319416 - Flags: review?(Berend.Cornelius) → review+
I decided to keep the getProgressAtom function inside calUtils, due to lack of better options. calendar-views.js might be a choice, but its not really fitting.

About duplicate code, I did consolidate it into the core binding, but I have also added a feature that again gave me duplicate code: The atoms are now also added to the unifinder, so it can also be colored.

It is a good idea to consolidate that code into a prototype that can be inherited by the task tree and the unifinder, but that would make this patch larger than needed. I have filed bug 432582 to fix that and also referenced it in the code.

Pete, I have changed back the way categories are handled, to match with what was in there before. I will attach a userChrome.css later on.
Attachment #319416 - Attachment is obsolete: true
Attachment #319734 - Flags: review?(Berend.Cornelius)

Comment 18

11 years ago
Comment on attachment 319734 [details] [diff] [review]
[checked in] Add atoms and attributes - v2

Thank you for this addtitional patch in which you consolidated some code and improved other things like the display of the category-boxes on the way.
Your new patch looks good and works as advertised. r=berend
Attachment #319734 - Flags: review?(Berend.Cornelius) → review+


11 years ago
Whiteboard: [userChrome]
Checked in on HEAD and MOZILLA_1_8_BRANCH

Last Resolved: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 0.9
This checkin probably regressed Bug 432985.
Blocks: 325701


11 years ago
Duplicate of this bug: 403615
This checkin probably regressed Bug 433352 too.

Comment 24

11 years ago
It would be nice if Lightning would automatically change text color (black\white) when background has a low contrast with text (like now with calendar colors). Do you think is possible to add this feature too?

Comment 25

11 years ago
according to one of the bugs that are marked as duplicate of this one Bug 285332 (sorry got no idea how to write this so it links .. ) this bug should cause tasks view to use the calendar colors so you can see what calendar contains the task.

however in current nightly from today that is not the case for me .. ?
(In reply to comment #25)
Have you put a corresponding rule in your userChrome.css file? I don't know the exact syntax but the last attachment above gives some samples.

Comment 27

11 years ago
ow my bad.
i thought coloring tasks according to calendar color would be default behaviour.
might i get an example how to set that up ?
the example contains only a manual color setting, not using values from calendar settings,, so i don't know how to get those. obviously i don't want to have to add all calendars manually, events do it just fine like that already :-)
This additional patch also allows (mostly extensions) to change styles based on calendar id. I chose to reopen this bug, since the last change is also for 0.9 and the change is very similar to the v2 patch.
Attachment #336837 - Flags: review?(Berend.Cornelius)


11 years ago
Resolution: FIXED → ---

Comment 29

11 years ago
Please, could you explain me if it's possible to change calendar-view properties (like day-number color or dayboxes background color etc.) on the base of calendar properties like alarm, calendar name, category etc.?
Bug 452030 was resolved as invalid because requests in there would be covered by feature added with this fixed bug, but I can't understand how to get changes as reported in attachments showed in bug 452030: changing in day-number color and day-box-date-label color when there is an event that belongs to "Holiday" calendar.


11 years ago
Attachment #336837 - Flags: review?(Berend.Cornelius) → review+

Comment 30

11 years ago
Comment on attachment 336837 [details] [diff] [review]
[checked in] Allow selection by calendar id

r=Berend; patch looks good.


11 years ago
Attachment #336837 - Attachment description: Allow selection by calendar id → [checked in] Allow selection by calendar id
Attachment #319734 - Attachment description: Add atoms and attributes - v2 → [checked in] Add atoms and attributes - v2
An example of an extension that uses this bug can be found at

Last Resolved: 11 years ago11 years ago
Resolution: --- → FIXED

Comment 32

10 years ago
Does color coding of tasks by category work in Lightning trunk or version 0.9? If yes, do I have to do it by the means of userChrome.css and how, or somehow by the UI?

At moment, I can define category colors in the UI, but they do not work for tasks, which are not colored at the moment.

Comment 33

10 years ago
This seems to work for Lightning 0.9 in the userChrome.css:

To color the category "Birthday" yellow:

.calendar-task-tree > treechildren::-moz-tree-cell-text(birthday) {
    color: yellow !important;
You need to log in before you can comment on or make changes to this bug.