Documentation
¶
Index ¶
- func CandidateApps(choices []string, contentType string) []desktopentry.App
- type Deps
- type Dialogs
- func (h *Dialogs) Access(c portaldialogs.Caller, r portaldialogs.AccessRequest) (bool, []portaldialogs.Selection)
- func (h *Dialogs) Account(c portaldialogs.Caller, reason string, info portaldialogs.AccountInfo) (bool, portaldialogs.AccountInfo)
- func (h *Dialogs) Authenticate(c portaldialogs.Caller, r portaldialogs.AuthRequest) portaldialogs.AuthReply
- func (h *Dialogs) ChooseApplication(c portaldialogs.Caller, r portaldialogs.ChooserRequest) string
- func (h *Dialogs) ChooseDevices(c portaldialogs.Caller, devices []portaldialogs.Device) (bool, []string)
- func (h *Dialogs) ConfirmInstall(c portaldialogs.Caller, r portaldialogs.LauncherRequest) (bool, string)
- func (h *Dialogs) ConfirmWallpaper(c portaldialogs.Caller, uri string) bool
- func (h *Dialogs) Dismiss(handle string)
- func (h *Dialogs) Password(c portaldialogs.Caller, r portaldialogs.PasswordRequest) (bool, string)
- func (h *Dialogs) ShowAuthentication(c portaldialogs.Caller, r portaldialogs.AuthRequest)
- func (h *Dialogs) UpdateChoices(handle string, choices []string) bool
- type Window
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 (*Dialogs) Access ¶
func (h *Dialogs) Access(c portaldialogs.Caller, r portaldialogs.AccessRequest) (bool, []portaldialogs.Selection)
Access is the grant/deny prompt: the permission's icon above the title, the subtitle and body below it.
func (*Dialogs) Account ¶
func (h *Dialogs) Account(c portaldialogs.Caller, reason string, info portaldialogs.AccountInfo) (bool, portaldialogs.AccountInfo)
Account asks to share the user's name and avatar, previewing it.
func (*Dialogs) Authenticate ¶
func (h *Dialogs) Authenticate(c portaldialogs.Caller, r portaldialogs.AuthRequest) portaldialogs.AuthReply
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 ¶
func (h *Dialogs) ConfirmInstall(c portaldialogs.Caller, r portaldialogs.LauncherRequest) (bool, string)
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 ¶
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 ¶
func (h *Dialogs) Password(c portaldialogs.Caller, r portaldialogs.PasswordRequest) (bool, string)
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.