Closed Bug 1700148 Opened 4 years ago Closed 4 years ago

[Proton][Windows] add Windows native shadow back to context menu

Categories

(Firefox :: Menus, enhancement, P1)

Desktop
All
enhancement

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: Gijs, Assigned: enndeakin)

References

(Blocks 1 open bug)

Details

(Whiteboard: [proton-context-menus])

Attachments

(2 files)

I believe Neil has a patch that would allow us to add a native shadow to the context menu again.

Whiteboard: [proton-modals]

Neil, would you mind taking this / sharing your patch? :-)

Flags: needinfo?(enndeakin)

I can work on this, but I don't have a patch yet. I just did hardcoded a quick test to see what it would look like.

Assignee: nobody → enndeakin
Status: NEW → ASSIGNED
Flags: needinfo?(enndeakin)
Whiteboard: [proton-modals] → [proton-context-menus]

So the existing style has the border radius on the arrowscrollbox not on the popup itself, meaning some manual finding of elements would be necessary. Is it possible to move the radius to the popup instead?

Also, border-radius supports a wide variety of options: different width/height, different values of each corner, etc. Do we care about handling any of this or should we just limit it and guess that whatever one corner is set to is the value for all of the corners? Although it is possible to create more complex shapes such as different borders at each edge with a dropshadow, the basic rounding rect Windows API for this (CreateRoundRectRgn) only handles a width and height that is the same for all four corners.

Or, should we just hard-code the 4 pixels directly , possibly using a special 'appearance' value to enable it, and not worry about making this more flexible?

Flags: needinfo?(gijskruitbosch+bugs)

(In reply to Neil Deakin from comment #3)

So the existing style has the border radius on the arrowscrollbox not on the popup itself, meaning some manual finding of elements would be necessary. Is it possible to move the radius to the popup instead?

I think so, though the border itself would then also want to move.

Also, border-radius supports a wide variety of options: different width/height, different values of each corner, etc. Do we care about handling any of this or should we just limit it and guess that whatever one corner is set to is the value for all of the corners? Although it is possible to create more complex shapes such as different borders at each edge with a dropshadow, the basic rounding rect Windows API for this (CreateRoundRectRgn) only handles a width and height that is the same for all four corners.

Or, should we just hard-code the 4 pixels directly , possibly using a special 'appearance' value to enable it, and not worry about making this more flexible?

At this point I think I'm happy to do whatever is easiest to implement. I would be fine with either completely hardcoding or reading the radius on one corner and assuming it's the same elsewhere. I don't think we should worry about more complex shapes or different values for different corners.

Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(enndeakin)

I spent a lot of time trying to get the border-radius on the popup instead of the inner box, but I couldn't seem to get it to render the rounded corners properly with the dropshadow. I don't want to spend more time on it so instead I hard-coded the size in nsWindow.cpp. The rendering looks ok, but there is still an issue with modified dpi values in that there is a thin white strip in the right and bottom sides.

Flags: needinfo?(enndeakin)

The latest version is less hard-coded and puts the border radius on the menupopup, but the border is still drawn by the inner box.

Attachment #9211662 - Attachment description: WIP: Bug 1700148, add dropshadow to windows 10 menus → Bug 1700148, add an appearance type that forces a dropshadow on menus on Windows, and uses SetWindowRgn to clip the popup to the border radius, r=tnikkel
Attachment #9211662 - Attachment description: Bug 1700148, add an appearance type that forces a dropshadow on menus on Windows, and uses SetWindowRgn to clip the popup to the border radius, r=tnikkel → Bug 1700148, add an appearance type that forces a dropshadow on menus on Windows, and uses SetWindowRgn to clip the popup to the border radius, r=tnikkel,emilio
Pushed by neil@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/39b38c8cd03b add an appearance type that forces a dropshadow on menus on Windows, and uses SetWindowRgn to clip the popup to the border radius, r=tnikkel https://hg.mozilla.org/integration/autoland/rev/4731fcb3e98b assign a dropshadow and border radius on menus on Windows 10, r=Gijs
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
Regressions: 1702810
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: