diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index f646c13f8512..118c88222c7f 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -2484,9 +2484,10 @@ FindTitlebarBottom(const nsTArray& aThemeGeometries, int32_t aWindowWidth) { int32_t titlebarBottom = 0; - for (uint32_t i = 0; i < aThemeGeometries.Length(); ++i) { - const nsIWidget::ThemeGeometry& g = aThemeGeometries[i]; - if ((g.mType == nsNativeThemeCocoa::eThemeGeometryTypeTitlebar) && + for (auto& g : aThemeGeometries) { + if ((g.mType == nsNativeThemeCocoa::eThemeGeometryTypeTitlebar || + g.mType == nsNativeThemeCocoa::eThemeGeometryTypeVibrantTitlebarLight || + g.mType == nsNativeThemeCocoa::eThemeGeometryTypeVibrantTitlebarDark) && g.mRect.X() <= 0 && g.mRect.XMost() >= aWindowWidth && g.mRect.Y() <= 0) { @@ -2565,8 +2566,10 @@ ThemeGeometryTypeToVibrancyType(nsITheme::ThemeGeometryType aThemeGeometryType) { switch (aThemeGeometryType) { case nsNativeThemeCocoa::eThemeGeometryTypeVibrancyLight: + case nsNativeThemeCocoa::eThemeGeometryTypeVibrantTitlebarLight: return Some(VibrancyType::LIGHT); case nsNativeThemeCocoa::eThemeGeometryTypeVibrancyDark: + case nsNativeThemeCocoa::eThemeGeometryTypeVibrantTitlebarDark: return Some(VibrancyType::DARK); case nsNativeThemeCocoa::eThemeGeometryTypeSheet: return Some(VibrancyType::SHEET); diff --git a/widget/cocoa/nsNativeThemeCocoa.h b/widget/cocoa/nsNativeThemeCocoa.h index 14d21e1d4e0e..e55027b78455 100644 --- a/widget/cocoa/nsNativeThemeCocoa.h +++ b/widget/cocoa/nsNativeThemeCocoa.h @@ -38,6 +38,8 @@ public: eThemeGeometryTypeHighlightedMenuItem, eThemeGeometryTypeVibrancyLight, eThemeGeometryTypeVibrancyDark, + eThemeGeometryTypeVibrantTitlebarLight, + eThemeGeometryTypeVibrantTitlebarDark, eThemeGeometryTypeTooltip, eThemeGeometryTypeSheet, eThemeGeometryTypeSourceList, diff --git a/widget/cocoa/nsNativeThemeCocoa.mm b/widget/cocoa/nsNativeThemeCocoa.mm index eb06a775b8c0..927cd7176f91 100644 --- a/widget/cocoa/nsNativeThemeCocoa.mm +++ b/widget/cocoa/nsNativeThemeCocoa.mm @@ -2969,7 +2969,9 @@ nsNativeThemeCocoa::DrawWidgetBackground(gfxContext* aContext, break; case NS_THEME_MAC_VIBRANCY_LIGHT: - case NS_THEME_MAC_VIBRANCY_DARK: { + case NS_THEME_MAC_VIBRANCY_DARK: + case NS_THEME_MAC_VIBRANT_TITLEBAR_LIGHT: + case NS_THEME_MAC_VIBRANT_TITLEBAR_DARK: { ThemeGeometryType type = ThemeGeometryTypeForWidget(aFrame, aWidgetType); DrawVibrancyBackground(cgContext, macRect, aFrame, type); break; @@ -3143,7 +3145,9 @@ nsNativeThemeCocoa::CreateWebRenderCommandsForWidget(mozilla::wr::DisplayListBui return false; case NS_THEME_MAC_VIBRANCY_LIGHT: - case NS_THEME_MAC_VIBRANCY_DARK: { + case NS_THEME_MAC_VIBRANCY_DARK: + case NS_THEME_MAC_VIBRANT_TITLEBAR_LIGHT: + case NS_THEME_MAC_VIBRANT_TITLEBAR_DARK: { ThemeGeometryType type = ThemeGeometryTypeForWidget(aFrame, aWidgetType); aBuilder.PushRect(bounds, bounds, true, wr::ToColorF(VibrancyFillColor(aFrame, type))); @@ -3736,6 +3740,8 @@ nsNativeThemeCocoa::WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType, case NS_THEME_METERCHUNK: case NS_THEME_MAC_VIBRANCY_LIGHT: case NS_THEME_MAC_VIBRANCY_DARK: + case NS_THEME_MAC_VIBRANT_TITLEBAR_LIGHT: + case NS_THEME_MAC_VIBRANT_TITLEBAR_DARK: *aShouldRepaint = false; return NS_OK; } @@ -3898,6 +3904,8 @@ nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* a case NS_THEME_MAC_VIBRANCY_LIGHT: case NS_THEME_MAC_VIBRANCY_DARK: + case NS_THEME_MAC_VIBRANT_TITLEBAR_LIGHT: + case NS_THEME_MAC_VIBRANT_TITLEBAR_DARK: return VibrancyManager::SystemSupportsVibrancy(); } @@ -4005,6 +4013,8 @@ nsNativeThemeCocoa::NeedToClearBackgroundBehindWidget(nsIFrame* aFrame, case NS_THEME_MAC_ACTIVE_SOURCE_LIST_SELECTION: case NS_THEME_MAC_VIBRANCY_LIGHT: case NS_THEME_MAC_VIBRANCY_DARK: + case NS_THEME_MAC_VIBRANT_TITLEBAR_LIGHT: + case NS_THEME_MAC_VIBRANT_TITLEBAR_DARK: case NS_THEME_TOOLTIP: case NS_THEME_MENUPOPUP: case NS_THEME_MENUITEM: @@ -4035,6 +4045,10 @@ nsNativeThemeCocoa::ThemeGeometryTypeForWidget(nsIFrame* aFrame, uint8_t aWidget return eThemeGeometryTypeVibrancyLight; case NS_THEME_MAC_VIBRANCY_DARK: return eThemeGeometryTypeVibrancyDark; + case NS_THEME_MAC_VIBRANT_TITLEBAR_LIGHT: + return eThemeGeometryTypeVibrantTitlebarLight; + case NS_THEME_MAC_VIBRANT_TITLEBAR_DARK: + return eThemeGeometryTypeVibrantTitlebarDark; case NS_THEME_TOOLTIP: return eThemeGeometryTypeTooltip; case NS_THEME_MENUPOPUP: