Skip to content

Add window opacity setting#52

Open
leiyangyou wants to merge 1 commit intolcoutodemos:mainfrom
leiyangyou:feature/window-opacity
Open

Add window opacity setting#52
leiyangyou wants to merge 1 commit intolcoutodemos:mainfrom
leiyangyou:feature/window-opacity

Conversation

@leiyangyou
Copy link
Copy Markdown

Summary

  • Adds a window opacity slider (20–100%) to the Settings popover, allowing users to make the overlay translucent
  • Opacity is persisted in localStorage and restored on startup via BrowserWindow.setOpacity()
  • Introduces SET_WINDOW_OPACITY IPC channel with proper clamping (0.2–1.0)
  • Refactors saveSettings() calls to use a currentSettings() helper, reducing repetition

Details

  • src/shared/types.ts — new SET_WINDOW_OPACITY IPC constant
  • src/main/index.ts — IPC listener calling mainWindow.setOpacity()
  • src/preload/index.ts — exposes setWindowOpacity() on the CluiAPI bridge
  • src/renderer/theme.tswindowOpacity state in Zustand store, persistence, startup restore
  • src/renderer/components/SettingsPopover.tsx — opacity slider UI with Drop icon

Test plan

  • Launch app → verify default opacity is 100%
  • Drag slider to ~60% → window becomes translucent
  • Quit and relaunch → opacity persists at 60%
  • Set back to 100% → fully opaque
  • Verify slider range is clamped between 20% and 100%

🤖 Generated with Claude Code

Upstream now handles window dragging (PR lcoutodemos#48), so this patch retains only
the opacity feature: a settings slider (20-100%) that calls
BrowserWindow.setOpacity(), persisted in localStorage and restored on
startup. Also introduces a currentSettings() helper to reduce repetition
in saveSettings calls.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant