Commit Graph

53 Commits

Author SHA1 Message Date
Emil Ernerfeldt ea71b7f20b
eframe web: detect and report panics during startup (#2992)
* Detect panics during initialization and show them to the user

* PanicHandler now also logs the panics

* Add example of how to call into your app from JS

* Refactor: break out AppRunner and AppRunnerRef to own files

* Hide AppRunner

* Simplify user code

* AppRunnerRef -> WebRunner

* Better docs

* Don't paint until first animation frame

* Update multiple_apps.html

* Update web demo

* Cleanup and fixes

* left-align panic message in html
2023-05-16 22:22:09 +02:00
Emil Ernerfeldt ac50fa0d94
eframe web: Better panic handling (#2942)
* Refactor: remove extra store of events

* Remove unnecessary extra function

* Refactor: simplify event registering

* Store panic summary

* egui_demo_app: move web-part to own module

* index.html: await

* Properly unsubscribe from events on panic

* Better error handling

* Demo app html: hide the wasm canvas and show an error message on panic

* egui_demo_app: add panic button to test panic response on web

* fix typo

* Use a constructor to create WebHandle

* Refactor: less use of locks in the interfaces

* More consistent naming
2023-04-21 08:33:01 +02:00
Stanislav 64496cacb9
Graceful exit from web (#1650)
Return a handle that can be used to stop a running egui instance.
2022-08-02 17:42:55 +02:00
Emil Ernerfeldt a7b6334784 Misc doc improvements 2022-04-13 22:14:34 +02:00
Emil Ernerfeldt 89d19860b8 Misc code cleanup, docs fixes, etc 2022-02-19 20:58:28 +01:00
Emil Ernerfeldt c6ac1827f6
Use tracing crate for logging (#1192)
* egui_web: use tracing crate
* egui_glow: use tracing crate
* Log at the debug level
* egui_demo_app: enable tracing to log to stdout
* Use tracing in egui-winit
* Add opt-in tracing support to egui
2022-02-01 12:27:39 +01:00
Emil Ernerfeldt 7eddd20a01 index.html: catch and display errors 2022-01-31 19:16:50 +01:00
Emil Ernerfeldt c412fd4a9c Add loading animation while waiting for wasm to load
Closes https://github.com/emilk/egui/issues/1009
2021-12-28 14:13:51 +01:00
Emil Ernerfeldt 62f58a3b05 egui_web: default to light mode unless prefers-color-scheme: dark 2021-06-07 20:56:18 +02:00
Emil Ernerfeldt f6770f0183 Various spelling fixes, docs improvements and code cleanup 2021-03-31 23:12:42 +02:00
Emil Ernerfeldt 0f33bc7c34
Fix web blur (#151)
* [egui_web] Always use an even canvas size

Fixes https://github.com/emilk/egui/issues/103

* [egui_web] Position canvas at top of screen

This avoids jumpyness when resizing,
caused by rounding height to an even number
2021-02-01 20:44:39 +01:00
Emil Ernerfeldt 31b7eda51e Rename Egui to egui
Also update iamges in README.md
2021-01-17 14:48:59 +01:00
Emil Ernerfeldt 1f2aebc25a Improve documentation 2021-01-17 12:24:13 +01:00
Emil Ernerfeldt e1000da305 Make index.html background color brighter to make Egui pop 2021-01-16 19:11:08 +01:00
Emil Ernerfeldt 6d9cdafbc9 Rename egui_demo to egui_demo_app to avoid confusion with egui_demo_lib 2020-12-29 17:54:52 +01:00
Emil Ernerfeldt 07e96ca17f Add syntax highlighting in egui web fetch example 2020-12-28 19:55:03 +01:00
Emil Ernerfeldt d0f6954900 Combine demo_glium and demo_web into one egui_demo crate 2020-12-19 21:38:44 +01:00
Emil Ernerfeldt 82a3997188 [egui_web] Add max canvas size to help perf issues on some platforms
Related: https://github.com/emilk/egui/issues/67
2020-12-18 22:51:23 +01:00
Emil Ernerfeldt 0cb3bb791b Add `example_web` app 2020-11-17 23:24:14 +01:00
Emil Ernerfeldt 61cdec8fca [refactor] rename 'example' to 'demo', and add simple example_glium 2020-07-23 12:18:19 +02:00
Emil Ernerfeldt 57ae03f52d [web] minor fixes for reactive mode 2020-07-19 00:44:06 +02:00
Emil Ernerfeldt 1a4c399e41 [web] port all remaining JS code to Rust 2020-07-18 18:00:05 +02:00
Emil Ernerfeldt 0afad57d41 [web] port JS code to Rust 2020-07-18 13:30:23 +02:00
Emil Ernerfeldt bea7e3a52e [egui] prepare for 0.1.0 release 2020-05-30 18:22:33 +02:00
Emil Ernerfeldt fd5ab736bb Rename from "Emigui" to "Egui"
Shorter to type (especially in code).
2020-05-30 10:22:35 +02:00
Emil Ernerfeldt ae6080405c Remove 'Web' from GuiInput 2020-05-21 12:04:42 +02:00
Emil Ernerfeldt 88bfcd585e Resize windows by dragging any side or corner 2020-05-17 16:42:20 +02:00
Emil Ernerfeldt 71154edf9b Add a fractal clock example to showcase painting performance 2020-05-11 20:21:24 +02:00
Emil Ernerfeldt 5a9e3d62bf Fix: web version steal keyboard input 2020-05-11 19:53:43 +02:00
Emil Ernerfeldt 3deb7dda7c Deploy new web version 2020-05-10 19:05:59 +02:00
Emil Ernerfeldt 14db237b1d Basic text input support 2020-04-29 21:25:49 +02:00
Emil Ernerfeldt 7459aa60a4 Make emigui fill entire web page 2020-04-23 22:08:42 +02:00
Emil Ernerfeldt 0b8351b9af Fix touch screen interactions 2020-04-23 21:27:05 +02:00
Emil Ernerfeldt b39555bb23 Add support for hyperlinks 2020-04-23 19:15:17 +02:00
Emil Ernerfeldt 25b06a6ff0 Update wasm/web example 2020-04-23 09:50:03 +02:00
Emil Ernerfeldt a8d9c3fc42 Listen to scroll wheel (glium only) 2020-04-22 20:01:49 +02:00
Emil Ernerfeldt 0ed578341b Add time as input to emigui to enable animations 2020-04-21 14:46:42 +02:00
Emil Ernerfeldt d999962602 Refactor example code 2020-04-12 12:07:51 +02:00
Emil Ernerfeldt d0734ccdef Fix performance issue on touch devices 2019-03-16 15:49:41 +01:00
Emil Ernerfeldt 375cc231a6 Fix touch interaction 2019-03-16 14:12:40 +01:00
Emil Ernerfeldt e1652bef77 Rename example app to example_wasm 2019-03-16 12:55:42 +01:00
Emil Ernerfeldt 0ba687f521 Run on requestAnimationFrame by default 2019-03-12 10:01:25 +01:00
Emil Ernerfeldt f0c879b2f4 Code cleanup: allow None mouse_pos + clippy fixes 2019-02-10 15:30:48 +01:00
Emil Ernerfeldt 1beed16053 Split example app from emigui_wasm 2019-02-09 23:00:07 +01:00
Emil Ernerfeldt c2c94ddda5 Pixel-perfect fonts 2019-01-19 10:10:28 -06:00
Emil Ernerfeldt 391abda3d5 Mobile fixes 2019-01-17 17:34:01 -06:00
Emil Ernerfeldt 8963a99a09 Rename to Emigui 2019-01-12 23:07:30 +01:00
Emil Ernerfeldt aa63303892 No typescript. Just one index.html + wasm. 2019-01-05 22:55:09 +01:00
Emil Ernerfeldt a1ddef742d WIP: rust WebGL rendering 2019-01-04 14:14:32 +01:00
Emil Ernerfeldt 702ec23372 Full screen canvas 2018-12-28 00:51:40 +01:00