1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-27 07:03:14 -04:00
Commit Graph

2590 Commits

Author SHA1 Message Date
Emil Ernerfeldt
fa69d7a22b Split into files 2023-04-26 20:44:27 +02:00
Emil Ernerfeldt
e9928c8766 Turn Branch into an enum 2023-04-26 20:31:37 +02:00
Emil Ernerfeldt
53ce1904a2 Code cleanup: move branch-gnostic code into branch.rs 2023-04-26 20:01:36 +02:00
Emil Ernerfeldt
9510d3418e Some bugfixes 2023-04-25 23:23:18 +02:00
Emil Ernerfeldt
6563522939 Better re-ordering of grid cells 2023-04-25 21:51:49 +02:00
Emil Ernerfeldt
7b26f3b79f Grid support 2023-04-25 21:27:26 +02:00
Emil Ernerfeldt
e714b33940 Change layout at runtime 2023-04-25 16:26:53 +02:00
Emil Ernerfeldt
ea47d36de7 Refactor: use a single struct Branch 2023-04-25 13:19:24 +02:00
Emil Ernerfeldt
4be5f43a3a Remove NodeState 2023-04-25 12:42:29 +02:00
Emil Ernerfeldt
a4dc86d77e Store rects separatedly 2023-04-25 12:39:18 +02:00
Emil Ernerfeldt
1d0509de23 Smooth preview 2023-04-25 12:25:17 +02:00
Emil Ernerfeldt
e5d0cf68d6 Store state 2023-04-25 11:04:58 +02:00
Emil Ernerfeldt
32be36416c You can mandate that all leaves have tabs 2023-04-24 22:37:04 +02:00
Emil Ernerfeldt
0617b7d26d Drag to re-arrange horizontal layout 2023-04-24 21:41:19 +02:00
Emil Ernerfeldt
240989df8b Drag to re-arrange tabs 2023-04-24 20:46:21 +02:00
Emil Ernerfeldt
13ec65cf08 Fix drag-drop and simplification code 2023-04-24 17:04:10 +02:00
Emil Ernerfeldt
ce7ed11542 bug fixes 2023-04-24 15:44:27 +02:00
Emil Ernerfeldt
b5eddc5d5c Buggy drop-detection 2023-04-24 15:44:27 +02:00
Emil Ernerfeldt
9b154c6d1d Preview drag destinations 2023-04-24 15:44:27 +02:00
Emil Ernerfeldt
92d93cb24a Drag tab names 2023-04-24 15:44:27 +02:00
Emil Ernerfeldt
52657301c9 dock wip 2023-04-24 15:44:27 +02:00
Emil Ernerfeldt
8fcbbb542f Silence unrelated clippy warning 2023-04-24 15:44:27 +02:00
MAlba124
92c7053a14 Rename examples/user_attention/README.mg to ... (#2948)
Rename `examples/user_attention/README.mg` to `examples/user_attention/README.md`.
2023-04-24 14:28:13 +02:00
Andreas Reich
0e6d69d4c4 Make egui work on WebGPU out of the box. (#2945)
* Make wgpu webgl/gles opt-in (but still work out of the box via feature flag), workaround canvas creation issue

* missing allow unsafe code annotations

* add breaking change not to eframe release notes

* Add --webgpu flag to build_demo_web.sh

* Improve CHANGELOG docs

* Clean up, and prepare for having to wasm:s

* put canvas without workaround under `if false`

* fix spelling

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-04-24 11:26:45 +02:00
Jinlei Li
09e1569bf3 Enable egui-winit to support wasm target (#2949) 2023-04-24 09:16:50 +02:00
Emil Ernerfeldt
c82604fe51 Update and fix web demo 2023-04-24 09:15:06 +02:00
Niklas Korz
f962378243 wgpu 0.16 (#2884)
* Adapt to latest wgpu changes

* Point to latest wgpu commit

* Fix egui-wgpu winit

* wgpu 0.16

* Fix web compilation issue

* Add libloading to deny.toml skip

* lock fix after merge, sort deny skip list

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2023-04-21 11:40:25 +02:00
Emil Ernerfeldt
4d357b0f02 clippy fixes from 1.69.0 2023-04-21 11:33:18 +02:00
Emil Ernerfeldt
4d360f67a4 eframe web: rememeber to unsubscribe from events on destroy 2023-04-21 09:22:34 +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
Emil Ernerfeldt
7f2de426d2 eframe: Set app icon on Mac and Windows (#2940)
* eframe: Set app icon on Mac and Windows

Also: correctly set window title on Mac when launching from
another process, e.g. python.

Co-authored-by: Wumpf <andreas@rerun.io>

* lint fixes

* Fix web build

* fix typo

* Try fix windows build

---------

Co-authored-by: Wumpf <andreas@rerun.io>
2023-04-20 15:47:04 +02:00
Emil Ernerfeldt
834e2e9f50 Fix: request_repaint_after works even when called from background thread (#2939)
* Refactor repaint logic

* request_repaint_after also fires the request_repaint callback

* Bug fixes

* Add test to egui_demo_app

* build_demo_web: build debug unless --release is specified

* Fix the web backend too

* Run special clippy for wasm, forbidding some types/methods

* Remove wasm_bindgen_check.sh

* Fix typos

* Revert "Remove wasm_bindgen_check.sh"

This reverts commit 92dde25344.

* Only run cranky/clippy once
2023-04-20 10:56:52 +02:00
Emil Ernerfeldt
d46cf067ea Return plot transforms (#2935)
* Expose the plot transform to users

* Rename plot::ScreenTransform to PlotTransform

* Plot: return a PlotResponse with a transform member
2023-04-19 17:01:16 +02:00
Emil Ernerfeldt
ce761e548f use env_logger in all examples (#2934) 2023-04-19 16:35:38 +02:00
TicClick
e3a021eea6 Allow for requesting the user's attention to the window (#2905)
* add method for requesting attention to the main window

* use another enum member for user attention type instead of nested `Option`s

(also, document the enum members now that they don't mirror `winit`)

* update the docstring

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>

* add an example app for testing window attention requests

* Apply suggestions from code review

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>

* remove `chrono` dependency and improve the attention example's readability

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-04-19 15:29:17 +02:00
Emil Ernerfeldt
d1af798a9b Clear all keys and modifies on focus change (#2933)
It is very easy for keys to become stuck when we alt-tab,
or a save-dialog opens by Ctrl+S, etc.
Therefore we new clear all the modifiers and down keys to avoid that.
2023-04-19 15:27:51 +02:00
Ryan Hileman
ede3ded977 egui-winit: Use RawDisplayHandle for smithay clipboard init (#2914) 2023-04-19 09:14:23 +02:00
Emil Ernerfeldt
b8e798777d Only show id clash warnings in debug builds by default (#2930)
Change with `egui_ctx.options_mut(|opt| opt.warn_on_id_clash = true);`
2023-04-19 08:53:37 +02:00
Emil Ernerfeldt
d486c76a9f Remove dark-light dependency (#2929)
* Remove dark-light dependency

Since https://github.com/emilk/egui/pull/2750 we now get what we need
straight from `winit`.

* fix warning

* Docstring formatting

* fix typo in check.sh
2023-04-18 21:52:48 +02:00
Emil Ernerfeldt
9c9a54ce36 Replace tracing with log (#2928)
* Replace tracing crate with log

It's just so much simpler to use

* Add `bacon wasm` job

* eframe: add a WebLogger for piping log events to the web console
2023-04-18 21:11:26 +02:00
Emil Ernerfeldt
0f9e1a3526 eframe web: Store app state to local storage when leaving site (#2927) 2023-04-18 20:26:02 +02:00
Jackson Kruger
438f6eafc8 Plot widget - allow disabling zoom and drag for x and y separately (#2901)
* Set whether zooming allowed for x and y separately

* Set whether dragging allowed for x and y separately

* Add disclaimers about interaction with data_aspect

* Show zoom & drag behavior in plot demo/charts instead of context menu demo

* Code review suggestions - use AxisBools::any()

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>

* Simplify allow_drag and allow_zoom APIs to take in Into<AxisBools>

* Remove unnecessary using...

* Remove unrelated change

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-04-18 19:58:19 +02:00
Emil Ernerfeldt
902bcfe6aa Add script to generate changelogs (#2920)
* Add script to generate changelogs from PR labels

* Improve PR template

* Better categorization
2023-04-18 18:58:12 +02:00
Emil Ernerfeldt
03c1a05e49 Rename sh/ folder to scripts/ 2023-04-18 17:10:52 +02:00
Sven Niederberger
69b568aeb4 Improved plot groups and bounds handling (#2410)
* improve plot groups and bounds handling

* changelog entry

* fix potential deadlock

* fix two more potential deadlocks

* syntax fix

* move changelog entry

* move category

* Update crates/egui/src/widgets/plot/mod.rs

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>

* Update crates/egui_demo_lib/src/demo/plot_demo.rs

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>

* clean up suggestions

* address comments

* use the new methods

* fix locked bounds

* Sync bounds_modified along with the bounds themselves

* move changelog entry

* Remove set_bounds_auto - not necessary any more

* add a comment about bounds modifications

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Co-authored-by: Jackson Kruger <jackson@farprobe.com>
2023-04-18 16:27:00 +02:00
Dixeran
8a2cfbd131 Apply 'with_active' option to winit (#2813)
* feat: apply 'with_active' option to winit

* fix: remove platform specification

- winit accept this option for all platforms

* build fix

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-04-18 16:13:25 +02:00
Emil Ernerfeldt
af4d737c92 Fix typo. Closes https://github.com/emilk/egui/pull/2876 2023-04-18 16:11:53 +02:00
xacer
4267fc079b bug: hide triple_clicked in documentation (#2867)
If `Response.clicked` and `Response.double_clicked` are hidden in the documentation, why isn't `Response.triple_clicked`
2023-04-18 16:11:05 +02:00
Emil Ernerfeldt
93ee554af5 Check more target triples with cargo deny (#2919) 2023-04-18 16:10:53 +02:00
Emil Ernerfeldt
4809747952 Check for typos on CI (#2918)
* Check for typos on CI

* Fix all typos
2023-04-18 16:10:20 +02:00