Commit graph

2261 commits

Author SHA1 Message Date
Parth
510aa1710e
fix typo in architecture.md (#2123) 2022-10-10 09:42:50 +02:00
Emil Ernerfeldt
eba3927ace
Remove .with_srgb(false) when constructing window (#2110) 2022-10-08 11:43:48 +02:00
Emil Ernerfeldt
f61044cef7
Fix copy-paste on Windows (#2120)
Closes https://github.com/emilk/egui/issues/2109

Since arboard 3.0 you must absolutely not hold onto `arboard::Clipbaord`
longer than you are using it.

See https://github.com/1Password/arboard/issues/84
2022-10-07 14:46:42 +02:00
Andreas Reich
cd74c74f6f
Update to wgpu 0.14 (#2114) 2022-10-06 15:50:46 +02:00
Emil Ernerfeldt
3ec170cc1e Tweak warning color in bright mode 2022-10-06 11:49:12 +02:00
Emil Ernerfeldt
4dd5ffa254 Fix: make ScrollAreaOutput public 2022-10-06 09:03:18 +02:00
Andreas Reich
c2a37f4bd8
eframe support for wgpu on the web (#2107)
* basic working wgpu @ webgl on websys

* fix glow compile error

* introduced WebPainter trait, provide wgpu renderstate

* WebPainterWgpu destroy implemented

* make custom3d demo work on wgpu backend

* changelog entry for wgpu support eframe wasm

* remove temporary logging hack

* stop using pollster for web
we're actually not allowed to block - this only worked because wgpu on webgl doesn't actually cause anything blocking. However, when trying webgpu this became an issue

* revert cargo update

* compile error if neither glow nor wgpu features are enabled

* code cleanup

* Error handling

* Update changelog with link

* Make sure --all-features work

* Select best framebuffer format from the available ones

* update to wasm-bindgen 0.2.83

* Fix typo

* Clean up Cargo.toml

* Log about using the wgpu painter

* fixup wgpu labels

* fix custom3d_wgpu_shader ub padding

* remove duplicated uniforms struct in wgsl shader for custom3d

* Update docs: add async/await to the web 'start' function

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-10-05 20:14:18 +02:00
Emil Ernerfeldt
c441f33ecf Cargo deny: also check wasm32-unknown-unknown 2022-10-03 10:37:50 +02:00
Emil Ernerfeldt
dd67f3631f Add Painter::image convenience function 2022-10-03 10:26:19 +02:00
Emil Ernerfeldt
77df8ca0b0
Update some crates (#2100)
* Update crate webbrowser 0.7 -> 0.8

* Update criterion 0.3 -> 0.4

* Update tts 0.20 -> 0.24

* revert tts update
2022-10-02 20:33:45 +02:00
Tobias Schmitz
981fdb3932
fix: default to changing y axis when changing data aspect (#2087) 2022-10-02 14:32:37 +02:00
Paul Rouget
aa1536f1a7
Make Layout properties public (#2096) 2022-10-02 08:51:29 +02:00
Michael Galos
9901ad4bb0
eframe: Mouse passthrough option (#2080) 2022-10-02 08:45:37 +02:00
Zoxc
53ff83737b
Plot: Add auto_bounds_x, auto_bounds_y and reset (#2029)
* Make double click reset to the initial view

* Allow forcing auto bounds

* Allow plots to be reset

* Rename `modified` to `bounds_modified`
2022-10-02 08:44:59 +02:00
Caleb Leinz (he/him)
5e91a3033d
Added ability to set color of spinner (#2088) 2022-10-01 15:18:44 +02:00
Paul Rouget
2dca01ecd5
Bug Fix: Allocate Frame outer margins (#2089) 2022-10-01 14:18:15 +02:00
Emil Ernerfeldt
2ee9ab3151 Added link to egui-glutin-gl 2022-09-27 23:08:43 +02:00
Emil Ernerfeldt
91b2d5da6f Fix typo in wgpu warning message 2022-09-25 16:46:40 +02:00
Emil Ernerfeldt
4ac1e28eae
Improve text redering and do all color operation in gamma space (#2071) 2022-09-24 17:53:11 +02:00
Emil Ernerfeldt
29fa63317e
Fix text sizes being too small (#2069)
Closes https://github.com/emilk/egui/issues/2068

Before this PR, the default font, Ubuntu-Light, was ~11% smaller
than it should have been, and the default monospace font, Hack,
was ~14% smaller. This means that setting the font size `12` in egui
would yield smaller text than using that font size in any other app.
Ooops!

The change is that this PR now takes into account the ttf properties
`units_per_em` and `height_unscaled`.

If your egui application has specified you own font sizes or text styles
you will see the text in your application grow
larger, unless you go in and compensate by dividing all font sizes by
~1.21 for Ubuntu-Light/Proportional and ~1.16 for Hack/Monospace,
and with something else if you are using a custom font!
This effects any use of `FontId`, `RichText::size`, etc.

This PR changes the default `Style::text_styles` to compensate,
so the default egui style should look the same before and after this PR.
2022-09-21 21:31:08 +02:00
Emil Ernerfeldt
990a8c8b44
Fix sRGB blending and cleanup the relevant code (#2070)
* Fix sRGBA blending on Mac

* Clean up handling of sRGB support

* Assume sRGB support if any extension has sRGB in it

* improve logging very slightly
2022-09-21 21:30:02 +02:00
setzer22
4aae638e15
Change several methods from pub(crate) to pub (#2051)
* Change several methods from pub(crate) to pub

* document next_auto_id

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-09-21 20:08:26 +02:00
Emil Ernerfeldt
12dc61ed0f
update arboard to 3.0 (#2067) 2022-09-21 09:14:55 +02:00
Emil Ernerfeldt
2b0bf82b51
Make eframe::App::as_any_mut optional to implement (#2061) 2022-09-20 13:58:55 +02:00
Chris Hamons
311eb66cae
Add spacing.menu_margin for customizing menu spacing (#2036)
- Fixes https://github.com/emilk/egui/discussions/287
2022-09-17 11:29:19 +02:00
Adia Robbie
bc6a823103
eframe: Add center to NativeOptions and monitor_size to WindowInfo (#2035)
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-09-17 11:20:40 +02:00
Paul Rouget
c4117066cf
MacOS: Support fullsize content (no titlebar, but window controls) (#2049)
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-09-16 14:31:21 +02:00
Sheldon Nico
0605bcfca7
Add IME support for native (#2046) 2022-09-15 17:21:43 +02:00
Emil Ernerfeldt
c5495d69fb
egui-wgpu: Fix crash on zero-sized scissor rects (#2039) 2022-09-13 09:32:05 +02:00
Zoxc
2842d390c9
Allow box zoom in any direction (#2028) 2022-09-09 08:30:14 +02:00
Stanislav
ebc4fc866d
eframe web: access app from WebHandle (#1886)
Co-authored-by: Stanislav <enomado@users.noreply.github.com>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-09-09 08:22:46 +02:00
Emil Ernerfeldt
e0c7533ede eframe native: Make sure we only shut down once
I don't trust winit to actually exit on ControlFlow::Exit

Perhaps this will solve https://github.com/emilk/egui/issues/2027
2022-09-08 10:50:35 +02:00
Emil Ernerfeldt
1fe08bf7e4 eframe: reduce repaint log level from debug to trace 2022-09-07 16:27:53 +02:00
Luis Wirth
4b6826575e
egui-wgpu renderer renaming (#2021)
- `RenderPass` -> `Renderer`
- `RenderPass::execute` -> `Renderer::render`
- `RenderPass::execute_with_renderpass` -> `Renderer::render_onto_renderpass`
- reexport `Renderer` in `lib.rs`
2022-09-07 14:20:21 +02:00
bigfarts
0e62c0e50b
Improve mixed CJK/Latin linebreaking. (#1986) 2022-09-06 22:20:17 +02:00
Emil Ernerfeldt
5500895845
eframe: make sure we save app state on Cmd-Q (#2013)
Cmd-Q emits a `winit::event::Event::LoopDestroyed` and then the app closes, without `run_return` returning (despite its name).
2022-09-06 16:07:58 +02:00
Adia Robbie
eeb97fa4ce
Check srgb_support on other GL | ES as well. (#2012) 2022-09-06 15:58:22 +02:00
Romet Tagobert
64aac30f36
Add depth buffer support for egui-wgpu's render pass (#2002)
* add a depth texture for wgpu callbacks

* egui-wgpu: use depth from native_options

* add wgpu caveat to depth_buffer docstring
2022-09-06 14:37:07 +02:00
ComLarsic
162210f90e
Add sdl2_egui_platform to the list of integrations (#2011) 2022-09-06 14:28:59 +02:00
Adia Robbie
b43a8626cf
Add custom shader_version on glow renderer (#1993)
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-09-06 10:08:16 +02:00
Luke Jones
7fae634dc3
egui_glow: default to RGBA8 if sRGB not supported (#2007)
The Vivante GPU on many STM32MP1 based boards does not support sRGB
as an internal format.

Introduce a check for sRGB support and default to `RGBA8` internal format
if not supported.

Additionally the STM32MP1 needs to be checked for `GL_ARB_vertex_array_object`

Closes #1991
2022-09-06 10:07:49 +02:00
Emil Ernerfeldt
1d5f20b46c Improve docstrings
Closes https://github.com/emilk/egui/issues/2001
2022-09-05 12:05:29 +02:00
njust
124ed5e4ba
Fixed typo (#1990)
* Fixed typo

* fix grammar too

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-09-05 12:02:31 +02:00
RadonCoding
613a664c45
Fixed a typo (#1985)
custom_window_frame was spelled as custon_window_frame
2022-08-30 10:12:52 +02:00
Koute
be9f363c53
egui_winit: support winit with default features disabled (#1971)
* egui_winit: support winit with default features disabled

* Link to the PR in the changelog
2022-08-30 08:49:32 +02:00
Joshua Batty
153524023f
egui-wgpu: port over missing update_wgpu_texture methods from egui_wgpu_backend (#1981)
* add back missing update_egui_texture_from_wgpu_texture methods to renderer module

* clippy
2022-08-29 14:09:34 +02:00
Emil Ernerfeldt
ac4d75e9b4
egui-winit: don't repaint when just moving window (#1980)
* Bug fix: reset repaint countdown when we pass it

* eframe: debug-print what winit event caused a repaint

* egui-winit: don't repaint when only moving window

* fix docstring
2022-08-29 11:20:19 +02:00
Adam Gąsior
9b2c3d1026
Add custom parser to DragValue and Slider, with additional support for binary, octal, and hexadecimal numbers. (#1967)
* Add `custom_parser` to `DragValue`

* Add `custom_parser` to `Slider`

* Add `binary_u64`, `octal_u64`, and `hexadecimal_u64` to `DragValue`

* Add `binary_u64`, `octal_u64`, and `hexadecimal_u64` to `Slider`

* Fix formatting and errors in docs

* Update CHANGELOG.md

* Fix CI errors

* Replace manual number parsing with i64::from_str_radix. Add support for signed integers.

* Update CHANGELOG.md

* Change documentation.

* Fix documentation.

* Fix documentation.

* Remove unnecessary links.
2022-08-28 18:16:12 +02:00
Emil Ernerfeldt
3142c52b94
Minor wgpu-web releated stuff (#1977)
* egui_demo_app: remove wgpu and pollster as direct dependencies

* eframe: use same web-sys version as wgpu crate

* Make note that web_sys_unstable_apis is required by the wgpu crate

* Rename the glow web painter in eframe

* Remove trait DummyWebGLConstructor from web_glow_painter.rs

* cargo fmt

* Fix check.sh
2022-08-28 10:58:58 +02:00
njust
dbfaa4527b
egui_extras: Add Table::vertical_scroll_offset (#1946)
* egui_extras: Add Table::vertical_scroll_offset

* Added example for TableBuilder::vertical_scroll_offset

* Format code

* Add link to PR in the changelog

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-08-28 09:37:23 +02:00