Commit Graph

2001 Commits

Author SHA1 Message Date
Emil Ernerfeldt 8681ec5cc9 small code cleanup 2022-03-31 21:10:02 +02:00
Emil Ernerfeldt 8718ae6c59 Let 1D strips fill up parent width/height 2022-03-31 21:08:43 +02:00
Emil Ernerfeldt 04135aaa9c Fix table width size bug 2022-03-31 15:11:01 +02:00
Emil Ernerfeldt 73444a7116 Fix typos 2022-03-31 14:53:17 +02:00
Emil Ernerfeldt 40f62b1d17 Clip cells in demo 2022-03-31 14:19:48 +02:00
Emil Ernerfeldt c2a0f64c81 More optimization 2022-03-31 14:19:10 +02:00
Emil Ernerfeldt dc8c5aaa2b Optimization 2022-03-31 14:17:53 +02:00
Emil Ernerfeldt d72cfe5359 Improve docs and naming 2022-03-31 14:02:35 +02:00
Emil Ernerfeldt 153e2cf54f Make faint_bg_color less faint 2022-03-31 13:56:18 +02:00
Emil Ernerfeldt d2492c7d70 Use same stripe color as egui::Grid 2022-03-31 12:39:23 +02:00
Emil Ernerfeldt b2124f4cd1 Clean up demo code 2022-03-31 12:39:02 +02:00
Emil Ernerfeldt d9eac765dc Fix typo (scrool -> scroll) 2022-03-31 12:23:46 +02:00
René Rössler 2ec346e7f5 rename Layout to StripLayout 2022-03-28 17:21:26 +02:00
René Rössler 275fa8c276 Merge remote-tracking branch 'egui/master' into dynamic-grid 2022-03-28 17:12:50 +02:00
Luis Wirth c3ac340e25 egui-winit: re-export egui (#1429) 2022-03-28 13:23:07 +02:00
Emil Ernerfeldt 8f178fa4e0 Add glow::Context to epi::Frame (#1425)
This can be used, for instance, to:

* Render things to offscreen buffers.
* Read the pixel buffer from the previous frame (glow::Context::read_pixels).
* Render things behind the egui windows.
2022-03-27 15:20:45 +02:00
Emil Ernerfeldt b7ebe16cfb Storage and frame refactor (#1418)
The purpose of this is to expose `frame.storage()` and `frame.storage_mut()` so users can save/load app state from the `App::update` function, without having to add another parameter to that function.

Changes:
* Added `Frame::storage()` and `Frame::storage_mut()`
* `App::update` now takes a `&mut Frame` rather than just `&Frame`
* `Frame` is no longer `Clone` or `Sync` (doesn't have to be since https://github.com/emilk/egui/pull/1366)
2022-03-25 21:19:31 +01:00
Anna Clemens bc0fdefceb Expose ui.cursor and ui.next_widget_position (#1342) 2022-03-25 19:34:03 +01:00
4JX dd9699099f Add ComboBox::icon() (#1405) 2022-03-23 21:56:46 +01:00
Emil Ernerfeldt 8272b08742 Improve text contrast in bright mode (#1412)
* Rename AlphaImage to FontImage to discourage any other use for it
* Encode FontImage as f32 and postpone the alpha correction
* Interpret alpha coverage in a new, making dark text darker, improving contrast in bright mode
2022-03-23 16:49:49 +01:00
Zachary Kohnen d3c002a4e5 Remove FAQs for resolved issues (#1413)
It was noted that the problems with Firefox on Linux/MacOS have been resolved in #1377 and the limitation on the canvas size was lifted in commit 465c96122c
2022-03-23 15:37:50 +01:00
René Rössler e5aa546b98 Merge remote-tracking branch 'egui/master' into dynamic-grid 2022-03-23 14:51:55 +01:00
Emil Ernerfeldt bcddafb505 Add a some fine lines to the color test to test anti-aliasing 2022-03-23 13:31:38 +01:00
Emil Ernerfeldt 3e41da7187 Revert accidentally setting srgb option on glutin window based on vsync
Introduced in a9fd03709e
2022-03-23 13:04:12 +01:00
Emil Ernerfeldt 1387d6e9d6 Refactor TessellationOptions to expose slider for feathering size (#1408)
The epaint tessellator uses "feathering" to accomplish anti-aliasing. This PS allows you to control the feathering size, i.e. how blurry the edges of epaint shapes are.

This changes the interface of Tessellator slightly, and renames some options in TessellationOptions.
2022-03-23 11:41:38 +01:00
Emil Ernerfeldt a9fd03709e Add new NativeOptions: vsync multisampling depth_buffer stencil_buffer
These are useful when embedding 3D into eframe.
2022-03-23 11:13:57 +01:00
Emil Ernerfeldt c63bdeab67 Add an example of showing 3D using three-d (#1407) 2022-03-23 11:06:33 +01:00
Emil Ernerfeldt 85e3ec5027 Log supported OpenGL extensions if VAO is in doubt. 2022-03-23 10:10:12 +01:00
Emil Ernerfeldt ea9393aa9b glow painter improvements (#1406)
* Add viewport info to PaintCallback
* glow: be more explicit with more state
* glow: Refactor VAO
2022-03-22 23:11:27 +01:00
Emil Ernerfeldt 6f10e2e725 Improve glow error reporting (#1403)
* Improve glow error reporting
* Add more check_for_gl_error calls
* Remove clippy lint list from egui_glow lib.rs
  - Forgotten in https://github.com/emilk/egui/pull/1394
* egui_glow: move vao code to own file
* Cleanup: `use glow::HasContext as _;`

Co-authored-by: Zachary Kohnen <me@dusterthefirst.com>
2022-03-22 16:04:06 +01:00
Emil Ernerfeldt 41b178b6ec Use atomic_refcell instead of parking_lot for wasm32 targets (#1404)
Closes https://github.com/emilk/egui/issues/1401
2022-03-22 15:34:21 +01:00
Edgeworth e5aeb1618f Export the PlotBounds type. (#1392) 2022-03-22 08:59:13 +01:00
Hunter522 0a400a5bcc Add Image::rotate and Mesh::rotate (#1371)
Co-authored-by: Hunter Morgan <hmorgan@bellflight.com>
2022-03-22 08:44:23 +01:00
Emil Ernerfeldt 805539b50d Add example of custom window frame for native window using eframe (#1396) 2022-03-21 22:20:58 +01:00
Emil Ernerfeldt 15254f8235 Remove the single_threaded/multi_threaded feature flags (#1390)
Always use parking_lot for mutexes, i.e. always be multi-threaded.

Closes #1379
2022-03-21 22:20:37 +01:00
Emil Ernerfeldt 5c68edbb15 Clippy fixes 2022-03-21 22:14:25 +01:00
Emil Ernerfeldt 339b28b470 Add Frame::outer_margin, and rename Frame::margin to Frame::inner_margin 2022-03-21 21:44:52 +01:00
Emil Ernerfeldt fda8189cba Move lints list to .carg/config.toml (#1394)
That way they apply to all crates equally.

See https://github.com/EmbarkStudios/rust-ecosystem/issues/22 for why.
2022-03-21 16:54:29 +01:00
Emil Ernerfeldt ccbddcfe95 Add example of how to move text cursor in a TextEdit 2022-03-20 23:08:19 +01:00
Emil Ernerfeldt fde9c232b3 Improve the introspection paint stats 2022-03-20 23:05:16 +01:00
Emil Ernerfeldt e369626d3d glow: move where FRAMEBUFFER_SRGB is enabled 2022-03-20 23:04:44 +01:00
Emil Ernerfeldt d20be45c4c Add egui_assert to ensure texture size is <= max_texture_side 2022-03-20 22:49:44 +01:00
Emil Ernerfeldt 861e129ace Add Shape::image convenience method 2022-03-20 20:39:48 +01:00
jean-airoldie 734d4c57ad Expose more epaint tessellator methods (#1384)
* Expose more tessellator method

* Make public the Tessellator methods to tessellate a circle, a
    mesh, a rectangle, a line, a path, a quadratic and cubic
    bezier curve.
* Add doc to tessellate_text.
* Add Mesh::append_ref method.

* Make tessellate_text take a reference

* Fix breaking change in benchmark
2022-03-20 20:38:48 +01:00
Zachary Kohnen 8bb381d50b Fix code that could lead to a possible deadlock. (#1380)
* Fix code that could lead to a possible deadlock.

Drop implementations are not called until the end of a statement. The statement changed in this commit therefore took 4 read locks on a RwLock which can lead to problems if a write lock is requested between any of these read locks. The code looks like it would only hold one lock at a time but it does not drop any of the locks until after the arithmatic operations complete, which leads to this situation. See https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=996079046184329f3a9df1cd19c87da8 to see this in action. The fix is to just take one lock and share it between the three calls to num_presses, letting it drop at the end of the scope.

* Fix code that may cause a deadlock in `MenuRoot::stationary_interaction`

The issue here is related to that in 9673b8f2a0 in that the lock is not dropped when it is expected.  Since the `RwLockReadGuard` produced by `ctx.input()` has a reference taken from it (one into `pointer`), the lock cannot be dropped until that reference is no longre valid, which is the end of the scope (in this case this function).  The following `ctx.input()` then attempts to aquire a second lock on the `RwLock`, creating the same situation that was found in the referenced commit.

This has been resolved by holding one lock on the input for the whole function.

* Reference this PR from comments in the code for future maintainers

* Add the change to the changelog

* Use full link to PR

* Use full link to PR

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-03-20 20:30:38 +01:00
Emil Ernerfeldt 465c96122c egui_web: by default, use full web browser size (#1378)
* egui_web: by default, use full web browser size

Closes https://github.com/emilk/egui/issues/1377

* Remove max_size_points from demo app
2022-03-19 13:47:30 +01:00
Emil Ernerfeldt 6ce8594351 README.md: add links to license files
Closes https://github.com/emilk/egui/issues/1367
2022-03-19 13:34:08 +01:00
Emil Ernerfeldt 12c31e980b Add Ui::push_id (#1374) 2022-03-19 13:30:43 +01:00
Emil Ernerfeldt f6af7bda27 Better error message when trying to upload too large texture
Closes https://github.com/emilk/egui/issues/1370
2022-03-19 13:30:29 +01:00
jean-airoldie 0d47e57775 Add Tessellator::set_clip_rect (#1369)
This allows the user to set the outer rectangle used for culling,
which is required to be able to implement its own tessellate_shapes.
2022-03-19 13:01:33 +01:00