icon

package
v0.9.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package icon generates system tray icons for the Goose application.

On platforms that don't support dynamic title text (Linux, Windows), icons are rendered as colored circle badges with white numbers:

  • Red circle: incoming PRs needing review
  • Green circle: outgoing PRs blocked
  • Both: red (top-left) + green (bottom-right)

Generated icons are 48×48 pixels for optimal display on KDE and GNOME.

Index

Constants

View Source
const Size = 48

Size is the standard system tray icon size (48×48 for KDE/GNOME).

Variables

This section is empty.

Functions

func Badge

func Badge(incoming, outgoing int) ([]byte, error)

Badge generates a badge icon showing PR counts.

Visual design for accessibility:

  • Incoming only: Red CIRCLE (helps color-blind users distinguish)
  • Outgoing only: Green SQUARE
  • Both: Diagonal split (red top-left, green bottom-right)

Returns nil if both counts are zero (caller should use happy face icon). Numbers are capped at 99 for display purposes.

func Scale

func Scale(iconData []byte) ([]byte, error)

Scale resizes an icon to the standard tray size.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache stores generated icons to avoid redundant rendering.

func NewCache

func NewCache() *Cache

NewCache creates an icon cache.

func (*Cache) Lookup added in v0.9.6

func (c *Cache) Lookup(in, out int) ([]byte, bool)

Lookup retrieves a cached icon or returns false if not found.

func (*Cache) Put

func (c *Cache) Put(incoming, outgoing int, data []byte)

Put stores an icon in the cache.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL