Skip to main content
Menus, popups and toasts

Menus, popups and toasts

· 2 min read
Balaur

Menus are scene nodes now. A menu holds rows, any widget names one as its context, and a toast says something and leaves.

A menu bar with a menu open, its rows showing shortcuts and a submenu, and a toast in the corner

  • A menu bar is a row of menu nodes. A row that is itself a menu opens to the side on hover, one submenu at a time, and does not shut the menu it hangs off.
  • Any widget names a menu as its context. A right click opens it at the pointer, and so does a long press, which is the same gesture on a phone. The widget's own on_click stays quiet for that press.
  • placement says where a menu opens: below, above, pointer, or center.
  • shortcut is a chord on any widget, written one way: cmd+shift+s, f5. A menu row fires with its menu shut, and the row draws the chord the way this platform writes it.
  • A toast is a root that stacks at its anchor, fades over its last half second, and frees itself when its duration is up. A binding action puts one up with no script at all.
  • A dialog closes on Escape and on a click on the dim, and reports that through on_change.

Every one of them is a property on the widget component, so the inspector edits them and a scene file holds them.

The rest is on the roadmap.