Bug 28889

Summary: Inspector toggled colors should remember their state across sessions
Product: WebKit Reporter: mitch kramer <boards>
Component: Web Inspector (Deprecated)Assignee: Timothy Hatcher <timothy>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben, joepeck, timothy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Screen Shot
none
Proposed Patch mitz: review+

mitch kramer
Reported 2009-09-01 14:08:48 PDT
In the web inspector in the nightly builds, you can now click on the color swatch to toggle through the various versions of that color. This is great, however, it should remember what state it was left in and all color references should obey that preference when using the inspector in the future.
Attachments
Screen Shot (35.36 KB, image/png)
2009-09-06 11:38 PDT, Timothy Hatcher
no flags
Proposed Patch (19.54 KB, patch)
2009-09-06 11:47 PDT, Timothy Hatcher
mitz: review+
Timothy Hatcher
Comment 1 2009-09-06 10:38:35 PDT
I have a patch for this coming up.
Timothy Hatcher
Comment 2 2009-09-06 10:40:44 PDT
The design I went with lets you toggle individual colors freely wit hno persistence, but there is now a global setting to pick the default format — Hex, RGB or HSL.
Timothy Hatcher
Comment 3 2009-09-06 11:38:40 PDT
Created attachment 39123 [details] Screen Shot
Timothy Hatcher
Comment 4 2009-09-06 11:47:29 PDT
Created attachment 39124 [details] Proposed Patch
mitz
Comment 5 2009-09-06 11:56:34 PDT
Comment on attachment 39124 [details] Proposed Patch > + swatchElement.title = WebInspector.UIString("Click to change color format."); The new style for tool tips is without a trailing period! > + if (Preferences.colorFormat === "rgb") { > + if (Preferences.showColorNicknames && color.nickname) > + format = "nickname"; > + else > + format = (color.simple ? "rgb" : "rgba"); > + } else if (Preferences.colorFormat === "hsl") { > + if (Preferences.showColorNicknames && color.nickname) > + format = "nickname"; > + else > + format = (color.simple ? "hsl" : "hsla"); > + } else { > + if (Preferences.showColorNicknames && color.nickname) > + format = "nickname"; > + else if (color.simple) > + format = (color.hasShortHex() ? "shorthex" : "hex"); > + else > + format = "rgba"; > + } You can test for the (Preferences.showColorNicknames && color.nickname) condition first instead of repeating it three times.
Timothy Hatcher
Comment 6 2009-09-06 13:45:16 PDT
Note You need to log in before you can comment on or make changes to this bug.