icontheme

package
v0.3.21 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package icontheme resolves freedesktop icon theme names into rasters for programs that draw icons without widgets, such as a compositor drawing the icon a window names. Lookups follow the icon theme spec with the same theme chain, unthemed fallback and bundled icons as a Cache of package icons.

Index

Constants

View Source
const DefaultTheme = icons.DefaultTheme

DefaultTheme is the theme a Theme starts on when none is named: GTK's default, Adwaita, inheriting hicolor.

Variables

View Source
var ErrNotFound = icons.ErrNotFound

ErrNotFound reports that no theme of the chain, no unthemed directory and no bundled icon holds the requested name.

Functions

This section is empty.

Types

type Theme

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

Theme resolves and caches icons of one theme. It is safe for concurrent use.

func New

func New(name string, searchPaths []string) *Theme

New returns a theme called name, DefaultTheme when name is empty, searching the base directories searchPaths in priority order, or the XDG data directories when searchPaths is nil.

func (*Theme) Icon

func (t *Theme) Icon(name string, size int, frac120 uint32) (*render.Icon, error)

Icon returns the icon called name at size logical pixels in its natural colors, rasterized into a size times frac120/120 pixel box (rounded up). The icon is shared with the cache; treat it as read-only. The error wraps ErrNotFound for an unknown name.

Jump to

Keyboard shortcuts

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