Skip to main content

Popups and surfaces

A sheet over the window for a short task (a password, a choice). It traps the focus; Back cancels.

if Backend.asking: Popup {
heading: @tr("wifi.password-for", Backend.network);
note: @tr("wifi.password-note");
cancelled => { Backend.asking = false; }
TextField { password: true; init => { self.grab-focus(); } accepted => { … } }
HorizontalLayout {
Button { text: @tr("common.cancel"); kind: text; clicked => { Backend.asking = false; } }
Button { text: @tr("common.connect"); clicked => { … } }
}
}

Dialog​

A centred card for a question: title, text, icon, card-width; dismissed(). Buttons are children. The safe button comes first (Cancel before Delete): it gets the focus, and Back answers with it.

A small menu (the "⋮" of a page). Menu { closed => … } with MenuItem { text; icon; danger; activated => … } inside. Traps the focus; Back closes it.

Glass, Wallpaper, WallpaperImage​

Wallpaper { blurred; dim; } draws the current wallpaper; Glass { radius; tint; opaque; } a frosted surface over it. Used by the shell; apps normally use Theme.background and Theme.surface.

Toast and Hud​

Toast { text; icon; }: a short message at the bottom. Hud { icon; level; label; }: the volume/brightness banner (shell).

AppIcon​

A home-screen tile: icon, name; clicked().