Files
openchamber-android-native/third_party/mygo/vibrancy.go
T
OpenChamber 6c0ee61750 feat: port the client to MyGo native UI (0.3.0)
Switch from Asuka to MyGo, keeping the API client and the feature set:

- servers: saved servers, passwordless and password login, proxy,
  self-signed certificates, per-server device tokens (Keystore), connect
  form, instance list sheet with switch/disconnect
- sessions: virtualized list, search, new session, rename/archive/delete,
  running indicator, event stream keeps it live
- chat: pushed window with system back bar, streaming Markdown via
  ui/markdown, reasoning and tool rows with image previews, footer menu
  (read aloud via a Kotlin TTS plugin, copy, fork), user message menu
  (copy, revert, fork), context usage ring and detail sheet, attachments
  (photos/files via the document picker), permissions
- release builds allow plain http:// LAN servers (Go's net/http dials
  directly, no cleartext manifest needed)
- a local fork of MyGo (third_party/mygo) lowers the Android host's
  minSdk to 24 (Android 7.0); Go 1.27.4 via mise

Version 0.3.0.
2026-11-18 13:22:59 +08:00

71 lines
2.8 KiB
Go

package mygo
// Vibrancy is a translucent material that blurs what is behind a window,
// shown behind a transparent page (see WindowOptions.Vibrancy).
//
// macOS has all of them (NSVisualEffectView materials, and from macOS 26
// Liquid Glass). Windows 11 has the Mica, Acrylic and Tabbed system
// backdrops; the other materials use the closest one: Acrylic for
// transient UI (menus, popovers, HUDs, sheets, tooltips, selection,
// full-screen UI) and Liquid Glass, Mica otherwise. On macOS, Mica and
// Tabbed use the under-window material and Acrylic the HUD one. Linux has
// none.
//
// The system draws the material with what is behind the window: other
// apps' windows, the desktop. The glass plugin
// (github.com/egoist/mygo/plugins/glass) draws Liquid Glass with what the
// window itself draws, the same on every platform.
type Vibrancy string
// Materials for window areas.
const (
VibrancyNone Vibrancy = ""
VibrancyWindow Vibrancy = "window"
VibrancyContent Vibrancy = "content"
VibrancySidebar Vibrancy = "sidebar"
VibrancyHeader Vibrancy = "header"
VibrancyTitlebar Vibrancy = "titlebar"
VibrancyUnderWindow Vibrancy = "under-window"
VibrancyUnderPage Vibrancy = "under-page"
)
// Materials for transient UI.
const (
VibrancyMenu Vibrancy = "menu"
VibrancyPopover Vibrancy = "popover"
VibrancyHUD Vibrancy = "hud"
VibrancySheet Vibrancy = "sheet"
VibrancyTooltip Vibrancy = "tooltip"
VibrancySelection Vibrancy = "selection"
VibrancyFullScreenUI Vibrancy = "fullscreen-ui"
)
// Liquid Glass, as macOS 26 draws it (NSGlassEffectView): what is behind
// the window shows through it, frosted and bent along its edges, under a
// lit rim, as through the Dock. It fills the window, rounded as
// WindowOptions.CornerRadius rounds a frameless one. Before macOS 26,
// VibrancyGlass is the popover material and VibrancyGlassClear the HUD one;
// on Windows 11 both are Acrylic.
//
// The clear glass looks clear only in a window drawn as active, the key
// window of the app in front, and frosted otherwise, as a floating panel
// over another app is: Window.SetActiveAppearance keeps it clear.
const (
// VibrancyGlass is the regular glass, frosted so that what is on it
// reads over anything: bars, panels, launchers.
VibrancyGlass Vibrancy = "glass"
// VibrancyGlassClear is the clear glass, barely frosted: over photos
// and video, where what is on it brings its own contrast.
VibrancyGlassClear Vibrancy = "glass-clear"
)
// Windows 11 system backdrops.
const (
// VibrancyMica tints the window with the desktop wallpaper.
VibrancyMica Vibrancy = "mica"
// VibrancyAcrylic blurs what is behind the window.
VibrancyAcrylic Vibrancy = "acrylic"
// VibrancyTabbed is Mica for windows with tabs in the title bar.
VibrancyTabbed Vibrancy = "tabbed"
)