commit 5fcd9d3b05fad811dc216aa807b6da985d28e541
parent d2b846924263976026b7255043416bea926a2871
Author: Sam Johnson <sam@scj.me>
Date: Wed, 8 Oct 2025 08:51:35 +0000
Bug 1993148 - Update popup border radius for macOS Tahoe. r=emilio,desktop-theme-reviewers
Addressing a review comment from bug 1992894. Includes a minor refactor so that the corner radius comes from a single place.
Differential Revision: https://phabricator.services.mozilla.com/D267899
Diffstat:
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/toolkit/themes/shared/popup.css b/toolkit/themes/shared/popup.css
@@ -16,7 +16,7 @@ panel {
--panel-background: Menu;
--panel-color: MenuText;
--panel-padding: var(--panel-padding-block) 0;
- /* This should match GetMenuMaskImage() on macOS, or be overridden below */
+ /* This should match GetMenuCornerRadius() on macOS, or be overridden below */
--panel-border-radius: 6px;
--panel-padding-block: 4px;
--panel-border-color: ThreeDShadow;
@@ -55,6 +55,11 @@ panel {
--panel-border-color: transparent;
/* -moz-window-shadow does the trick on macOS */
--panel-shadow-margin: 0px;
+
+ @media (-moz-mac-tahoe-theme) {
+ /* GetMenuCornerRadius() returns a larger value on Tahoe */
+ --panel-border-radius: 12px;
+ }
}
&::part(content) {
diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm
@@ -7588,9 +7588,13 @@ static NSMutableSet* gSwizzledFrameViewClasses = nil;
return self;
}
+static CGFloat GetMenuCornerRadius() {
+ return nsCocoaFeatures::OnTahoeOrLater() ? 12.0f : 6.0f;
+}
+
// Returns an autoreleased NSImage.
static NSImage* GetMenuMaskImage() {
- const CGFloat radius = 6.0f;
+ const CGFloat radius = GetMenuCornerRadius();
const NSSize maskSize = {radius * 3.0f, radius * 3.0f};
NSImage* maskImage = [NSImage imageWithSize:maskSize
flipped:FALSE
@@ -7616,7 +7620,7 @@ static NSImage* GetMenuMaskImage() {
// Menus on macOS 26 use glass instead of vibrancy.
auto* effectView =
[[NSGlassEffectView alloc] initWithFrame:self.contentView.frame];
- effectView.cornerRadius = 12.0f;
+ effectView.cornerRadius = GetMenuCornerRadius();
return effectView;
}
}