Closed
Bug 875756
Opened 12 years ago
Closed 12 years ago
Implement <input type="color">: Mac OS X widget/color picker
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: arnaud.bienner, Assigned: mounir)
References
Details
Attachments
(1 file, 2 obsolete files)
7.71 KB,
patch
|
Details | Diff | Splinter Review |
No description provided.
Reporter | ||
Updated•12 years ago
|
Assignee | ||
Comment 1•12 years ago
|
||
Assignee: arnaud.bienner → mounir
Status: NEW → ASSIGNED
Attachment #766454 -
Flags: review?(smichaud)
Comment 2•12 years ago
|
||
I haven't yet looked closely at your patch, or tested it.
But it appears to use a synchronous native dialog in a separate (app-modal) window. It should really use an asynchronous window-modal sheet. Especially since nsIColorPicker appears to have support for asynchronous use (nsIColorPicker::open() has an aCallback parameter).
Comment 3•12 years ago
|
||
Actually this patch does seem to have some asynchronous elements, though I still think the native dialog needs to be a sheet.
I'll (probably) do my review and test sometime next week.
Assignee | ||
Comment 4•12 years ago
|
||
The native Cocoa color panel is not using a sheet. Native applications do not do that. I have no idea if that is doable but that would be at best odd to users I believe.
Assignee | ||
Comment 5•12 years ago
|
||
Small update of patch to make it apply on current trunk.
Attachment #766454 -
Attachment is obsolete: true
Attachment #766454 -
Flags: review?(smichaud)
Attachment #790790 -
Flags: review?(smichaud)
Assignee | ||
Updated•12 years ago
|
Attachment #790790 -
Flags: review?(bgirard)
Assignee | ||
Comment 6•12 years ago
|
||
Comment on attachment 790790 [details] [diff] [review]
Patch
Trying some alternative reviewers given that Steven seems to have a few reviews in his queue.
Attachment #790790 -
Flags: review?(mstange)
Comment 7•12 years ago
|
||
Comment on attachment 790790 [details] [diff] [review]
Patch
Looks good except for some style issues.
> - (id) initWithPicker:(nsColorPicker*)aPicker;
^ no space here (+ similar occurrences)
> return [NSColor colorWithDeviceRed: red green: green blue: blue alpha: 1.0];
^ no space here (+ similar occurrences)
> [mColorPanel open:GetNSColorFromHexString(mColor)
> title: nsCocoaUtils::ToNSString(mTitle)];
^ align at colon, no space
Please add a new line at the end of both files.
For the hex to NSColor conversion, I'd prefer something that uses NSScanner, similarly to http://www.karelia.com/cocoa_legacy/Foundation_Categories/NSColor__Instantiat.m
But it's not important.
Also, you should probably combine the four NSString stringWithFormat invocations into one with format string @"#%02x%02x%02x".
Attachment #790790 -
Flags: review?(mstange) → review+
Comment 8•12 years ago
|
||
Comment on attachment 790790 [details] [diff] [review]
Patch
Review of attachment 790790 [details] [diff] [review]:
-----------------------------------------------------------------
I did a quick look nothing jumped out at me, except maybe that I'm sure we have a viable implementation of hex->int we could reuse.
Markus' review is enough.
Attachment #790790 -
Flags: review?(smichaud)
Attachment #790790 -
Flags: review?(bgirard)
Assignee | ||
Comment 9•12 years ago
|
||
Attachment #790790 -
Attachment is obsolete: true
Assignee | ||
Comment 10•12 years ago
|
||
Target Milestone: --- → mozilla26
Assignee | ||
Comment 11•12 years ago
|
||
(In reply to Benoit Girard (:BenWa) from comment #8)
> Comment on attachment 790790 [details] [diff] [review]
> Patch
>
> Review of attachment 790790 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> I did a quick look nothing jumped out at me, except maybe that I'm sure we
> have a viable implementation of hex->int we could reuse.
My method is using NSString and I guess converting to nsString would not be worth it.
Comment 12•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•