Emil Ernerfeldt
1133f3a42b
Improve look of color button and show_color slightly
2022-04-27 10:06:42 +02:00
Emil Ernerfeldt
06802cb0a0
Add Rounding::at_least and Rounding::at_most
2022-04-27 10:05:09 +02:00
Emil Ernerfeldt
e3b77e320a
Fix broken doclink
2022-04-27 09:59:05 +02:00
Emil Ernerfeldt
2fd20308e5
Add Ui::toggle_value
2022-04-26 21:36:22 +02:00
Emil Ernerfeldt
4d2eb5b71e
Don't export macros that should only be pub(crate)
2022-04-25 22:01:32 +02:00
Emil Ernerfeldt
95c0174331
Change canvas frame margin two points
2022-04-25 16:58:24 +02:00
Emil Ernerfeldt
0862712595
Add Vec2::dot
2022-04-25 11:26:54 +02:00
Emil Ernerfeldt
c70c72ef61
eframe: make sure we wait for FileStorage to complete the save
...
Closes https://github.com/emilk/egui/pull/1520
2022-04-20 21:54:31 +02:00
Emil Ernerfeldt
f789159a4a
Don't persist Grid sizes
...
A) there are potentially a lot of Grids, using up a lot of space
(and therefore serialization time).
B) if the code changes, the grid should also change,
and not remember old sizes
2022-04-19 21:28:45 +02:00
Emil Ernerfeldt
558891c146
eframe native: persist app state in background thread
...
Gives smoother frame rate
2022-04-19 21:26:35 +02:00
Emil Ernerfeldt
1dee439ab1
Added CursorIcons for resizing columns, rows and 8 cardinal directions
2022-04-19 16:56:27 +02:00
Emil Ernerfeldt
4231a5303b
Clean up custom plot axis demo
2022-04-19 11:43:22 +02:00
Emil Ernerfeldt
e82ea0c4b4
Plot: estimate bounds for generator functions
2022-04-19 11:43:04 +02:00
Emil Ernerfeldt
cde5f95fc9
code cleanup: replace some for_each with normal for-loops
2022-04-19 11:42:05 +02:00
Emil Ernerfeldt
676ff047e9
Add Ui::scroll_with_delta, and improve scroll docs
2022-04-19 10:46:24 +02:00
Emil Ernerfeldt
5414e8a7fb
Rename Painter::sub_region to Painter::with_clip_rect
2022-04-19 10:00:34 +02:00
Emil Ernerfeldt
2d2022fb72
Add Link widget ( #1506 )
...
This looks like a Hyperlink, but doesn't do anything when clicked.
Or rather: it lets the user decide what happens on click.
Closes https://github.com/emilk/egui/issues/1152
2022-04-16 22:55:15 +02:00
Emil Ernerfeldt
2b861f86e8
egui_web: Ignore input of "GroupNext"
...
Closes https://github.com/emilk/egui/issues/510
2022-04-16 10:38:25 +02:00
Emil Ernerfeldt
2355828d41
Remove epaint::mutex::Arc type alias
2022-04-15 15:18:21 +02:00
Emil Ernerfeldt
5a78213421
Enable depth buffer in WebGL backend ( #1499 )
...
This is useful when embedding 3D into eframe using egui::PaintCallback
2022-04-15 12:41:42 +02:00
Emil Ernerfeldt
f3e31391e0
Pass clip rectangle to PaintCallback
2022-04-15 10:31:33 +02:00
Emil Ernerfeldt
a7b6334784
Misc doc improvements
2022-04-13 22:14:34 +02:00
Emil Ernerfeldt
2ae93c40ab
Move examples out of eframe/examples into examples/ ( #1486 )
...
* Move examples out of eframe/examples into examples/
Give each example a `Cargo.toml` and `src/main.rs`.
This makes it easier for people to use as templates.
* Update README.md with more deps needed on vanilla Ubuntu
* Install libgtk-3-dev on CI, hoping that will fix something
2022-04-13 16:13:24 +02:00
Emil Ernerfeldt
170b21b63e
Add opt-in support for the 'puffin' profiler in eframe ( #1483 )
2022-04-13 11:06:13 +02:00
Emil Ernerfeldt
973c3f22d1
Revert "Update tts to 0.21.1" ( #1482 )
...
This reverts commit de038b9546 .
2022-04-12 21:40:57 +02:00
Emil Ernerfeldt
08b208586a
egui-winit: if clipboard fails to start, fall back to local clipboard
2022-04-12 11:39:35 +02:00
Emil Ernerfeldt
d364dfac66
Add Rect::distance_to_pos
2022-04-12 11:33:48 +02:00
Emil Ernerfeldt
038b3cf2e2
Add Painter::hline and Painter::vline
2022-04-12 10:54:38 +02:00
Emil Ernerfeldt
701ae3cb46
egui_extras::Table: fix bugs in the virtual scrolling
2022-04-11 17:54:57 +02:00
Emil Ernerfeldt
56b127f209
Simplify table demo
2022-04-11 17:25:44 +02:00
Emil Ernerfeldt
de038b9546
Update tts to 0.21.1
2022-04-11 16:36:25 +02:00
Emil Ernerfeldt
efc0b992e0
egui_extras: fix bug when restoring persisted table widths
2022-04-11 14:27:32 +02:00
Emil Ernerfeldt
e97241861e
egui_extras Table/Strip: less aggressive cell clipping
2022-04-11 10:55:52 +02:00
Emil Ernerfeldt
917f9e1768
Refactor and simplify feature flags
2022-04-11 10:53:16 +02:00
Emil Ernerfeldt
426b933d2f
egui_extras: add cell_layout option to set the layout of all cells
2022-04-11 10:29:34 +02:00
Emil Ernerfeldt
0e0eedfdda
Add ui.horizontal_centered
2022-04-11 10:28:45 +02:00
Emil Ernerfeldt
772ef84242
egui_extras Table/Strip: fix some spacing bugs
2022-04-11 10:19:07 +02:00
Emil Ernerfeldt
c88e1f8b29
egui_extras: improve Table/Strip docs, and only panic in debug builds
2022-04-11 10:17:36 +02:00
Emil Ernerfeldt
65d16695ae
Replace copypasta with arboard ( #1475 )
...
* Replace copypasta with arboard
Closes https://github.com/emilk/egui/issues/1474
* Clean up deny.toml
2022-04-10 16:41:07 +02:00
Emil Ernerfeldt
9b37c82d46
Update three-d to 0.11
2022-04-10 10:00:57 +02:00
Emil Ernerfeldt
29d214912f
Improve explanation of immediate mode
...
Closes https://github.com/emilk/egui/issues/1465
2022-04-10 09:43:23 +02:00
Emil Ernerfeldt
c2ab0404b7
Fix crash in text layout ( #1468 )
...
Fix text layout bug added in https://github.com/emilk/egui/pull/1291
2022-04-09 22:43:40 +02:00
Emil Ernerfeldt
cf0338d48f
Rust 1.60.0 + refactor cargo features ( #1467 )
...
* Update to rust 1.60.0
* Rename the feature `convert_bytemuck` to `bytemuck`
* Rename the feature `serialize` to `serde`.
* Make use of the "weak dependency" cargo feature
* Set rust-version = "1.60" for all crates
* egui_glow: clipboard, links, persistence & winit are now opt-in features
2022-04-09 13:54:47 +02:00
Emil Ernerfeldt
bdfc512b01
Add docstring example for TableBody::rows
2022-04-09 13:34:55 +02:00
Emil Ernerfeldt
cd0fb1f3d9
Simplify table demo
2022-04-09 13:18:57 +02:00
Emil Ernerfeldt
8cf196a34b
Use proper shebang for all bash scripts: #!/usr/bin/env bash
2022-04-07 17:34:34 +02:00
Emil Ernerfeldt
7cd285ecbc
misc clippy fixes from 1.60.0
2022-04-07 17:03:19 +02:00
Emil Ernerfeldt
68d5806b41
Add a text blending test to the color test
2022-04-05 14:23:30 +02:00
Emil Ernerfeldt and Michael Völkl
a9ae8c3e2c
Smaller checkboxes and radiobutton without a label ( #1456 )
...
Co-authored-by: Michael Völkl <michaelvoelkl@zoho.com >
2022-04-05 09:16:58 +02:00
Emil Ernerfeldt
bd25526a4f
check.sh: fail on rustdoc failure
...
Same as https://github.com/emilk/egui/pull/1454
2022-04-05 08:07:57 +02:00
Emil Ernerfeldt
c3b6d1bab9
Warn about Id clashes for Grid, Plot, ScrollArea, Table ( #1452 )
...
Id clashes can cause subtle bugs.
egui already warns when the same Id is used to interact with different
parts of the screen.
This adds warnings about id clashes for some widgets that store state:
Grid, Plot, ScrollArea, Table.
The PR also adds `Context::check_for_id_clash` so users who create
their own widgets can add the same type of check.
2022-04-04 13:13:34 +02:00
Emil Ernerfeldt
2d30bd751c
emath: add Rect::signed_distance_to_pos and Vec2::abs
2022-04-04 11:24:08 +02:00
Emil Ernerfeldt
5d19f381f9
Fix TexEdit clipping half the cursor when in the first column
...
Closes https://github.com/emilk/egui/issues/1449
2022-04-04 09:20:19 +02:00
Emil Ernerfeldt
dfd6a91cb0
Fix doclinks
2022-04-03 20:38:51 +02:00
Emil Ernerfeldt
d09fa63d9c
Fix Ui::add_visible sometimes leaving the Ui in a disabled state
...
Closes https://github.com/emilk/egui/issues/1436
2022-04-03 19:38:34 +02:00
Emil Ernerfeldt
861b0e11ba
Fix sh/check.sh ( #1446 )
...
* Don't bother serializing date in widget gallery
* Make egui_extras non-optional dependency of egui_demo_lib
2022-04-03 18:14:40 +02:00
Emil Ernerfeldt
10f30a0c52
Fix tessellation of Shape::Vec of heterogenous TextureId:s ( #1445 )
...
Closes https://github.com/emilk/egui/issues/1443
2022-04-03 18:14:27 +02:00
Emil Ernerfeldt
95efbbc03e
Remember to update glow window size when DPI changes ( #1441 )
2022-04-03 10:20:49 +02:00
Emil Ernerfeldt
aa6a2bb73f
Update PR template to suggests users to run ./sh/check.sh
2022-04-03 09:52:25 +02:00
Emil Ernerfeldt
5dff1e42c6
More table improvements ( #1440 )
...
* Clip by default
* Fix some spacing bugs
* datepicker: look nicer in light mode
* datepicker: show month names
* Table: don't allow resize of last column if it is Size::Remainder
2022-04-01 15:27:42 +02:00
Emil Ernerfeldt
c029f25c13
Table: don't allow resize of last column if it is Size::Remainder
2022-04-01 14:44:25 +02:00
Emil Ernerfeldt
51cc9c9a9a
Table: fix bug with item spacing
2022-04-01 14:43:43 +02:00
Emil Ernerfeldt
21c32a18d8
Table resize ( #1438 )
...
* Let 1D strips fill up parent width/height
* Add Strip + Table + DatePicker to egui_extras changelog
* Expose some dragging- and pointer related context/memory methods
* Make tables resizable
2022-04-01 12:01:00 +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
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
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 and Zachary Kohnen
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
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
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
Emil Ernerfeldt
c69f39e869
Box the app creator ( #1373 )
2022-03-18 14:23:07 +01:00
Emil Ernerfeldt
c8f6cae362
eframe app creation refactor ( #1363 )
...
* Change how eframe apps are created
* eframe: re-export epi::* so users don't need to care about what epi is
2022-03-16 15:39:48 +01:00
Emil Ernerfeldt
c768d1d48e
Context::request_repaint will wake up the UI thread ( #1366 )
...
This adds a callback (set by `Context::set_request_repaint_callback`)
which integration can use to wake up the UI thread.
eframe (egui_web and egui_glow) will use this, replacing
`epi::Frame::request_repaint`.
Existing code calling `epi::Frame::request_repaint` should be changed
to instead call `egui::Context::request_repaint`.
This is the first callback added to the egui API, which otherwise is
completely driven by data.
The purpose of this is to remove the confusion between the two
`request_repaint` methods (by removing one). Furthermore, it makes
`epi::Frame` a lot simpler, allowing future simplifications to it
(perhaps no longer having it be `Send+Sync+Clone`).
2022-03-15 17:21:52 +01:00
Emil Ernerfeldt
6aee4997d4
Add Shape::Callback to do custom rendering inside of an egui UI ( #1351 )
...
* Add Shape::Callback to do custom rendering inside of an egui UI
* Use Rc<glow::Context> everywhere
* Remove trait WebPainter
* Add glow::Context to epi::App::setup
2022-03-14 13:25:11 +01:00
Emil Ernerfeldt
002158050b
Add Frame::canvas - bright in bright mode, dark in dark mode ( #1362 )
...
and use it in the demo app
2022-03-14 12:33:17 +01:00
Emil Ernerfeldt
29c52e8eb6
Remove epi backend from egui_glow ( #1361 )
2022-03-13 22:49:24 +01:00
Emil Ernerfeldt
50539bd31a
egui_web: always use the glow painter, and remove the old WebGL code. ( #1356 )
...
* egui_web: always use the glow painter, and remove the old WebGL code.
* Clean up the WebPainter trait
* Clarify WebGL1 warning text in color test
The glow painter became standard in egui 0.17, and I've heard no complaints! So let's simplify and go all in on glow.
Part of https://github.com/emilk/egui/issues/1198
2022-03-11 19:15:06 +01:00
Emil Ernerfeldt
52b4ab4e18
Remove egui_glium as a backend for eframe ( #1357 )
...
eframe will now always use egui_glow as a native backend.
Part of https://github.com/emilk/egui/issues/1198
2022-03-11 19:14:27 +01:00
Emil Ernerfeldt
510cef02ca
Run a formatter on all toml files
2022-03-10 14:25:33 +01:00
Emil Ernerfeldt
30399bf6ff
Update regex crate v1.5.4 -> v1.5.5
2022-03-10 08:08:46 +01:00
Emil Ernerfeldt
d8300037ad
Fix cargo run -p egui_demo_app ( #1343 )
...
Broken by https://github.com/emilk/egui/pull/1303
2022-03-08 08:26:43 +01:00