desktop

package
v0.0.0-...-c892017 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 15 Imported by: ? 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 desktop holds desktop shell and window components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func About

func About(c *ui.Context, app string, o AboutOptions) ui.Element

About is an app's about window.

func Art

func Art(c *ui.Context, name string, size float32) ui.Element

Art draws an app icon in the set, falling back to a plain document.

func BatteryItem

func BatteryItem(c *ui.Context, level float32, o BatteryItemOptions) ui.Element

BatteryItem is a menu bar battery with its charge.

func BrightnessHUD

func BrightnessHUD(c *ui.Context, level float32, o BrightnessHUDOptions) ui.Element

BrightnessHUD shows brightness, fading after a change.

func ClockItem

func ClockItem(c *ui.Context, o ClockItemOptions) ui.Element

ClockItem is a menu bar clock; it turns each minute.

func ControlCenter

func ControlCenter(c *ui.Context, s *Controls, o ControlCenterOptions) ui.Element

ControlCenter has quick toggles and sliders; cue Toggle.

func DesktopIcon

func DesktopIcon(c *ui.Context, name, artName string, selected *bool, opened *int) ui.Element

DesktopIcon selects on click; opening bumps opened; cue Open.

func Dock

func Dock(c *ui.Context, apps []DockApp, opened, right *string) ui.Element

Dock magnifies under the pointer; clicks report; cue Tap.

func InspectorPane

func InspectorPane(c *ui.Context, sections []InspectorSection) ui.Element

InspectorPane is folding sections of values; folds report; cue Toggle.

func Launcher

func Launcher(c *ui.Context, apps []LaunchApp, query, picked *string, o LauncherOptions) ui.Element

Launcher is an app grid filtered by query; cue Select.

func LockScreen

func LockScreen(c *ui.Context, user string, password *string, check func(string) bool, unlocked *bool, o LockScreenOptions) ui.Element

LockScreen unlocks when check passes; cue Success.

func MenuBar(c *ui.Context, app string, menus []Menu, chosen *string, o MenuBarOptions) ui.Element

MenuBar is an app menu bar; opening reports; cue Open.

func NotificationCenter

func NotificationCenter(c *ui.Context, notes []DesktopNote, o NotificationCenterOptions) (root, clear ui.Element)

NotificationCenter lists notifications by app; clear cues Delete.

func PermissionPrompt

func PermissionPrompt(c *ui.Context, app, resource string, access *Access, o PermissionPromptOptions) ui.Element

PermissionPrompt asks to allow access; cue Tap.

func Preferences

func Preferences(c *ui.Context, tabs []PrefTab, picked *int, body func()) ui.Element

Preferences is a window of icon tabs; cue Select.

func ProgressWindow

func ProgressWindow(c *ui.Context, title string, done, total int, o ProgressWindowOptions) (root, cancel ui.Element)

ProgressWindow shows a task's progress with a cancel; cue Tap.

func SnapLayouts

func SnapLayouts(c *ui.Context, picked *Snap, o SnapLayoutsOptions) ui.Element

SnapLayouts picks an area of a window layout; cue Select.

func SourceList

func SourceList(c *ui.Context, groups []SourceGroup, current *string) ui.Element

SourceList is a grouped sidebar list; cue Select.

func Spaces

func Spaces(c *ui.Context, names []string, current *int) ui.Element

Spaces are workspace dots; the current one widens; cue Select.

func StatusBar

func StatusBar(c *ui.Context, left, right []StatusItem) ui.Element

StatusBar is a window's status bar, items left and right.

func TaskManager

func TaskManager(c *ui.Context, procs []Process, o TaskManagerOptions) ui.Element

TaskManager lists processes busiest first, with CPU and memory.

func TerminalWindow

func TerminalWindow(c *ui.Context, title string, lines []string, o TerminalWindowOptions) ui.Element

TerminalWindow is a terminal window with a blinking caret.

func TitleTabs

func TitleTabs(c *ui.Context, tabs []string, picked *int, o TitleTabsOptions) (root, add ui.Element)

TitleTabs are tabs in a title bar; cue Select.

func TrafficLights

func TrafficLights(c *ui.Context, o TrafficLightsOptions) (root, close, minimize, zoom ui.Element)

TrafficLights close, minimize and zoom; cue Tap.

func TrayMenu

func TrayMenu(c *ui.Context, items []TrayItem, chosen *string, o TrayMenuOptions) ui.Element

TrayMenu is a tray command menu; opening reports; cue Open.

func UnifiedToolbar

func UnifiedToolbar(c *ui.Context, title string, query *string, o UnifiedToolbarOptions) (root, back, forward ui.Element)

UnifiedToolbar has nav, a title and search; cue Tap.

func UpdatePrompt

func UpdatePrompt(c *ui.Context, app, version string, notes []string, o UpdatePromptOptions) (root, install, later ui.Element)

UpdatePrompt offers a new version; Install cues Success, Later Tap.

func VolumeHUD

func VolumeHUD(c *ui.Context, level float32, o VolumeHUDOptions) ui.Element

VolumeHUD shows the volume, fading after a change.

func WifiItem

func WifiItem(c *ui.Context, networks []Network, current *string, o WifiItemOptions) ui.Element

WifiItem is a Wi-Fi menu; opening reports; cue Select.

func WindowFrame

func WindowFrame(c *ui.Context, title string, o WindowFrameOptions, body func()) ui.Element

WindowFrame is a window with a title bar around body.

func WindowSwitcher

func WindowSwitcher(c *ui.Context, windows []SwitchWindow, current *int, o WindowSwitcherOptions) (root, next ui.Element)

WindowSwitcher is an alt-tab strip; next cycles; cue Tick.

Types

type AboutOptions

type AboutOptions struct{ Icon, Version, Format, Copyright, Credits string }

AboutOptions describe the app; Format words the version.

type Access

type Access int

Access is a permission answer.

const (
	Undecided Access = iota
	Allowed
	Denied
)

Answers.

type BatteryItemOptions

type BatteryItemOptions struct {
	Charging bool
	Percent  string
}

BatteryItemOptions mark charging and format the percent.

type BrightnessHUDOptions

type BrightnessHUDOptions struct{ Label string }

BrightnessHUDOptions name the overlay.

type ClockItemOptions

type ClockItemOptions struct{ Format string }

ClockItemOptions set the time layout.

type ControlCenterOptions

type ControlCenterOptions struct {
	Toggles                     [4]string
	Volume, Brightness, On, Off string
}

ControlCenterOptions name the four toggles, the sliders and states.

type Controls

type Controls struct {
	Wifi, Bluetooth, Focus, Dark bool
	Volume, Brightness           float64
}

Controls are the quick settings ControlCenter edits.

type DesktopNote

type DesktopNote struct {
	ID, App, Icon, Title, Text string
	Time                       time.Time
}

DesktopNote is one notification.

type DockApp

type DockApp struct {
	Name, Art string
	Running   bool
	Badge     int
	// Separator draws a divider before the icon, as before the trash.
	Separator bool
}

DockApp is a dock app; Art names its icon and a positive Badge shows.

type InspectorRow

type InspectorRow struct{ Label, Value string }

InspectorRow is a labeled value.

type InspectorSection

type InspectorSection struct {
	Title string
	Rows  []InspectorRow
}

InspectorSection is a titled group of rows.

type LaunchApp

type LaunchApp struct{ Name, Icon, Category string }

LaunchApp is an app in the launcher grid.

type LauncherOptions

type LauncherOptions struct{ Placeholder, Empty string }

LauncherOptions word the search.

type LockScreenOptions

type LockScreenOptions struct {
	Photo                                *ui.Bitmap
	Clock, Date, Password, Unlock, Wrong string
	Welcome                              string
}

LockScreenOptions dress the screen; Clock and Date are layouts.

type Menu struct {
	Title string
	Items []MenuItem
}

Menu is a titled list of commands.

type MenuBarOptions struct{ Flat bool }

MenuBarOptions set how the bar sits in its host surface: Flat drops the bar's own fill and edge, for a host that already draws them.

type MenuItem struct{ Label, Shortcut string }

MenuItem is a command with an optional shortcut.

type Network

type Network struct {
	Name   string
	Bars   int
	Secure bool
}

Network is a Wi-Fi network; Bars is 0 to 3.

type NotificationCenterOptions

type NotificationCenterOptions struct{ Title, Clear, Empty, Time string }

NotificationCenterOptions word the panel; Time is a layout.

type PermissionPromptOptions

type PermissionPromptOptions struct{ Icon, Title, Text, Allow, Deny, Allowed, Denied string }

PermissionPromptOptions word the prompt; Title formats app and resource.

type PrefTab

type PrefTab struct{ Name, Icon string }

PrefTab is a preferences pane's name and icon.

type Process

type Process struct {
	Name, Icon string
	CPU        float64
	Memory     int64
}

Process is a running process; CPU is a percent.

type ProgressWindowOptions

type ProgressWindowOptions struct{ Detail, Count, Cancel, Done, Icon string }

ProgressWindowOptions word the window; Count formats done of total.

type Snap

type Snap struct{ Layout, Zone int }

SnapLayoutsOptions word areas: layout, then area number.

type SnapLayoutsOptions

type SnapLayoutsOptions struct{ Zone string }

SnapLayoutsOptions word the areas; Zone formats layout and area.

type SourceGroup

type SourceGroup struct {
	Title string
	Items []SourceItem
}

SourceGroup is a titled run of entries.

type SourceItem

type SourceItem struct {
	Name, Icon string
	Count      int
}

SourceItem is a sidebar entry; a positive Count shows.

type StatusItem

type StatusItem struct {
	Icon, Text string
	Tone       int
}

StatusItem is a fact; Tone: muted, good, warning, bad.

type SwitchWindow

type SwitchWindow struct{ App, Title, Icon string }

SwitchWindow is an open window: its app, title and icon.

type TaskManagerOptions

type TaskManagerOptions struct{ Title, CPU string }

TaskManagerOptions word the table; CPU formats a percent.

type TerminalWindowOptions

type TerminalWindowOptions struct{ Prompt string }

TerminalWindowOptions set the prompt that marks typed lines.

type TitleTabsOptions

type TitleTabsOptions struct{ New string }

TitleTabsOptions word the new-tab button.

type TrafficLightsOptions

type TrafficLightsOptions struct{ Close, Minimize, Zoom string }

TrafficLightsOptions name the three buttons.

type TrayItem

type TrayItem struct{ Label, Icon, Shortcut string }

TrayItem is a tray command.

type TrayMenuOptions

type TrayMenuOptions struct{ Label, Icon string }

TrayMenuOptions name the tray icon.

type UnifiedToolbarOptions

type UnifiedToolbarOptions struct {
	Subtitle, Placeholder, Back, Forward string
	Compact                              bool
}

UnifiedToolbarOptions word the toolbar; Compact leaves the title to the window frame and keeps only the nav and the search field.

type UpdatePromptOptions

type UpdatePromptOptions struct{ Icon, Title, Version, Install, Later string }

UpdatePromptOptions word the prompt; Title formats the app name.

type VolumeHUDOptions

type VolumeHUDOptions struct {
	Muted bool
	Label string
}

VolumeHUDOptions mute the sound and name the overlay.

type WifiItemOptions

type WifiItemOptions struct{ Label, Title, Empty string }

WifiItemOptions word the item, its menu and the empty state.

type WindowFrameOptions

type WindowFrameOptions struct{ Inactive bool }

WindowFrameOptions mark an inactive window.

type WindowSwitcherOptions

type WindowSwitcherOptions struct{ Next string }

WindowSwitcherOptions word the next button.

Jump to

Keyboard shortcuts

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