Documentation
¶
Overview ¶
Package desktop holds the pieces of the Windows application that do not need Win32.
Index ¶
Constants ¶
const ( DensityLarge = "large" DensityStandard = "standard" DensityCompact = "compact" )
Variables ¶
This section is empty.
Functions ¶
func DIBFromIcon ¶
DIBFromIcon returns the image data of a single-image .ico (without the ICO header), which is what CreateIconFromResourceEx expects.
func FormatRate ¶
FormatRate writes a speed given in bytes per second, either as bytes (КБ/с, МБ/с: binary prefixes, like sizes) or as bits (Кб/с, Мб/с: decimal prefixes, the way networks are measured).
func Icon ¶
func Icon() []byte
Icon returns a 32x32 .ico image: equinox, drawn as a circle split into a sunlit half and a night half, tilted by Earth's axial tilt (23.4°), with a sun and a moon set into the two halves. It is drawn in code so the executable needs no resource files.
func PNG ¶
PNG returns the same picture as a PNG of the given size (for the executable's resources).
func PosVisible ¶ added in v1.0.1
PosVisible reports whether a window at (x, y) would still be reachable on a screen area (the whole desktop): a monitor that was unplugged must not leave the window out of sight.
func ValidDensity ¶ added in v1.0.1
ValidDensity reports whether d is one of the known densities.
Types ¶
type Size ¶ added in v1.0.1
Size is in pixels.
func DefaultSize ¶ added in v1.0.1
DefaultSize is the client size of a window that has no remembered size.
type WindowPrefs ¶ added in v1.0.1
type WindowPrefs struct {
Density string `json:"density"`
HasPos bool `json:"hasPos"`
X int `json:"x"` // outer position
Y int `json:"y"`
Max bool `json:"maximized"`
Sizes map[string]Size `json:"sizes"` // outer sizes the person has left the window at
}
WindowPrefs is what is remembered about the window.
func LoadWindowPrefs ¶ added in v1.0.1
func LoadWindowPrefs(path string) WindowPrefs
LoadWindowPrefs reads the file; a missing or broken file gives the defaults.
func (*WindowPrefs) ForgetSize ¶ added in v1.0.1
func (p *WindowPrefs) ForgetSize(d string)
ForgetSize drops the remembered size of a density, so it goes back to the default.
func (WindowPrefs) Save ¶ added in v1.0.1
func (p WindowPrefs) Save(path string) error
Save writes the file (through a temporary one, so a crash cannot leave half of it).
func (WindowPrefs) Saved ¶ added in v1.0.1
func (p WindowPrefs) Saved(d string) (Size, bool)
Saved returns the remembered outer size for a density, if there is one.
func (*WindowPrefs) SetSize ¶ added in v1.0.1
func (p *WindowPrefs) SetSize(d string, s Size)
SetSize remembers the outer size for a density.