layer-shika/examples/simple-popup
2025-12-15 08:56:48 +01:00
..
src feat: add simple popup example 2025-12-15 08:56:48 +01:00
ui feat: add simple popup example 2025-12-15 08:56:48 +01:00
Cargo.toml feat: add simple popup example 2025-12-15 08:56:48 +01:00
README.md feat: add simple popup example 2025-12-15 08:56:48 +01:00

simple-popup

Small example that demonstrates:

  • Showing a popup with shell.popups().builder(...)
  • Content-based sizing (manual) using a Slint Timer to call resize_popup(width, height)
  • Multiple simultaneous popups (one at cursor, one centered)

This example intentionally keeps the popup “resize callback” pattern, since the popup window size cannot be tracked automatically.

Run

From the layer-shika workspace root:

cargo run -p simple-popup

Notes

  • Popups are transient windows intended for menus/tooltips/dialogs.
  • For PopupSize::Content, the popup starts small and then requests a resize once layout stabilizes.
  • If you dont see the popup, make sure your compositor supports xdg-shell popups and that the surface is focused.