Closed Bug 448767 Opened 16 years ago Closed 16 years ago

[Mac] Allow themes to differentiate between Blue and Graphite system appearance color / Add -moz-system-metric(mac-graphite-theme)

Categories

(Core :: CSS Parsing and Computation, defect)

All
macOS
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.9.1b1

People

(Reporter: mstange, Assigned: mstange)

References

Details

Attachments

(3 files, 1 obsolete file)

Attached patch the fix (obsolete) — Splinter Review
      No description provided.
Attachment #331915 - Flags: superreview?(dbaron)
Attachment #331915 - Flags: review?(vladimir)
Hi, 
Markus = the Mac theme producers best friend 

and here is one more example why  ;-)   

many thanks
Attached patch make it liveSplinter Review
Bug 447045 makes this possible.
Attachment #332585 - Flags: review?(roc)
Attached file Testcase
Comment on attachment 331915 [details] [diff] [review]
the fix

>+    case eMetric_MacGraphiteTheme:
>+      aMetric = [NSColor currentControlTint] == NSGraphiteControlTint ? 1 : 0;
>+      break;

This seems a little hacky; at least comment explaining why there isn't a better way, perhaps?  It might be good to have somebody with a mac background review this bit.

Also, the " ? 1 : 0" is unneeded.  Booleans convert to integers exactly the way you want.

sr=dbaron
Attachment #331915 - Flags: superreview?(dbaron) → superreview+
(In reply to comment #4)
> This seems a little hacky; at least comment explaining why there isn't a better
> way, perhaps?

Why does it seem hacky?
According to http://developer.apple.com/documentation/Cocoa/Conceptual/DrawColor/Tasks/SystemTintAware.html it's the preferred way to do it:

> You can get the current system-wide control tint using the NSColor class
> method currentControlTint. This method returns an NSControlTint that
> represents the currently selected appearance color. Currently
> NSBlueControlTint or NSGraphiteControlTint are the possible return values
> representing the Aqua and Graphite appearances respectively.


> Also, the " ? 1 : 0" is unneeded.  Booleans convert to integers exactly the
> way you want.

Uh, yeah.
Can we also add a special color to for the tint? -moz-mac-tint? We do this for several windows-only colors currently.
I think there is already a color for that: -moz-mac-focusring
Or did you have something different in mind?
I didn't know if that was the same color as the tint. I don't use OSX very often :)
Comment on attachment 331915 [details] [diff] [review]
the fix

Gah, I hate that we're propagating these CSS selectors for themes, but I don't know of a better way to do this :(
Attachment #331915 - Flags: review?(vladimir) → review+
Attached patch updated patchSplinter Review
Attachment #331915 - Attachment is obsolete: true
Keywords: checkin-needed
Blocks: 422203
http://hg.mozilla.org/mozilla-central/rev/86c65d62602d
http://hg.mozilla.org/mozilla-central/rev/c4147dd93eb9
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1b1
Verified with Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b2) Gecko/20081201 Firefox/3.1b2 ID:20081201061100

Any focusable widget has a nice graphite tint now, except the location and search bar. But this is covered by bug 422203.
Status: RESOLVED → VERIFIED
Would even be nice to have this in Litmus.
Flags: in-litmus?
(In reply to comment #13)
> Any focusable widget has a nice graphite tint now

This is not really what this bug is about. Currently the default theme doesn't use -moz-system-metric(mac-graphite-theme), so you can't really verify it without looking at the testcase (attachment 332586 [details]).
Another way to verify it is to install the latest GrApple theme from takebacktheweb.org and look at the location bar focus ring color.
Yes, the background color of attachment 332586 [details] is changing when switching between these two modes. I've also installed the GrApple theme and everything works fine. The focus tint of the location bar changes to graphite. So this time it's really verified. Thanks for the hint, Markus.
(In reply to comment #13)
> Verified with Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US;
> rv:1.9.1b2) Gecko/20081201 Firefox/3.1b2 ID:20081201061100
> 
> Any focusable widget has a nice graphite tint now, except the location and
> search bar. But this is covered by bug 422203.

What about the Find bar that appears when you press Command + F? Shouldn't that now change accordingly? It doesn't.
(In reply to comment #17)
> What about the Find bar that appears when you press Command + F? Shouldn't that
> now change accordingly? It doesn't.

Good catch. I've added this to bug 422203.
No longer blocks: 450800
I'll remove the in-litmus flag for now. We should wait until the default theme will support -moz-system-metric completely.
Flags: in-litmus?
No longer blocks: 422203
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: