Skip to content

feat: draw widgets, popups and the bar with Liquid Glass - #98

Merged
Seb-GRAF merged 1 commit into
mainfrom
feat/67-liquid-glass
Oct 19, 2026
Merged

Seb-GRAF merged 1 commit into
mainfrom
feat/67-liquid-glass

Conversation

@Seb-GRAF

@Seb-GRAF Seb-GRAF commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

StableBar could only paint solid or translucent colors, so it couldn't match macOS 26's Liquid Glass. Fixes #67.

Changes

  • bar.glass setting. enabled (off by default), transparency (0 to 1, default 0.3), and widgets, popups and bar switches (on by default). Unknown keys are rejected, transparency must be between 0 and 1, and the schema has a matching glass definition, registered in the schema parity test. Because it lives under bar, themes, includes and profiles can set it like any bar setting.
  • GlassBackground modifier. Draws the background of widget tiles, popups, the bar and Customize's theme cards. When glass covers a surface whose background is visible in the current appearance, it draws Apple's clear glass behind the content and the background color over it at 1 − transparency. Otherwise it draws the color as before. Drawing the state's color as that layer keeps hover, open and data-state colors.
  • Why clear glass, and why a separate layer. Regular glass switches small elements between light and dark to match what is behind them, separately per tile and again after a click. SwiftUI also recolors content placed inside glass. Together they turned theme colors brown on click, or left cream text on white glass. Clear glass doesn't adapt and expects a dimming layer, which the theme's color provides, and content outside the glass keeps its exact colors.
  • Active glass. BarPanel and PopupPanel return true from AppKit's undocumented hasKeyAppearance. SwiftUI renders glass in a window without key appearance with refraction opacity 0 and no outer refraction or edge shadow, and the bar panel can never become key. With the override, SwiftUI uses its active parameters. Keyboard focus is unchanged: the bar still can't become key. If a macOS update drops the method, glass falls back to the flat look.
  • Clip order. The bar and popups clip their content and then draw the background, instead of the reverse, so the glass isn't clipped. Plain colors draw the same pixels.
  • Customize → Appearance. A Liquid Glass section below Theme, marked experimental: an on/off switch, then a See-through slider and the surface switches. StyleFields gains toggle and percentage rows with the usual origin and reset links.
  • README. A Liquid Glass section after Themes, and the Customize paragraph.

Testing

  • swift test: 296 tests passed.
  • Offscreen, I compared SwiftUI's glassBackground filter inputs with and without the override. inputRefractionOpacity goes from 0 to 0.3, and outer refraction, edge shadow and blur change. isKeyWindow alone changes nothing.
  • On a live bar (Terminal theme, dark appearance, macOS 26), session-only --batch edits left the configuration file untouched:
    • With glass off, the tiles are pixel-identical to a capture taken before the change.
    • With regular glass, the tile over the brightest part of the wallpaper turned white while the others stayed dark.
    • With clear glass at 30%, 50% and 70% see-through, every tile matches, the wallpaper shows through with edge refraction, and theme colors stay exact. Text gets harder to read above about 50% over a bright wallpaper.
  • Not checked: clicking tiles with the final version (the session has no Accessibility access), hover and popups with glass, the Customize section on screen, the system "Tinted" Liquid Glass setting, and macOS 14/15. Those systems take the original color path.

Screenshots: before and after captures of the bar are local. They'll be added in a comment, since images can't be uploaded from this session.

Merging

One commit; a merge commit keeps it in the changelog as a feat.

Claude Opus 5.5 via Claude Code

@Seb-GRAF
Seb-GRAF force-pushed the feat/67-liquid-glass branch from 9c253d8 to 7f2310f Compare October 19, 2026 07:14
@Seb-GRAF
Seb-GRAF merged commit f9a5cf1 into main Oct 19, 2026
7 of 8 checks passed
@Seb-GRAF
Seb-GRAF deleted the feat/67-liquid-glass branch October 19, 2026 07:21
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Draw widgets, popups and the bar with macOS Liquid Glass on any theme

1 participant