Add window glass effect for macOS Liquid Glass and Windows Mica#2440
Open
huacnlee wants to merge 5 commits into
Open
Add window glass effect for macOS Liquid Glass and Windows Mica#2440huacnlee wants to merge 5 commits into
huacnlee wants to merge 5 commits into
Conversation
Add WindowExt::enable_window_glass / disable_window_glass / is_window_glass_enabled to toggle the system glass window background: - macOS 26+: Liquid Glass, by embedding a native NSGlassEffectView behind the window content. - Windows 11 22H2+: Mica backdrop. - Other platforms: no-op that returns false. When enabled, the theme surface colors are made semi-transparent in three tiers (window / container / floating) to let the glass show through. The transform is applied in Theme::change, so it survives theme switching and is fully restored on disable. Also add a "Window Glass" toggle to the story settings menu, a window_glass example, and docs (en + zh-CN). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extract the editor's bottom bar into a reusable StatusBar with left/center/right regions and a StatusBarItem rendered as a ghost xsmall Button. StatusBar sets flex_shrink_0 so it keeps its height at the bottom of a flex column. Wire it into the editor example and the gallery bottom bar, add a StatusBarStory, and document it (en + zh). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This reverts commit 85799b1.
Move the platform glass implementation (macOS NSGlassEffectView / Windows Mica / no-op fallback) into a dedicated window_glass module, one file per platform. Mirror the glass-enabled state onto Theme so a full theme swap via apply_config, not just a light/dark mode switch, reapplies the translucent surface adjustments. Sidebar hover now uses an opaque mix so it stays lighter than the active item even over a translucent glass sidebar. Docs synced (en/zh-CN). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
|
Need GPUI to improve to solve round border render on glass background. zed-industries/zed#58833 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WindowExt::enable_window_glass/disable_window_glass/is_window_glass_enabledto toggle the system glass window background:NSGlassEffectViewbehind the window content (runtime class lookup, no macOS 26 SDK needed).MicaBackdrop, with a build number check so the return value is correct on older builds.false, the window stays opaque.background,title_bar,sidebar,tab_bar,table,tiles): x0.5secondary,group_box,muted,accent, list/tab/table colors, etc.): x0.7popover): x0.85Theme::change, so it survives theme switching (light/dark, custom themes) and is fully restored on disable.examples/window_glassexample.Test plan
cargo run, open the settings menu, toggle "Window Glass" on and off, switch light/dark theme while enabled.cargo run -p window_glassfor the minimal example.cargo build/cargo clippy -- --deny warnings/typospass.🤖 Generated with Claude Code