Closed Bug 682541 Opened 13 years ago Closed 13 years ago

[10.7] Give search fields in window chrome the new on-chrome style on 10.7

Categories

(Core :: Widget: Cocoa, defect)

All
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla9

People

(Reporter: mstange, Assigned: mstange)

References

Details

(Keywords: polish)

Attachments

(1 file)

Attached patch v1Splinter Review
(In reply to Stephen Horlander from bug 681974 comment #0)
> Textfields on unified toolbars in Lion have a slightly different appearance
> consisting of:
> 
> - Lighter border
> - Subtle dark inner gradient
> - Subtle inner-shadow differences
Attachment #556251 - Flags: review?(joshmoz)
Summary: Give search fields in window chrome the new on-chrome style on 10.7 → [10.7] Give search fields in window chrome the new on-chrome style on 10.7
Comment on attachment 556251 [details] [diff] [review]
v1

Review of attachment 556251 [details] [diff] [review]:
-----------------------------------------------------------------

::: widget/src/cocoa/nsNativeThemeCocoa.mm
@@ +234,5 @@
> +{
> +  mContext = aContext;
> +}
> +
> +static BOOL IsWindowChrome(nsIFrame* aFrame)

I'd expect this to query the frame's content for chrome (privileged) status. This doesn't do that, it assumes certain elements are chrome. Theoretically that could be wrong, and it won't return true for all privileged content. Can you come up with a less confusing name?

@@ +262,5 @@
> +  // the searchfield is on top of of window chrome. This function is called on
> +  // 10.7 during drawing in order to determine which style to use.
> +  for (nsIFrame* frame = mContext; frame; frame = frame->GetParent()) {
> +    if (IsWindowChrome(frame))
> +      return YES;

I prefer {} around all blocks.

@@ +897,5 @@
>    DrawCellWithSnapping(cell, cgContext, inBoxRect, searchFieldSettings,
>                         VerticalAlignFactor(aFrame), mCellDrawView,
>                         IsFrameRTL(aFrame));
>  
> +  [cell setContext:nsnull];

Works for me but you might want to document this ptr management where you declare the class in order to avoid usage that leads to a dangling pointer.
Attachment #556251 - Flags: review?(joshmoz) → review+
Renamed IsWindowChrome to IsToolbarStyleContainer and added a comment.

http://hg.mozilla.org/integration/mozilla-inbound/rev/9943ca23ec8a
Whiteboard: [inbound]
http://hg.mozilla.org/mozilla-central/rev/9943ca23ec8a
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla9
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: