Last Comment Bug 391984 - [10.5] Add roundness to context menus
: [10.5] Add roundness to context menus
Status: VERIFIED FIXED
[radar:5430472][polish-hard][polish-v...
: polish, verified1.9.1
Product: Core
Classification: Components
Component: Widget: Cocoa (show other bugs)
: Trunk
: PowerPC Mac OS X
: P3 minor with 6 votes (vote)
: mozilla1.9.2a1
Assigned To: Markus Stange [:mstange]
:
:
Mentors:
: 391985 414498 (view as bug list)
Depends on: 450091 469683 472734
Blocks:
  Show dependency treegraph
 
Reported: 2007-08-12 17:49 PDT by Samuel Sidler (old account; do not CC)
Modified: 2011-08-05 23:34 PDT (History)
24 users (show)
jaas: blocking1.9.1-
jaas: wanted1.9.1+
jaas: blocking1.9-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
screenshot 1 (40.05 KB, image/png)
2007-10-01 17:47 PDT, Josh Aas
no flags Details
WIP fix v0.1: Ask nsITheme if a themed frame is transparent, make the rounded corners draw inside the frame (12.73 KB, patch)
2008-08-18 16:20 PDT, Markus Stange [:mstange]
no flags Details | Diff | Splinter Review
patch v1 (12.71 KB, patch)
2008-10-14 09:14 PDT, Markus Stange [:mstange]
jaas: review+
roc: superreview+
Details | Diff | Splinter Review
fix shadow bug (782 bytes, patch)
2008-11-25 01:25 PST, Markus Stange [:mstange]
roc: review+
roc: superreview+
mbeltzner: approval1.9.1+
Details | Diff | Splinter Review

Description Samuel Sidler (old account; do not CC) 2007-08-12 17:49:50 PDT
In 10.5, context menus have rounded corners. We should have the same.
Comment 1 Colin Barrett [:cbarrett] 2007-08-22 15:27:14 PDT
I believe bug 307204 is required for us to be able to do this. Not 100% sure.
Comment 2 Josh Aas 2007-08-22 15:35:03 PDT
I don't want to "fake" that stuff with translucent windows. The rounded corners should be a window API option in 10.5, a switch we can flip. If that isn't the case we need to file an urgent bug with Apple to fix that.

Removing the dependency until we're sure these two are tied together.
Comment 3 Colin Barrett [:cbarrett] 2007-08-22 15:54:54 PDT
filed a request for rounded corners on NSWindow as rdar://problem/5430472
Comment 4 Colin Barrett [:cbarrett] 2007-08-27 09:24:56 PDT
Got a response from Apple in the bug:

We need to set the window to transparent, and then use HITHemeDrawMenuBackround to draw the background, with kThemeMenuTypePopUp as the menuType param for the MenuDrawInfo.

Should be a piece of cake.
Comment 5 Colin Barrett [:cbarrett] 2007-08-29 20:12:58 PDT
Adding CGContextClearRect() (which is what Apple suggested we use) in NS_THEME_MENUPOP and NS_THEME_MENUITEM seemed to do *something* on my 10.4 machine (added additional transparency). Tried it earlier today while sheriffing.
Comment 6 Colin Barrett [:cbarrett] 2007-10-01 15:32:11 PDT
*** Bug 391985 has been marked as a duplicate of this bug. ***
Comment 7 Josh Aas 2007-10-01 17:47:26 PDT
Created attachment 283096 [details]
screenshot 1

With the window set to .95 opacity following the steps in comments 4 and 5 leads to this (screenshot).
Comment 8 Colin Barrett [:cbarrett] 2007-10-05 19:11:14 PDT
josh do you want to take back this bug, per our discussion a few days ago?
Comment 9 Colin Barrett [:cbarrett] 2007-11-14 14:48:26 PST
With all the work we've done to on controls it would be a shame if this bug got lost in the shuffle.

Nominating for blocking so we don't forget about it (p5 would be an appropriate priority, imo)
Comment 10 Dave Townsend [:mossop] 2007-12-05 07:43:01 PST
I assume this will also take care of the blurring that appears to go on behind menus on leopard? how about the fading out of menus as they close?
Comment 11 Colin Barrett [:cbarrett] 2007-12-05 09:59:14 PST
(In reply to comment #10)
> I assume this will also take care of the blurring that appears to go on behind
> menus on leopard? how about the fading out of menus as they close?

Probably to the first, no to the second.
Comment 12 Dave Townsend [:mossop] 2007-12-05 10:08:02 PST
Filed bug 406997 for the second.
Comment 13 Josh Aas 2008-01-16 12:11:42 PST
This is a purely aesthetic issue and not a regression. blocking1.9-
Comment 14 :Gavin Sharp [email: gavin@gavinsharp.com] 2008-01-29 09:46:11 PST
*** Bug 414498 has been marked as a duplicate of this bug. ***
Comment 15 Stefan [:stefanh] 2008-02-16 14:30:24 PST
Any update on the status of the radar bug? I tried the steps in comment #4 and comment #5 on 10.5.2, but no rounded corners :-/
Comment 16 Josh Aas 2008-06-13 11:32:12 PDT
I can't imagine blocking on this but we want it for sure.
Comment 17 Markus Stange [:mstange] 2008-08-11 08:05:52 PDT
I'll work on this when bug 418454 lands (it changes some stuff about frame transparency).
Comment 18 Markus Stange [:mstange] 2008-08-18 16:20:30 PDT
Created attachment 334362 [details] [diff] [review]
WIP fix v0.1: Ask nsITheme if a themed frame is transparent, make the rounded corners draw inside the frame

This patch is on top of those in bug 450939 and bug 450944.
I haven't tested in on 10.4 yet, it might mess things up.
Comment 19 Markus Stange [:mstange] 2008-08-26 05:55:33 PDT
The patch works on 10.4, too. Even there, HIThemeDrawMenuBackground draws outside the frame (i.e. the drawn rect extends 4px above and below the requested rect).
Comment 20 Stefan [:stefanh] 2008-08-26 07:59:25 PDT
Do we really want it on 10.4?
Comment 21 Markus Stange [:mstange] 2008-08-26 08:03:45 PDT
The patch doesn't result in rounded corners on 10.4, HIThemeDrawMenuBackground does its job quite well. :-)

In comment 19 I meant to say that it doesn't break 10.4, i.e. it doesn't change the context menu's size there, although we make the drawRect smaller.
Comment 22 Markus Stange [:mstange] 2008-10-14 08:52:56 PDT
(In reply to comment #10)
> I assume this will also take care of the blurring that appears to go on behind
> menus on leopard?

It won't. And there's no way of doing that without using private, undocumented methods. :-(
Comment 23 Markus Stange [:mstange] 2008-10-14 09:14:40 PDT
Created attachment 343058 [details] [diff] [review]
patch v1
Comment 24 Robert O'Callahan (:roc) (email my personal email if necessary) 2008-10-14 21:36:41 PDT
Comment on attachment 343058 [details] [diff] [review]
patch v1

+    if (aTransparencyMode)
+      *aTransparencyMode = theme->GetWidgetTransparency(aDisp->mAppearance);

braces arond this non-control-flow statement
Comment 25 Markus Stange [:mstange] 2008-11-20 14:25:27 PST
Comment on attachment 343058 [details] [diff] [review]
patch v1

This patch isn't ready. :(
I just tested it again and noticed that it eats the shadow of XUL popup menus...
Comment 26 Paweł Kondzior 2008-11-21 07:53:19 PST
(In reply to comment #22)
> (In reply to comment #10)
> > I assume this will also take care of the blurring that appeas to go on behind
> > menus on leopard?
> 
> It won't. And there's no way of doing that without using private, undocumented
> methods. :-(
If aero glass was possible, maybe this is possible too ? As i look at latest iTerm.app code (with has abbility to set blur for transparent background) in cocoa you need only set prepared window filter with blur radious.
Comment 27 Markus Stange [:mstange] 2008-11-25 01:25:25 PST
Created attachment 349939 [details] [diff] [review]
fix shadow bug

For some reason, mIsTransparent isn't set correctly on the view. I need to find out why that's the case, but for now this patch works.
Comment 28 Markus Stange [:mstange] 2008-11-25 01:33:58 PST
(In reply to comment #26)
iTerm.app uses CGSAddWindowFilter; that's the private function I was referring to.
Comment 29 Markus Stange [:mstange] 2008-12-11 06:53:03 PST
pushed: http://hg.mozilla.org/mozilla-central/rev/58f409bbc149
Comment 30 Mike Beltzner [:beltzner, not reading bugmail] 2008-12-11 11:08:37 PST
Comment on attachment 349939 [details] [diff] [review]
fix shadow bug

a191=beltzner
Comment 31 Markus Stange [:mstange] 2008-12-15 06:47:44 PST
pushed to mozilla-1.9.1:
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/55582aea3232
Comment 32 Tony Chung [:tchung] 2009-01-29 10:31:35 PST
Verified fix on Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20090129 Shiretoko/3.1b3pre Ubiquity/0.1.5
and 
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090129 Minefield/3.2a1pre

10.4 builds still show square corners as expected.
Comment 33 Simon Howes 2009-02-18 16:01:46 PST
Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090218 Minefield/3.2a1pre


My PPC machines have square corners under Leopard.
Comment 34 Alex Faaborg [:faaborg] (Firefox UX) 2009-06-23 00:25:21 PDT
This bug's priority relative to the set of other polish bugs is:
P2 - Polish issue that is in a secondary interface, occasionally encountered, and is easily identifiable.

Context menus are a secondary interface, however this issue was widely reported on OS X as a polish problem.

Note You need to log in before you can comment on or make changes to this bug.