Category color indicators should be printed

RESOLVED FIXED in 1.3

Status

defect
--
minor
RESOLVED FIXED
11 years ago
8 years ago

People

(Reporter: slorimer, Assigned: philmsgs)

Tracking

unspecified

Details

Attachments

(4 attachments)

Reporter

Description

11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13
Build Identifier: 2008033120 - Lightning plugin for Thunderbird

When I set a color for a category for an event, Sunbird displays the event with a block to the right of the event containing the category color (new in 0.8.  0.7 placed a border around the event.)  However, this color does not print.  It doesn't appear in the print preview either.

Reproducible: Always

Steps to Reproduce:
1.  Add a category / set a color for the category
2.  Try to print - category color won't print
3.
Actual Results:  
Pretty straightforward
Morphing bug to feature request.
Severity: normal → enhancement
OS: Windows XP → All
Hardware: PC → All
Summary: Sunbird/Lightning doesn't print Category color indicators → Category color indicators should be printed
Status: UNCONFIRMED → NEW
Ever confirmed: true
Duplicate of this bug: 449213
Assignee

Comment 3

8 years ago
The current code contains color printing for categories, but does not work because of a ';' missing from the declaration of style.
In this patch, 'border' is changed to 'border-right' for a report similar to the views.

See example 'sample1.png'
Attachment #581275 - Flags: review?(philipp)
Assignee

Comment 4

8 years ago
Posted image sample
Assignee: nobody → philippe.martinak
Severity: enhancement → minor
Status: NEW → ASSIGNED
Comment on attachment 581275 [details] [diff] [review]
Patch for colors printing.

>                 style += ' color: ' + cal.getContrastingTextColor(calColor);
>                 if (catColor) {
>-                    style += ' border: solid ' + catColor + ' 2px;';
>+                    style += '; border-right: solid ' + catColor + ' 7px;';
>                 }
I'd rather have each style += line add its own semicolon, I'll change this before checkin.

r=philipp
Attachment #581275 - Flags: review?(philipp) → review+
Pushed to comm-central changeset cfabf39d7be5
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.3
Assignee

Comment 7

8 years ago
The category name must be converted using 'formatStringForCSSRule' to read the color in the preferences. 
ex :
Congés => calendar.category.color.cong-uxe9-s
Attachment #584549 - Flags: review?(philipp)
Comment on attachment 584549 [details] [diff] [review]
patch formatStringForCSSRule

r=mschroeder.

Philipp, can you approve this fix for comm-aurora?
Attachment #584549 - Flags: review?(philipp)
Attachment #584549 - Flags: review+
Attachment #584549 - Flags: feedback?(philipp)
Comment on attachment 584549 [details] [diff] [review]
patch formatStringForCSSRule

approval for aurora also
Attachment #584549 - Flags: feedback?(philipp) → feedback+
(In reply to Philipp Kewisch [:Fallen] from comment #9)
> Comment on attachment 584549 [details] [diff] [review]
> patch formatStringForCSSRule
> 
> approval for aurora also

https://hg.mozilla.org/comm-central/rev/89c824683851
https://hg.mozilla.org/releases/comm-aurora/rev/7595b1a85c47
Keywords: checkin-needed
Assignee

Comment 11

8 years ago
(In reply to Philipp Kewisch [:Fallen] from comment #9)
> Comment on attachment 584549 [details] [diff] [review]
> patch formatStringForCSSRule
> 
> approval for aurora also

i replaced cat.toLowerCase() by formatStringForCSSRule(cat) in lightning 1.2b2 (+tb10) and categories colors are not printed.
(it works with 1.0b3 version i use)
when adding trace logs, formatStringForCSSRule is not defined.
(formatStringForCSSRule is defined in calendar/content/calendar/calUtils.js file)
Assignee

Comment 12

8 years ago
this patch change:
formatStringForCSSRule(cat)
to:
cal.formatStringForCSSRule(cat)

this patch solve the problem described in comment 11
Attachment #589807 - Flags: review?(philipp)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment on attachment 589807 [details] [diff] [review]
patch-formatStringForCSSRule-v2

Maybe wrong patch (changes toLowerCase to cal.formatString...), but I see what you mean. I'll change it and push in a sec.
Attachment #589807 - Flags: review?(philipp) → review+
Pushed to comm-central changeset 2970fc9537af
Status: REOPENED → RESOLVED
Closed: 8 years ago8 years ago
Resolution: --- → FIXED
Target Milestone: 1.3 → 1.4
Backported to releases/comm-aurora changeset e2828114a2d9
Target Milestone: 1.4 → 1.3
You need to log in before you can comment on or make changes to this bug.