Skip to content

Commit a69539f

Browse files
committed
Update tray icon files and guidelines for macOS compatibility
- Added new monochrome icon (icon-mono-44.png) for better integration on macOS. - Updated documentation to reflect new icon sizes and OS-specific requirements. - Modified tray code to embed the new icon and ensure proper display across platforms.
1 parent 6947ce6 commit a69539f

6 files changed

Lines changed: 24 additions & 18 deletions

File tree

TRAY_ICON_GUIDE.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ If you're not seeing the tray icon on macOS, it's because the icon wasn't embedd
6262

6363
1. **Added icon files** to `internal/tray/`:
6464
- `icon-32.png` - Color version (32x32 pixels)
65-
- `icon-mono-32.png` - Monochrome version (often works better on macOS)
65+
- `icon-mono-44.png` - Monochrome version (44x44 pixels, works better on macOS)
6666

6767
2. **Updated tray code** to embed and use the icon:
6868
```go
69-
//go:embed icon-mono-32.png
69+
//go:embed icon-mono-44.png
7070
var iconData []byte
7171

7272
func (a *App) onReady() {
@@ -133,13 +133,15 @@ export MCPPROXY_LISTEN=:8080
133133

134134
## Icon Design Guidelines
135135

136-
### macOS Specific Requirements
136+
### OS Specific Requirements
137137

138-
- **Size**: 16x16 or 32x32 pixels (the system will scale as needed)
139-
- **Format**: PNG with transparency
140-
- **Color**: Monochrome icons often work better and adapt to system theme
141-
- **Style**: Simple, high contrast designs work best
142-
- **Template**: Consider using template images that adapt to dark/light modes
138+
- **macOS**: 44x44 pixels, transparent PNG. For dynamic adaptation to light/dark system themes, the icon should be black with only an alpha channel.
139+
- **Windows**: 32x32 pixels.
140+
- **Linux**: 24x24 pixels.
141+
- **Format**: PNG with transparency is generally recommended.
142+
- **Color**: Monochrome icons often work better and adapt to system theme on macOS.
143+
- **Style**: Simple, high contrast designs work best.
144+
- **Template**: Consider using template images that adapt to dark/light modes.
143145

144146
### Current Icons
145147

@@ -150,7 +152,7 @@ The project includes two icon versions:
150152
- Represents the proxy concept visually
151153
- Good for branded applications
152154

153-
2. **Monochrome Icon** (`icon-mono-32.png`):
155+
2. **Monochrome Icon** (`icon-mono-44.png`):
154156
- Black and white design
155157
- Better system integration on macOS
156158
- Adapts to system theme changes
@@ -159,15 +161,15 @@ The project includes two icon versions:
159161

160162
### Option 1: Replace Existing Icon
161163

162-
1. **Create your icon** (32x32 PNG recommended):
164+
1. **Create your icon** (44x44 PNG recommended for macOS):
163165
```bash
164-
# Using your preferred graphics editor, create a 32x32 PNG
165-
# Save it as icon-mono-32.png
166+
# Using your preferred graphics editor, create a 44x44 PNG
167+
# Save it as icon-mono-44.png
166168
```
167169

168170
2. **Replace the embedded icon**:
169171
```bash
170-
cp your-custom-icon.png internal/tray/icon-mono-32.png
172+
cp your-custom-icon.png internal/tray/icon-mono-44.png
171173
```
172174

173175
3. **Rebuild**:
@@ -221,7 +223,7 @@ To use the color version instead:
221223

222224
3. **Export to PNG**:
223225
```bash
224-
inkscape --export-filename=icon-mono-32.png --export-width=32 --export-height=32 your-icon.svg
226+
inkscape --export-filename=icon-mono-44.png --export-width=44 --export-height=44 your-icon.svg
225227
```
226228

227229
### Using ImageMagick
@@ -233,12 +235,12 @@ To use the color version instead:
233235

234236
2. **Convert existing image**:
235237
```bash
236-
convert your-image.png -resize 32x32 icon-mono-32.png
238+
convert your-image.png -resize 44x44 icon-mono-44.png
237239
```
238240

239241
3. **Create simple shape**:
240242
```bash
241-
convert -size 32x32 xc:transparent -fill black -draw "circle 16,16 16,8" icon-mono-32.png
243+
convert -size 44x44 xc:transparent -fill black -draw "circle 22,22 22,11" icon-mono-44.png
242244
```
243245

244246
## Advanced Configuration

internal/tray/icon-32.png

-764 Bytes
Loading

internal/tray/icon-44.png

977 Bytes
Loading

internal/tray/icon-mono-32.png

236 Bytes
Loading

internal/tray/icon-mono-44.png

835 Bytes
Loading

internal/tray/tray.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const (
2727
repo = "smart-mcp-proxy/mcpproxy-go" // Actual repository
2828
)
2929

30-
//go:embed icon-mono-32.png
30+
//go:embed icon-mono-44.png
3131
var iconData []byte
3232

3333
// GitHubRelease represents a GitHub release
@@ -277,7 +277,11 @@ func (a *App) cleanup() {
277277
}
278278

279279
func (a *App) onReady() {
280-
systray.SetTemplateIcon(iconData, iconData)
280+
systray.SetIcon(iconData)
281+
// On macOS, also set as template icon for better system integration
282+
if runtime.GOOS == "darwin" {
283+
systray.SetTemplateIcon(iconData, iconData)
284+
}
281285
a.updateTooltip()
282286

283287
// --- Initialize Menu Items ---

0 commit comments

Comments
 (0)