Emil Ernerfeldt
5514a8afda
Update dependencies ( #1933 )
...
* Update ahash from 0.7 to 0.8
Opt to use ahash::HashMap over ahash::AHashMap
* Fix ahash compilation for web
* Update ron to 0.8
* Add note about why we cannot update tiny-skia
* cargo update
Updating crates.io index
Updating android_system_properties v0.1.2 -> v0.1.4
Updating anyhow v1.0.58 -> v1.0.62
Updating async-broadcast v0.4.0 -> v0.4.1
Updating async-channel v1.6.1 -> v1.7.1
Updating async-io v1.7.0 -> v1.8.0
Updating async-task v4.2.0 -> v4.3.0
Updating async-trait v0.1.56 -> v0.1.57
Updating backtrace v0.3.65 -> v0.3.66
Updating bit-set v0.5.2 -> v0.5.3
Updating bumpalo v3.10.0 -> v3.11.0
Updating bytemuck v1.10.0 -> v1.12.1
Updating bytemuck_derive v1.1.0 -> v1.2.1
Updating bytes v1.1.0 -> v1.2.1
Updating cast v0.2.7 -> v0.3.0
Updating chrono v0.4.19 -> v0.4.22
Updating clap v3.2.8 -> v3.2.17
Updating clipboard-win v4.4.1 -> v4.4.2
Updating combine v4.6.4 -> v4.6.6
Updating concurrent-queue v1.2.2 -> v1.2.4
Updating criterion v0.3.5 -> v0.3.6
Updating criterion-plot v0.4.4 -> v0.4.5
Updating crossbeam-channel v0.5.5 -> v0.5.6
Updating crossbeam-deque v0.8.1 -> v0.8.2
Updating crossbeam-epoch v0.9.9 -> v0.9.10
Updating crossbeam-utils v0.8.10 -> v0.8.11
Updating document-features v0.2.1 -> v0.2.3
Updating dyn-clone v1.0.6 -> v1.0.9
Removing easy-parallel v3.2.0
Updating either v1.7.0 -> v1.8.0
Updating enum-map v2.1.0 -> v2.4.1
Updating enum-map-derive v0.8.0 -> v0.10.0
Updating event-listener v2.5.2 -> v2.5.3
Updating fastrand v1.7.0 -> v1.8.0
Updating futures-core v0.3.21 -> v0.3.23
Updating futures-io v0.3.21 -> v0.3.23
Updating futures-sink v0.3.21 -> v0.3.23
Updating futures-task v0.3.21 -> v0.3.23
Updating futures-util v0.3.21 -> v0.3.23
Updating gimli v0.26.1 -> v0.26.2
Updating gpu-descriptor v0.2.2 -> v0.2.3
Removing hashbrown v0.11.2
Removing hashbrown v0.12.1
Adding hashbrown v0.12.3
Adding iana-time-zone v0.1.46
Updating image v0.24.2 -> v0.24.3
Updating inplace_it v0.3.3 -> v0.3.4
Updating itoa v1.0.2 -> v1.0.3
Updating js-sys v0.3.58 -> v0.3.59
Updating libc v0.2.126 -> v0.2.132
Updating libm v0.2.2 -> v0.2.5
Removing memmap2 v0.3.1
Removing memmap2 v0.5.4
Adding memmap2 v0.5.7
Removing num-iter v0.1.43
Updating object v0.28.4 -> v0.29.0
Updating once_cell v1.13.0 -> v1.13.1
Updating os_str_bytes v6.1.0 -> v6.3.0
Updating owned_ttf_parser v0.15.0 -> v0.15.1
Removing parking_lot v0.11.2
Removing parking_lot_core v0.8.5
Updating plotters v0.3.1 -> v0.3.3
Updating plotters-backend v0.3.2 -> v0.3.4
Updating plotters-svg v0.3.1 -> v0.3.3
Updating proc-macro-crate v1.1.3 -> v1.2.1
Updating proc-macro2 v1.0.40 -> v1.0.43
Updating quote v1.0.20 -> v1.0.21
Updating redox_syscall v0.2.13 -> v0.2.16
Updating regex v1.5.6 -> v1.6.0
Updating regex-syntax v0.6.26 -> v0.6.27
Updating rfd v0.8.0 -> v0.8.4
Removing rustc_version v0.4.0
Updating ryu v1.0.10 -> v1.0.11
Updating sctk-adwaita v0.4.1 -> v0.4.2
Removing semver v1.0.12
Updating serde v1.0.138 -> v1.0.143
Updating serde_derive v1.0.138 -> v1.0.143
Updating serde_json v1.0.82 -> v1.0.83
Updating serde_repr v0.1.8 -> v0.1.9
Updating slab v0.4.6 -> v0.4.7
Removing smithay-client-toolkit v0.15.4
Updating smithay-clipboard v0.6.5 -> v0.6.6
Updating syn v1.0.98 -> v1.0.99
Updating thiserror v1.0.31 -> v1.0.32
Updating thiserror-impl v1.0.31 -> v1.0.32
Updating time v0.3.11 -> v0.3.13
Adding tiny-skia v0.7.0
Adding tiny-skia-path v0.7.0
Updating tracing v0.1.35 -> v0.1.36
Updating tracing-core v0.1.28 -> v0.1.29
Updating tracing-subscriber v0.3.14 -> v0.3.15
Updating unicode-ident v1.0.1 -> v1.0.3
Updating unicode_names2 v0.5.0 -> v0.5.1
Updating ureq v2.4.0 -> v2.5.0
Updating wasm-bindgen-futures v0.4.31 -> v0.4.32
Updating web-sys v0.3.58 -> v0.3.59
Updating webpki-roots v0.22.3 -> v0.22.4
Updating weezl v0.1.6 -> v0.1.7
Updating wgpu-core v0.13.1 -> v0.13.2
Updating wgpu-hal v0.13.1 -> v0.13.2
Updating wgpu-types v0.13.0 -> v0.13.2
Updating windows v0.32.0 -> v0.37.0
Updating windows_aarch64_msvc v0.32.0 -> v0.37.0
Updating windows_i686_gnu v0.32.0 -> v0.37.0
Updating windows_i686_msvc v0.32.0 -> v0.37.0
Updating windows_x86_64_gnu v0.32.0 -> v0.37.0
Updating windows_x86_64_msvc v0.32.0 -> v0.37.0
Updating x11-dl v2.19.1 -> v2.20.0
Updating zbus_names v2.1.0 -> v2.2.0
Updating zvariant v3.4.1 -> v3.6.0
Updating zvariant_derive v3.4.1 -> v3.6.0
* Add "Unicode-DFS-2016" to deny.toml whitelist
2022-08-19 11:46:38 +02:00
Emil Ernerfeldt
7c25a9238e
Remove get_ prefix from functions to better follow Rust API Guidelines
2022-08-08 12:21:53 +02:00
Red Artist
935913b1ec
Add Context::request_repaint_after ( #1694 )
2022-06-22 13:19:13 +02:00
Emil Ernerfeldt
29973e5d02
Make document-features an opt-in dependency
2022-06-09 17:41:37 +02:00
Emil Ernerfeldt
3169ce62d5
Document feature flags using crate document-features ( #1725 )
2022-06-09 15:27:22 +02:00
Robert Bragg
a5076d4cc4
egui_winit/wgpu: enable Android support ( #1634 )
...
* egui-winit: don't assume window available at init
On Android in particular we can only initialize render state once we
have a native window, after a 'Resumed' lifecycle event. It's still
practical to be able to initialize an egui_winit::State early on
so this adds setters for the max_texture_side and pixels_per_point
that can be called once we have a valid Window and have initialized
a graphics context.
On Wayland, where we need to access the Display for clipboard handling
we now get the Display from the event loop instead of a window.
* egui-wgpu: lazily initialize render + surface state
Enable the renderer and surface state initialization to be deferred
until we know that any winit window we created has a valid native window
and enable the surface state to be updated in case the native window
changes.
In particular these changes help with running on Android where winit
windows will only have a valid native window associated with them
between Resumed and Paused lifecycle events, and so surface creation
(and render state initialization) needs to wait until the first
Resumed event, and the surface needs to be dropped/recreated based on
Paused/Resumed events.
2022-05-22 20:24:41 +02:00
Emil Ernerfeldt
f3e305a646
Replace TODO:
with TODO(emilk):
and update code guidelines
2022-05-21 16:53:25 +02:00
4JX
6091370962
Add more doc-links in docstrings ( #1419 )
2022-04-03 18:18:35 +02: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
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
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
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
29c52e8eb6
Remove epi backend from egui_glow ( #1361 )
2022-03-13 22:49:24 +01:00
Emil Ernerfeldt
31d324932c
Introduce egui::FullOutput, returned from Context::run ( #1292 )
...
* Introduce `egui::FullOutput`, returned from `Context::run`
* Rename `Output` to `PlatformOutput`
2022-02-22 17:13:53 +01:00
Emil Ernerfeldt
0a46634c13
Simplify backends by adding fn paint_and_update_textures
helper
2022-02-21 21:49:52 +01:00
Emil Ernerfeldt
fa43d16c41
Choose your own font and size ( #1154 )
...
* Refactor text layout: don't need &Fonts in all functions
* Replace indexing in Fonts with member function
* Wrap Fonts in a Mutex
* Remove mutex for Font::glyph_info_cache
* Remove RwLock around Font::characters
* Put FontsImpl and GalleyCache behind the same Mutex
* Round font sizes to whole pixels before deduplicating them
* Make TextStyle !Copy
* Implement user-named TextStyle:s
* round font size earlier
* Cache fonts based on family and size
* Move TextStyle into egui and Style
* Remove body_text_style
* Query graphics about max texture size and use that as font atlas size
* Recreate texture atlas when it is getting full
2022-01-24 14:32:36 +01:00
Emil Ernerfeldt
462f181db3
Partial font texture update ( #1149 )
2022-01-22 11:23:12 +01:00
Emil Ernerfeldt
66d80e2519
Texture loading in egui ( #1110 )
...
* Move texture allocation into epaint/egui proper
* Add TextureHandle
* egui_glow: cast using bytemuck instead of unsafe code
* Optimize glium painter
* Optimize WebGL
* Add example of loading an image from file
2022-01-15 13:59:52 +01:00
Emil Ernerfeldt
d5673412dd
Put everything in Context behind the same Mutex ( #1050 )
...
* Move all interior mutability from Context to CtxRef and make it a handle
* Rename `CtxRef` to `Context`
* The old `Context` is now `ContextImpl` and is non-pub
* Add benchmark Painter::rect
Co-authored-by: Daniel Keller <dklr433@gmail.com>
2022-01-10 23:13:10 +01:00
Emil Ernerfeldt
190c85a40f
Rename Texture
to FontImage
2021-12-28 21:19:24 +01:00
Emil Ernerfeldt
cda4c8ba13
Minor cleanup following https://github.com/emilk/egui/pull/999
2021-12-28 13:22:01 +01:00
Emil Ernerfeldt
b7441eeee7
Make epi::Frame cloneable so you can allocate textures in other threads ( #999 )
...
Closes https://github.com/emilk/egui/issues/673
Also adds `epi::Image`
2021-12-26 21:21:28 +01:00
Emil Ernerfeldt
d5efa4bbca
1.56 fix: missing_crate_level_docs -> rusdoc::missing_crate_level_docs
2021-12-26 09:56:14 +01:00
Emil Ernerfeldt
105cb57050
Clean up glsl code
2021-11-13 13:09:08 +01:00
Emil Ernerfeldt
ddd5f6f4f6
winit: don't explicitly handle Cmd-Q and Alt-F4 ( #881 )
...
Closes https://github.com/emilk/egui/issues/877
Still a problem: https://github.com/rust-windowing/winit/issues/1998
2021-11-07 20:58:02 +01:00
Emil Ernerfeldt
49e43885ff
Replace Context::begin_frame/end_frame
with fn run
taking a closure ( #872 )
...
* Replace Context begin_frame/end_frame with `fn run` taking a closure
* Create `egui::__run_test_ui` to replace `Ui::__test`
* Add helper `egui::__run_test_ctx` for doctests
2021-11-03 20:11:25 +01:00
Emil Ernerfeldt
1dbe608e73
Refactor integrations ( #871 )
...
* Unify code in egui_glium and egui_glow into egui_winit::EpiIntegration
* Simplify `EguiGlium` interface
* Simplify `EguiGlow` interface
* egui_web refactor: merge `WebBackend` into `AppRunner`
2021-11-03 13:45:51 +01:00
Emil Ernerfeldt
09b8269326
Rich text for all widgets ( #855 )
...
Introduce `RichText` and `WidgetText`
2021-11-01 21:30:10 +01:00
Emil Ernerfeldt
78dfde40b2
Remove deprecated functions
2021-10-30 09:46:06 +02:00
Emil Ernerfeldt
a3ba85dbb3
Improve docs
2021-10-23 06:03:45 +02:00
Caleb Smith
79d1ede496
Add Frame::set_window_title()
( #828 )
...
* Add `Frame::set_window_title()`
* Changelog and fmt for `Frame::set_window_title()`
Co-authored-by: Caleb Smith <caleb@myrvmail.com>
2021-10-23 00:03:17 +02:00
Emil Ernerfeldt
d97a369c44
End statements with semicolon (clippy::semicolon_if_nothing_returned)
2021-10-20 16:46:57 +02:00
Emil Ernerfeldt
a0cd41755e
Add more clippy lints
2021-10-20 16:30:39 +02:00
Emil Ernerfeldt
8178d23d19
Deduplicate code found in both egui_glium and egui_glow ( #819 )
...
* Move window building to egui-winit
* Move icon loading to egui-winit
* `use glow::HasContext;` -> `use glow::HasContext as _;`
* Move FileStorage into epi behind a feature flag
* De-duplicate screen_size_in_pixels and native_pixels_per_point
* Move creation of FileStorage to epi
* Handle epi app output (window size changes etc) in egui-winit
* Move app and memory persistence and autosave logic to egui-winit
* fix check.sh
* Make the epi backend opt-in for egui_glium and egui_glow
* Fix persistence
* Add integration name to epi::IntegrationInfo and the demo
* Clean up Cargo.toml files and fix making egui_glium optional
* fix typo
* Make egui_glium compile without the `epi` feature
2021-10-19 21:40:55 +02:00
Emil Ernerfeldt
844dd9d7a4
Remove "seconds_since_midnight" from epi/eframe. Use chrono instead
...
chrono works both natively and on web.
Related: https://github.com/emilk/egui/issues/212
2021-10-19 15:37:20 +02:00
Emil Ernerfeldt
e2bdd40985
Move WindowSettings from egui_glium to egui-winit
2021-09-30 19:18:51 +02:00
Emil Ernerfeldt
3e1db880dc
Revert change to winit event loop in egui_glium ( #756 )
...
* Revert change to winit event loop in egui_glium
This reverts https://github.com/emilk/egui/pull/631
Fixes https://github.com/emilk/egui/issues/755
* Add example of file dialogs and file drag-and-drop
* fix ci
2021-09-30 18:53:41 +02:00
Emil Ernerfeldt
5539dbe620
Add separate serialize feature and better persitence control ( #753 )
...
* Rename epaint feature "persistence" to "serialize"
* Add separate "serialize" feature to egui
* egui_demo_lib: separate serialize and persistence features
* Add App::persist_native_window and App::persist_egui_memory
Controls what gets persisted
2021-09-29 08:45:13 +02:00
zu1k
f6fb4d942a
epi: drag native window ( #728 )
...
* feat: drag window
* Update epi/src/lib.rs
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* Update egui_demo_lib/src/backend_panel.rs
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* cargo fmt
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2021-09-28 17:34:58 +02:00
Emil Ernerfeldt
1b36863248
Split out new crate egui-winit from egui_glium ( #735 )
2021-09-28 17:33:28 +02:00
Emil Ernerfeldt
cf17cb2065
egui_glium: allow sharing a native glium texture using Rc
2021-09-20 22:52:29 +02:00
Emil Ernerfeldt
e7cfda4941
Shape refactor ( #705 )
...
* More introspection stats about vertices/indices etc
* more serde derive
* #[inline] to Shape constructors
* Introduce RectShape
* Introduce CircleShape
* Introduce PathShape
* More serde derive
* impl Copy for RectShape and CircleShape
* Simplify some code
* More serde derive
* Add helpers for appending more input or output
* Serde derives for RawInput
* Rename Fonts::from_definitions to Fonts::new
* Add Output::take
* refactor EguiGlium slightly
* Derive PartialEq for RawInput
* Improve egui::util::History interface
* tweaks
* Improve History filter: add minimum length
* Calculate galley bounding rect
* tessellator: cull line segments and paths
* tessellator: cull meshes
* Fix bug in History bandwidth estimator
2021-09-20 21:36:56 +02:00
Emil Ernerfeldt
f37180f7dc
Bump MSRV (Minimum Supported Rust Version) to 1.54.0 ( #703 )
...
1.51.0 clippy has been giving me trouble (not reporting all problems),
and so I take the easy way out and just bump MSRV.
We will upgrade to 1.56.0 once it comes around anyway
to get access to that sweet disjoint capture in closures
(https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html )
2021-09-09 00:16:06 +02:00
zu1k
19eed94499
feat: Set whether to show decorations ( #672 )
...
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2021-09-07 21:42:14 +02:00
Emil Ernerfeldt
249876523d
Increase scroll-speed on glium from 8 to 50 points per scroll tick
...
Closes https://github.com/emilk/egui/issues/461
Closes https://github.com/emilk/egui/pull/702
2021-09-07 19:45:13 +02:00
triangle drawer
203d571c8b
Add api for accessing backend texture via epi ( #695 )
...
* Define NativeTexture trait for offscreen rendering
add demo for NativeTexture trait
* write changelog
* add comment for native texture example
* formatting
* add license of Rust logo
* NativeTexture trait method rename
remove duplicate function with native texture
remove rust logo
* deprecated notice for register_glium_texture,register_webgl_texture
* collect deprecated notice
2021-09-05 11:00:45 +02:00
Emil Ernerfeldt
9598596bdc
Replace all http code in epi/eframe/egui_glium/egui_web with ehttp ( #697 )
...
I've extracted all the http request code and turned it
into its own crate at <https://github.com/emilk/ehttp >.
There was never a reason for the HTTP request library to be part of
`eframe`. Much better to have it as its own crate!
2021-09-03 21:04:43 +02:00
JerzySpendel
56502fbb3c
Make paint function accept anything implementing Surface trait ( #681 )
...
* Make paint function accept anything implementing Surface trait
* Remove unused imports
2021-09-02 14:44:50 +02:00
Emil Ernerfeldt
e98ae2ea7a
Revert "feat: Set whether to show decorations ( #660 )" ( #671 )
...
This reverts commit 0db74f3000
.
2021-08-28 12:29:19 +02:00
zu1k
0db74f3000
feat: Set whether to show decorations ( #660 )
...
* feat: Set whether to show decorations
* cargo fmt
* Update comment and changelog
2021-08-28 11:18:36 +02:00