1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 05:10:03 -04:00
Commit Graph

2992 Commits

Author SHA1 Message Date
Emil Ernerfeldt
8ef443948f Improve the About windows in the demo library (#3400)
* Tweak size of rerun logo

* Move history of immediate mode to docs

* Add link to Rerun.io from demo-lib's About window
2023-09-27 11:38:52 +02:00
Emil Ernerfeldt
35945dea46 Misc code cleanup (#3398)
* eframe README: explain how to enable copy/paste

* Implement Debug for a couple of structs

* Code cleanup

* Better docs

* profile ron serialization

* CI: Allow "exclude from changelog" as the only label
2023-09-27 09:06:17 +02:00
Simon
4986b35701 Add NativeOptions::window_builder for more customization (#3390)
* added a window builder hook for more customization

* `EFrame` -> `eframe`

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-09-27 08:52:49 +02:00
Emil Ernerfeldt
b3e19f5b7d Move App::persist_window to NativeOptions and App::max_size_points to WebOptions (#3397)
* Move `App::persist_window` to `NativeOptions`

* Move `App::max_size_points` to `WebOptions`

* Build fixes
2023-09-27 08:48:48 +02:00
Emil Ernerfeldt
1b18f8e266 Add Area::constrain_to and Window::constrain_to (#3396)
* Rename `drag_bounds` to `constrain_to`

and allow turning off constraining for `Window`s

* Constrain DatePicker popup to screen

* Fix typo
2023-09-27 08:40:24 +02:00
Emil Ernerfeldt
1911248ade Fix interaction with moved color-picker (#3395) 2023-09-27 08:20:04 +02:00
Konkitoman
8fad6b761d Now we use egui::ColorImage insted of (u32, u32, Vec<u8>) 2023-09-27 01:06:56 +03:00
Konkitoman
449f38adf2 This is a temporary fix to not unsafe impl Sync + Send for backends
The problem is that when we call Context::create_viewport_sync can be on any thread because egui::Context is Sync + Send but the backend is not!
So we want the callback to the backend to be thread local!

The problem that this adds is that now you cannot create more then one egui::Context,
 because the thread local variabile is static and i don't know how to store a non static LocalKey on egui::ContextImpl
2023-09-27 00:21:06 +03:00
Konkitoman
f001f06567 Restore from master egui_demo_app.js and egui_demo_app_bg.wasm 2023-09-26 23:42:51 +03:00
Konkitoman
38e00e2ea2 refactor eframe viewport sync rendering for glow and wgpu 2023-09-26 22:56:46 +03:00
Emil Ernerfeldt
1b830bbcb4 Less loud warning when loading old memories 2023-09-26 21:29:04 +02:00
Emil Ernerfeldt
dff52eddfd README.md: new images, better text (#3392)
* Update images in README.md

* Add ferris image to hello_world example

* Clean up and improve README.md, with top-level link to Rerun

* Move sections around
2023-09-26 21:17:43 +02:00
Konkitoman
1930d69ae3 Fix the change that change from a Vec to HashMap braked web and pure_glow 2023-09-26 20:34:09 +03:00
Konkitoman
f3686e2459 now using a HashMap insted of a Vec to store repaint_after 2023-09-26 20:18:50 +03:00
Konkitoman
5c8c56c1b8 rename the events that are result of events event_result 2023-09-26 19:50:11 +03:00
Konkitoman
e5783127f4 Fix max_texture_side for the main viewport was alwats set to 0 2023-09-26 19:45:12 +03:00
Konkitoman
43ad25a4d9 Renamed gl_window to glutin_ctx in init_run_state and initializate max_texture_side, and now on any egui_winit has max_texture_side set 2023-09-26 18:59:42 +03:00
Konkitoman
6a5838c119 Now all sizes are in Vec2 insted of Pos2 2023-09-26 18:33:57 +03:00
Konkitoman
b719e1c030 eframe fix android build 2023-09-26 18:23:37 +03:00
Emil Ernerfeldt
23ce4e70ca Add option to show a callstack to the widget under the mouse (#3391) 2023-09-26 15:50:35 +02:00
Konkitoman
543a0a2a83 egui, egui_glow, eframe: fix all errors returned by ./scripts/check.sh 2023-09-26 00:45:33 +03:00
Konkitoman
489d8a79c8 egui: fix web app runner 2023-09-26 00:14:26 +03:00
Konkitoman
e453d667e5 egui and eframe now uses more ViewportIdPair 2023-09-26 00:05:04 +03:00
Konkitoman
28f7b863fe egui: Move comment 2023-09-25 23:27:21 +03:00
Konkitoman
f4c5378ad3 Merge branch 'master' of https://github.com/emilk/egui into multiples_viewports 2023-09-25 23:15:51 +03:00
Emil Ernerfeldt
e8986b1e59 egui_extras: syntax-highlighting of .toml (#3388) 2023-09-25 17:48:22 +02:00
Emil Ernerfeldt
8bf0055bda Better handle additive colors in plots (#3387) 2023-09-25 15:45:32 +02:00
Emil Ernerfeldt
fdd493d48f Misc cleanup (#3381)
* Give credit to recent big-time contributors in the main README.md

* Better named profiling scopes

* Document everything in memory.rs

* Better doc-strings

* Add a section about dependencies to the main README.md

* Improve egui_extras docs

* fix typos
2023-09-24 09:32:31 +02:00
Emil Ernerfeldt
99a1b5b62e Add Context::open_url and Context::copy_text (#3380)
* Add Context::open_url

* Add `Context::copy_text`

* Fix doctest

* Fix another doctest
2023-09-24 09:31:21 +02:00
YgorSouza
d77c446572 Prevent text from being cleared when selected due to winit IME (#3376)
Closes #3374
2023-09-23 15:27:34 +02:00
Emil Ernerfeldt
33a0f50f6a Improve text truncation: always include elision character (#3366)
* Add Row::text

* Rename elide_at_width -> truncate_at_width

* Move text layout tests to own module

* Add test to check that elision character is always included

* Include elision character in more circumstances

* Append overflow character if we can't replace

* Always append … when eliding

* Add a secondary text to the text layout demo
2023-09-21 10:41:49 +02:00
Konkitoman
8ecd29dea7 eframe: Now WGPU implementation when creating a sync viewport will inherit the icon of his parent
And refactoring and adding some inline documentation
2023-09-20 18:56:38 +03:00
Konkitoman
22c128bc8b Fix warning in viewports example 2023-09-19 20:42:31 +03:00
Konkitoman
e2d406d2e4 * InputState::{inner_pos, inner_size} compacted to InputState::inner_rect
* InputState::{outer_pos, outer_size} compacted to InputState::outer_rect
* RawInput::{inner_pos, inner_size} compected to RawInput::inner_rect
* RawInput::{outer_pos, outer_size} compected to RawInput::outer_rect
* Context::{viewport_inner_pos, viewport_inner_size} compacted to Context::inner_rect
* Context::{viewport_outer_pos, viewport_outer_size} compected to Context::outer_rect
2023-09-19 19:48:00 +03:00
Konkitoman
ddff550b91 Remove get_* 2023-09-19 19:20:49 +03:00
Konkitoman
915d1b6997 Add ViewportIdPair, Viewport, ViewportOutput 2023-09-19 17:55:54 +03:00
Konkitoman
c96197db79 Merge branch 'master' of https://github.com/emilk/egui into multiples_viewports 2023-09-19 17:22:31 +03:00
Barugon
c07394b576 Only show on-screen-keyboard and IME when editing text (#3362)
* Remove calls to `set_ime_allowed`

* Allow IME if `text_cursor_pos` is `Some`

* Only call `Window::set_ime_allowed` when necessary

* allow_ime doesn't need to be atomic

* Remove unused imports

* Fix assignment
2023-09-19 14:14:42 +02:00
George Burton
08c46acba1 std::borrow::Cow<'_, str> now implements TextBuffer (#3164)
* `std::borrow::Cow<'_, str>` now implements `TextBuffer`

* Add pr number

* Remove line from CHANGELOG.md

* Add missing semicolons

* remove extra semicolon

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-09-18 21:38:10 +02:00
daxpedda
ad8b41cad6 Fix not taking clipping into account when calculating colum remainder (#3357) 2023-09-18 21:08:17 +02:00
Emil Ernerfeldt
6870d141d7 Add Context::style_mut (#3359) 2023-09-18 21:07:44 +02:00
Emil Ernerfeldt
dbf9b79d06 Fix typo
Closes https://github.com/emilk/egui/issues/3346
2023-09-18 17:15:51 +02:00
Sebastian Reinhard
433d1fc239 file_storage: Wrap File in BufWriter (#3353)
When exiting my application, it would freeze for around a minute waiting to finish writing ca. 40MB to file storage.
Some quick profiling revealed that it was spending all that time in `File::write`,
presumably making a large number of system calls writing tiny amounts of data at a time.
We can avoid this by buffering writes using a `BufWriter`, just like we already do with `BufReader`.

With this change, my application takes around 1-2 seconds to exit, with the majority of that time spent serializing `ron`.
I'm sure there are further potential performance improvements there, but this is already an order of magnitude or two better.

I also fixed the call to `log::warn!`, which was using incorrect formatting syntax and not including the error message.
2023-09-18 16:40:29 +02:00
Emil Ernerfeldt
8073ca6fe0 Fix problems with tabs in text (#3355)
* Move ascent out of `GlyphInfo`

* Give a function a better name

* Make tab and thin space act more like a normal space
2023-09-18 14:09:15 +02:00
Emil Ernerfeldt
fea9047abe Fix moving slider with arrow keys (#3354)
It would sometimes get stuck on the same value due to "smart-aim"
2023-09-18 13:20:45 +02:00
Emil Ernerfeldt
ceb8723c5e Bug fix: arrow keys won't move focus away from TextEdit (#3352)
* Bug fix: arrow keys won't move focus away from TextEdit

* Fix using arrow-keys to move slider

* Typo
2023-09-18 13:08:41 +02:00
aspect
9c4f55b1f4 Remove Function() invocation from eframe text_agent to bypass "unsafe-eval" restrictions in Chrome browser extensions. (#3349)
* remove Function (eval) from eframe text agent for compatibility with browser extensions.

* cargo fmt on image viewer
2023-09-17 13:25:50 +02:00
Dunfan Lu
d949eaf682 Fix typo in eframe/README.md (#3344) 2023-09-16 12:22:02 +02:00
Emil Ernerfeldt
a3dfd08d71 More image polish (#3343)
* docs

* paint_texture_at

* comment

* Fix doc-tests
2023-09-15 10:57:25 +02:00
Emil Ernerfeldt
2bbceb856b "Final" image polish (#3342)
* Improve the Image API a bit

* Improve image view demo

* Better names

* calculate -> calc
2023-09-15 10:13:50 +02:00