类型 WindowIcon

API 文档由 Go 源码生成,内容为英文。

type WindowIcon struct {
	// Size is the width and height in pixels. 512 or more keeps it sharp where the
	// desktop shows it large.
	Size int
	// RGBA is Size*Size straight (not premultiplied) 8-bit pixels, top row first.
	RGBA []byte
}

WindowIcon is the application's square picture, the source of every icon the desktop shows for a running window; see Config.Icon. Supply it as the artist drew it: a full-bleed square, which each platform shapes to its own convention (the macOS tile with its margin, the plain rounded tile elsewhere), or a picture whose corners are transparent, which is only scaled.

方法

StatusIcon#

func (icon WindowIcon) StatusIcon(size int) StatusIcon

StatusIcon is the picture as a status-area icon of size pixels, in the form the platform's status area expects. macOS tints its icons to the menu bar, so there it is the picture's mark alone, a template; Windows and Linux show an icon as it is, so there it is the same rounded tile a window shows.