commit 4707e5be71d9279c8d996cd1be6988b7b175b6a6
parent deb680da9df79acfc4ed4d9d4bc1f9c64495940c
Author: Sam Johnson <sam@scj.me>
Date: Tue, 7 Oct 2025 07:32:12 +0000
Bug 1992894 - Use macOS Tahoe style in menupopups. r=desktop-theme-reviewers,emilio
In macOS Tahoe, menus use a glass effect instead of vibrancy. In addition, the metrics have changed to include more padding and increased corner radius. This patch addresses both items.
Differential Revision: https://phabricator.services.mozilla.com/D267707
Diffstat:
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/toolkit/themes/shared/menu.css b/toolkit/themes/shared/menu.css
@@ -31,6 +31,11 @@ panel {
}
@media (-moz-platform: macos) {
--menuitem-padding: 3px 9px;
+
+ @media (-moz-mac-tahoe-theme) {
+ --menuitem-padding: 4px 11px;
+ --menuitem-border-radius: 7px;
+ }
}
@media (-moz-platform: windows) {
diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm
@@ -7611,6 +7611,15 @@ static NSImage* GetMenuMaskImage() {
// vibrancy effect and window border.
- (void)setEffectViewWrapperForStyle:(WindowShadow)aStyle {
NSView* wrapper = [&]() -> NSView* {
+ if (@available(macOS 26.0, *)) {
+ if (aStyle == WindowShadow::Menu) {
+ // Menus on macOS 26 use glass instead of vibrancy.
+ auto* effectView =
+ [[NSGlassEffectView alloc] initWithFrame:self.contentView.frame];
+ effectView.cornerRadius = 12.0f;
+ return effectView;
+ }
+ }
if (aStyle == WindowShadow::Menu || aStyle == WindowShadow::Tooltip) {
const bool isMenu = aStyle == WindowShadow::Menu;
auto* effectView =