Skip to content

fix: 菜单栏图标 Mira 风格半透明填充(真实 alpha,非 template) - #11

Open
KDF5000 wants to merge 2 commits into
mainfrom
agent/traex-seed-2-1-turbo/445f9555
Open

fix: 菜单栏图标 Mira 风格半透明填充(真实 alpha,非 template)#11
KDF5000 wants to merge 2 commits into
mainfrom
agent/traex-seed-2-1-turbo/445f9555

Conversation

@KDF5000

@KDF5000 KDF5000 commented Jul 30, 2026

Copy link
Copy Markdown
Owner

变更

调整菜单栏图标样式,参考 Mira 等应用的图标风格:

  • 粘贴板内部使用真实的 alpha = 0.18 半透明浅填充:浅色菜单栏下呈现淡淡浅灰,深色菜单栏下呈现淡淡半透明白
  • 不再使用 isTemplate = true —— 因为 macOS 模板图会把 alpha 渐变全部压成同色前景色,导致半透明填充实际等同于完全镂空(之前对比图看不出填充就是这个原因)
  • 改用 SwiftUI @Environment(\\.colorScheme) + NSViewRepresentable 自定义绘制,感知明/暗模式自动切换前景色
  • 粘贴板里保留两条文字横线,更像文档/粘贴板

对比:

  1. 原版:黑底 + 白色实心粘贴板 → 浅色菜单栏白色块突兀
  2. PR fix: 菜单栏图标改为镂空(template)样式 #10 方案:黑外框 + 粘贴板内部完全镂空
  3. 本 PR:黑外框 + 粘贴板内部真实 alpha 半透明填充 + 双行文本条 → Mira 风格

验证

swift build 通过。

Closes XCO-25

…style)

Change the menu bar icon from fully transparent cutout to a semi-
transparent fill inside the outline (alpha 0.15) to match the look
of Mira and similar menu bar icons, where the inner area is not
purely transparent but a subtle tint of the foreground color.

- Keeps isTemplate = true so the icon auto-adapts to light/dark bar
- Uses alpha on the black fill of the clipboard body; system renders
  it as a lightly tinted foreground (faint gray on light, faint
  white-ish on dark) instead of a full cutout
- Adds a second text bar inside the clipboard so it reads more like
  a document instead of a single-line card

Co-authored-by: TRAE CLI <noreply@bytedance.com>
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
x-copy Ready Ready Preview Jul 30, 2026 2:34am

…template images)

`NSImage.isTemplate = true` collapses every alpha gradient into the same
full-opacity foreground tint, so the earlier commit's "alpha 0.15 fill"
was never visually different from the fully-transparent even-odd cutout.
That's why the preview looked like it still had no fill.

Drop template mode entirely and draw the icon explicitly:
- Introduce a SwiftUI ColorScheme-aware NSView that renders the icon
  using resolved black/white, and composites the clipboard body with
  real alpha (0.18) on top of the outline — now the body visibly shows
  as a lighter shade of the outline, matching the Mira-style fill.
- Light menu bar → black outline + faintly darker clipboard body
- Dark menu bar → white outline + faintly lighter clipboard body

Reported-by: user feedback on XCO-25 (the comparison preview showed no fill)

Co-authored-by: TRAE CLI <noreply@bytedance.com>
@KDF5000 KDF5000 changed the title fix: 调整菜单栏图标为 Mira 风格半透明填充效果 fix: 菜单栏图标 Mira 风格半透明填充(真实 alpha,非 template) Jul 30, 2026
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