44 "log/slog"
55)
66
7- // Icon variables are defined in platform-specific files:
8- // - icons_windows .go: uses .ico files.
9- // - icons_unix .go: uses .png files.
7+ // Icon implementations are in platform-specific files:
8+ // - icons_darwin .go: macOS (static PNG icons, counts shown in title)
9+ // - icons_badge .go: Linux/BSD/Windows (dynamic circle badges with counts)
1010
1111// IconType represents different icon states.
1212type IconType int
@@ -21,33 +21,20 @@ const (
2121 IconLock // Authentication error
2222)
2323
24- // getIcon returns the icon bytes for the given type.
25- func getIcon (iconType IconType ) []byte {
26- switch iconType {
27- case IconGoose , IconBoth :
28- // For both, we'll use the goose icon as primary
29- return iconGoose
30- case IconPopper :
31- return iconPopper
32- case IconCockroach :
33- return iconCockroach
34- case IconWarning :
35- return iconWarning
36- case IconLock :
37- return iconLock
38- default :
39- return iconSmiling
40- }
41- }
24+ // getIcon returns icon bytes for the given type and counts.
25+ // Implementation is platform-specific:
26+ // - macOS: returns static icons (counts displayed in title bar)
27+ // - Linux/Windows: generates dynamic badges with embedded counts.
28+ // Implemented in icons_darwin.go and icons_badge.go.
4229
43- // setTrayIcon updates the system tray icon based on PR counts .
44- func (app * App ) setTrayIcon (iconType IconType ) {
45- iconBytes := getIcon (iconType )
30+ // setTrayIcon updates the system tray icon.
31+ func (app * App ) setTrayIcon (iconType IconType , counts PRCounts ) {
32+ iconBytes := getIcon (iconType , counts )
4633 if len (iconBytes ) == 0 {
47- slog .Warn ("Icon bytes are empty, skipping icon update" , "type" , iconType )
34+ slog .Warn ("icon bytes empty, skipping update" , "type" , iconType )
4835 return
4936 }
5037
5138 app .systrayInterface .SetIcon (iconBytes )
52- slog .Debug ("[TRAY] Setting icon" , "type" , iconType )
39+ slog .Debug ("tray icon updated " , "type" , iconType , "incoming" , counts . IncomingBlocked , "outgoing" , counts . OutgoingBlocked )
5340}
0 commit comments