Documentation
¶
Overview ¶
Package appearance holds the desktop's presentation preferences as xdg-desktop-portal publishes them: the color scheme, the accent color and the contrast level. An app.Application reads them and reports changes on its loop goroutine; lys-ui never applies them on its own.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Accent ¶
Accent is the desktop's accent-color preference: RGB components in [0, 1], with Known set when the desktop published one.
type ColorScheme ¶
type ColorScheme uint8
ColorScheme is the desktop's dark/light preference.
const ( // Unknown means no portal, no preference, or a value outside the // spec. It is a reason to keep the current theme. Unknown ColorScheme = iota // Dark means the desktop prefers a dark style. Dark // Light means the desktop prefers a light style. Light )
func (ColorScheme) String ¶
func (s ColorScheme) String() string
String returns "dark", "light" or "unknown".
type FontSettings ¶
FontSettings is where a GTK app takes its default font size from: the desktop font description (gtk-font-name, "" when unset) and the text DPI (gtk-xft-dpi in dots per inch, 0 when unset).
func ResolveFontSettings ¶
func ResolveFontSettings(portalFont string, portalTextScale float64, iniFont string, iniDPI float64) FontSettings
ResolveFontSettings applies GTK's per-key precedence on Wayland: the portal's org.gnome.desktop.interface value when it published one (font-name; text-scaling-factor, as gtk-xft-dpi = 96 x the factor), else settings.ini's (gtk-font-name, gtk-xft-dpi). Unset inputs are "" and 0.
func (FontSettings) DefaultFontPx ¶
func (s FontSettings) DefaultFontPx() float64
DefaultFontPx is the default font size, in logical pixels, a GTK app with these settings uses - what its 1rem is (gtk_css_font_size_get_default_px): an absolute size as given, a point size at the DPI. An unset or sizeless font is GTK's "Sans 10", an unset DPI 96.
type FontSize ¶
FontSize is the size a Pango font description names: points, or absolute logical pixels when it ends in "px".
func ParseFontSize ¶
ParseFontSize reads the size of a Pango font description ("Adwaita Sans 11", "Sans Bold 10.5", "Monospace 12px", "Cantarell 11 @wght=500"); false when the description names no positive size.