Skip to content

Doubao-powered voice input for Linux, Wayland and Omarchy

fix(icons): unify macOS and Linux app artwork (#85)

Leyang61abfb6cc227
diff --git a/macos/Packaging/Icon.swift b/macos/Packaging/Icon.swift
index aa99d31..f418fef 100644
--- a/macos/Packaging/Icon.swift
+++ b/macos/Packaging/Icon.swift
@@ -2,25 +2,16 @@ import AppKit
import Foundation
let directory = URL(fileURLWithPath: CommandLine.arguments[1])
try FileManager.default.createDirectory(at: directory, withIntermediateDirectories: true)
+// The PNG is generated from ui/bunspeak.svg; Linux, website, and macOS share the artwork.
+let source = URL(fileURLWithPath: #filePath).deletingLastPathComponent()
+ .appendingPathComponent("../../src/doubao_input/resources/logo.png").standardizedFileURL
+let artwork = NSImage(contentsOf: source)!
for size in [16, 32, 64, 128, 256, 512, 1024] {
let bitmap = NSBitmapImageRep(bitmapDataPlanes: nil, pixelsWide: size, pixelsHigh: size, bitsPerSample: 8, samplesPerPixel: 4, hasAlpha: true, isPlanar: false, colorSpaceName: .deviceRGB, bytesPerRow: 0, bitsPerPixel: 0)!
NSGraphicsContext.saveGraphicsState()
NSGraphicsContext.current = NSGraphicsContext(bitmapImageRep: bitmap)
- let scale = CGFloat(size) / 1024
- let transform = NSAffineTransform(); transform.scale(by: scale); transform.concat()
- let background = NSBezierPath(roundedRect: NSRect(x: 30, y: 30, width: 964, height: 964), xRadius: 218, yRadius: 218)
- NSGradient(starting: NSColor(calibratedRed: 0.07, green: 0.68, blue: 0.65, alpha: 1), ending: NSColor(calibratedRed: 0.03, green: 0.32, blue: 0.52, alpha: 1))!.draw(in: background, angle: -60)
- NSColor.white.setFill()
- NSBezierPath(roundedRect: NSRect(x: 420, y: 415, width: 184, height: 360), xRadius: 92, yRadius: 92).fill()
- let cradle = NSBezierPath()
- cradle.move(to: NSPoint(x: 330, y: 552))
- cradle.curve(to: NSPoint(x: 694, y: 552), controlPoint1: NSPoint(x: 330, y: 258), controlPoint2: NSPoint(x: 694, y: 258))
- cradle.lineWidth = 48; cradle.lineCapStyle = .round; NSColor.white.setStroke(); cradle.stroke()
- let stem = NSBezierPath(); stem.move(to: NSPoint(x: 512, y: 332)); stem.line(to: NSPoint(x: 512, y: 245)); stem.lineWidth = 48; stem.lineCapStyle = .round; stem.stroke()
- NSBezierPath(roundedRect: NSRect(x: 410, y: 218, width: 204, height: 48), xRadius: 24, yRadius: 24).fill()
- for (x, height) in [(220.0, 118.0), (760.0, 118.0)] {
- NSBezierPath(roundedRect: NSRect(x: x, y: 495, width: 44, height: height), xRadius: 22, yRadius: 22).fill()
- }
+ NSGraphicsContext.current?.imageInterpolation = .high
+ artwork.draw(in: NSRect(x: 0, y: 0, width: size, height: size))
NSGraphicsContext.restoreGraphicsState()
let png = bitmap.representation(using: .png, properties: [:])!
try png.write(to: directory.appendingPathComponent("render_\(size).png"))
diff --git a/src/doubao_input/resources/logo-128.png b/src/doubao_input/resources/logo-128.png
index b8c750d..2d0a23d 100644
Binary files a/src/doubao_input/resources/logo-128.png and b/src/doubao_input/resources/logo-128.png differ
diff --git a/src/doubao_input/resources/logo.png b/src/doubao_input/resources/logo.png
index 175cf07..0098ee0 100644
Binary files a/src/doubao_input/resources/logo.png and b/src/doubao_input/resources/logo.png differ
diff --git a/src/doubao_input/ui/bunspeak.svg b/src/doubao_input/ui/bunspeak.svg
index 49d661e..29084cc 100644
--- a/src/doubao_input/ui/bunspeak.svg
+++ b/src/doubao_input/ui/bunspeak.svg
@@ -1,5 +1,24 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128">
- <rect width="128" height="128" rx="30" fill="#1a1b26"/>
- <path d="M24 76c0-25 17-44 40-44s40 19 40 44c0 17-16 25-40 25S24 93 24 76Z" fill="#7aa2f7"/>
- <path d="m50 32 14 10 14-10M44 67v10m13-19v29m14-24v19m13-15v10" fill="none" stroke="#1a1b26" stroke-width="6" stroke-linecap="round" stroke-linejoin="round"/>
+<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 128 128">
+ <defs>
+ <linearGradient id="bun" x1="0" y1="0" x2="1" y2="1">
+ <stop stop-color="#A9D5FF"/><stop offset="1" stop-color="#7295E8"/>
+ </linearGradient>
+ <clipPath id="body">
+ <path d="M23 78c0-20 11-35 27-41-3-7 2-12 8-9l6 3 6-3c6-3 11 2 8 9 16 6 27 21 27 41 0 19-17 25-41 25S23 97 23 78Z"/>
+ </clipPath>
+ </defs>
+ <rect width="128" height="128" rx="29" fill="#FFF"/>
+ <g clip-path="url(#body)">
+ <rect x="20" y="24" width="88" height="82" fill="url(#bun)"/>
+ <ellipse cx="48" cy="39" rx="55" ry="35" fill="#D9EEFF" opacity=".42"/>
+ <ellipse cx="92" cy="101" rx="52" ry="36" fill="#6C8DDD" opacity=".22"/>
+ </g>
+ <path d="m54 39 10 6 10-6" fill="none" stroke="#DCEEFF" stroke-width="4.5" stroke-linecap="round" stroke-linejoin="round"/>
+ <g fill="#FFF">
+ <rect x="40" y="68" width="6" height="12" rx="3"/>
+ <rect x="50.5" y="63" width="6" height="22" rx="3"/>
+ <rect x="61" y="57" width="6" height="34" rx="3"/>
+ <rect x="71.5" y="63" width="6" height="22" rx="3"/>
+ <rect x="82" y="68" width="6" height="12" rx="3"/>
+ </g>
</svg>