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

VERIFIED FIXED in mozilla1.9.1b1

Status

()

Core
CSS Parsing and Computation
VERIFIED FIXED
9 years ago
7 years ago

People

(Reporter: mstange, Assigned: mstange)

Tracking

Trunk
mozilla1.9.1b1
All
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments, 1 obsolete attachment)

(Assignee)

Description

9 years ago
Created attachment 331915 [details] [diff] [review]
the fix
Attachment #331915 - Flags: superreview?(dbaron)
Attachment #331915 - Flags: review?(vladimir)

Comment 1

9 years ago
Hi, 
Markus = the Mac theme producers best friend 

and here is one more example why  ;-)   

many thanks
(Assignee)

Comment 2

9 years ago
Created attachment 332585 [details] [diff] [review]
make it live

Bug 447045 makes this possible.
Attachment #332585 - Flags: review?(roc)
(Assignee)

Comment 3

9 years ago
Created attachment 332586 [details]
Testcase
Attachment #332585 - Flags: review?(roc) → review+
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+
(Assignee)

Comment 5

9 years ago
(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.
(In reply to comment #5)
> According to
> http://developer.apple.com/documentation/Cocoa/Conceptual/DrawColor/Tasks/SystemTintAware.html
> it's the preferred way to do it:

ok.
Can we also add a special color to for the tint? -moz-mac-tint? We do this for several windows-only colors currently.
(Assignee)

Comment 8

9 years ago
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+
Attachment #332585 - Flags: superreview+
(Assignee)

Comment 11

9 years ago
Created attachment 337790 [details] [diff] [review]
updated patch
Attachment #331915 - Attachment is obsolete: true
(Assignee)

Updated

9 years ago
Keywords: checkin-needed
(Assignee)

Updated

9 years ago
Blocks: 422203
(Assignee)

Comment 12

9 years ago
http://hg.mozilla.org/mozilla-central/rev/86c65d62602d
http://hg.mozilla.org/mozilla-central/rev/c4147dd93eb9
Status: ASSIGNED → RESOLVED
Last Resolved: 9 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?
(Assignee)

Comment 15

9 years ago
(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.

Comment 17

8 years ago
(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.
Blocks: 450800

Updated

8 years ago
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?

Updated

8 years ago
No longer blocks: 422203
Depends on: 487393
You need to log in before you can comment on or make changes to this bug.