dialoghost

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 18 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CandidateApps

func CandidateApps(choices []string, contentType string) []desktopentry.App

CandidateApps is the chooser's list (candidate_apps): the given app ids' entries, else the apps recommended for the type, else every app.

Types

type Deps

type Deps struct {
	// Config is the live config (the dialog animation).
	Config func() *config.Config
	// Open maps the overlay; Invoke runs on the UI loop; KeySym reads
	// its keys through the seat's keymap.
	Open   func(cfg app.LayerConfig) (Window, error)
	Invoke func(func())
	KeySym keys.Translator
	// Font shapes the text; Sheet styles the surface, the labels'
	// and entries' ink included.
	Font  render.Font
	Sheet *widget.Stylesheet
	// Candidates are the apps offered for a type (desktopentry's
	// RecommendedFor, else every app); SetDefault records the
	// "always use" choice.
	Candidates func(choices []string, contentType string) []desktopentry.App
	SetDefault func(id, contentType string) error
	// PickImage lets the user choose an image file (the shell's file
	// chooser) and calls chosen with its path on the loop; never on a
	// cancel. It returns at once.
	PickImage func(chosen func(path string))
	// Describe names the app a request comes from: its display name
	// and icon (desktopentry.Describe).
	Describe func(appID string) (name, icon string)
	// Signal reports what the user did in an authentication dialog
	// while no Authenticate call waits on it (portaldialogs.Emitter).
	Signal func(handle string, action portaldialogs.AuthAction)
}

Deps are the dialogs' collaborators.

type Dialogs

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

Dialogs is the dev.stubbe.lys.PortalDialogs1 host: one overlay showing one request, naming the app that asks; requests arriving meanwhile wait their turn, and dismissing a request answers it no (or "" for an app chooser), showing or waiting. Its portaldialogs.Host methods may be called from any goroutine; the rest runs on the loop.

func New

func New(d Deps) *Dialogs

New builds the host; nothing maps until a request.

func (*Dialogs) Access

Access is the grant/deny prompt: the permission's icon above the title, the subtitle and body below it.

func (*Dialogs) Account

Account asks to share the user's name and avatar, previewing it.

func (*Dialogs) Authenticate

Authenticate shows the authentication dialog for the caller's request, or updates the one showing, and waits for the user to answer the prompt, cancel or pick another identity.

func (*Dialogs) ChooseApplication

func (h *Dialogs) ChooseApplication(c portaldialogs.Caller, r portaldialogs.ChooserRequest) string

ChooseApplication is the app chooser: icon + name rows with a live search filter, and "always use" when the type is known. Its choices follow UpdateChoices while it is open.

func (*Dialogs) ChooseDevices

func (h *Dialogs) ChooseDevices(c portaldialogs.Caller, devices []portaldialogs.Device) (bool, []string)

ChooseDevices asks which USB devices the app may open: a check button per device, all checked, naming it and the access asked for.

func (*Dialogs) ConfirmInstall

ConfirmInstall confirms a dynamic launcher: its icon, the URL a web app opens, and its name, in an entry when it is editable. An emptied name installs under the default one.

func (*Dialogs) ConfirmWallpaper

func (h *Dialogs) ConfirmWallpaper(c portaldialogs.Caller, uri string) bool

ConfirmWallpaper previews a file:// image before it is set.

func (*Dialogs) Dismiss

func (h *Dialogs) Dismiss(handle string)

Dismiss answers no to the request at handle: the dialog showing for it is taken down, a waiting one never shows. Another request's dialog stays.

func (*Dialogs) Password

Password asks for a password in a masked entry; with Confirm it asks twice and accepts only matching, non-empty entries. Enter submits.

func (*Dialogs) ShowAuthentication

func (h *Dialogs) ShowAuthentication(c portaldialogs.Caller, r portaldialogs.AuthRequest)

ShowAuthentication shows the authentication dialog for the caller's request, or updates the one showing, with its notes and no prompt.

func (*Dialogs) UpdateChoices

func (h *Dialogs) UpdateChoices(handle string, choices []string) bool

UpdateChoices replaces the choices of the app chooser open for handle, refilling its list when it shows.

type Window

type Window interface {
	Close()
	SetFocus(w widget.Widget) error
}

Window is the overlay surface the dialog maps (app.LayerWindow).

Jump to

Keyboard shortcuts

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