Commit Graph

2533 Commits

Author SHA1 Message Date
Barugon b80c0e6ff6
Add option to show icon (#2910) 2023-04-18 14:55:09 +02:00
Ryan Hileman 116d1547be
fix epaint bytemuck dependency (#2913) 2023-04-18 14:51:38 +02:00
Pēteris Pakalns c86bfb6e67
egui-wgpu: Support multisampling (#2878)
* Minimal implementation for egui wgpu multisampling support

* Update crates/egui-wgpu/CHANGELOG.md

Added pull request url

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>

* Fixed cargo cranky error

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-04-13 22:29:15 +02:00
Emil Ernerfeldt eb0812a953
eframe web: ensure modifiers keys won't stick in a down state on alt-tab (#2857)
* eframe web: ensure modifiers keys won't stick in a down state on alt-tab

* Update changelog

* Properly set the has_focus input flag on web
2023-03-31 10:11:41 +02:00
Emil Ernerfeldt 5cdbce04a8
Update to accesskit 0.10.1 (#2855)
* Update to accesskit 0.10.1

* Add helper script to run cargo deny
2023-03-30 10:23:54 +02:00
cameron 5fc5f087ff
Add character limit to TextEdit (#2816)
* Add char_limit to TextEdit

* Use match statement instead

* Update CHANGELOG.md

* Fixed panics

Updated to fix panics for UTF-8 characters and subtract overflow

* Inline code in insert_text
2023-03-30 10:23:22 +02:00
Diggory Hardy fb726aaabb
egui-winit: fix unsafe API of Clipboard::new (#2765)
* egui-winit: fix unsafe API of Clipboard::new

The old API allowed passing an arbitrary pointer. The new
API still breaks safety by allowing the object to outlive
the input, but is at least safer.

* Update crates/egui-winit/src/clipboard.rs

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>

* Fix typo

* Update crates/egui-winit/src/clipboard.rs

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>

* cargo fmt

* egui-winit: fix init_smithay_clipboard

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-03-30 10:21:07 +02:00
Andrew Scott 9ddf7abeee
feat: simple grid row color picker (#2519)
* feat: simple grid row color picker

* feat: allow painting initial grid row

* avoid coloring callback for striped when not needed

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>

* fix: switch from rgba to color32 for row grid color assignment

* fix warning

* make `paint_row` private

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-03-30 10:01:22 +02:00
Emil Ernerfeldt 92c4e23aac
eframe: add a simplified native-only API for simple native apps (#2453)
* eframe: add a simplified native-only API for simple native apps

* build-fix

* Fix doc-test
2023-03-30 10:00:47 +02:00
XyLyXyRR 4b1c0d90c0
demo app: use `enum` instead of strings for demo-selector anchor (#2781)
* improve(code): use enum instead of string

* update(code): optimize code

* fix(code): lints
2023-03-30 09:20:07 +02:00
Emil Ernerfeldt b8816d6988
Run cargo-deny on a matrix of targets (#2852)
* Run cargo-deny on a matrix of targets

* Try rust-cache

* Restrict the number of OSes
2023-03-30 09:12:11 +02:00
Andreas Reich b1f837ca2f
[egui-wgpu] Do vertex & index buffer in a single copy each (#2820)
* [egui-wgpu] Do vertex & index buffer in a single copy each
Also, copy uniform buffer only if necessary.
Previously, we did hundreds of small copies via queue.write_buffer which would create a new buffer for each of these copies. Now, there are only two gpu sided copy operations and the memory goes directly to the staging buffer.
In a quick debug test on Rerun this decreased time for the `update_buffer` method from about 0.87ms to 0.37ms!

* fix comparing padding on UniformBuffer in wgpu renderer

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-03-29 19:30:18 +02:00
Brian Janssen 5ccc71415e
Replace show_index String with Into<TextWidget> (#2790) 2023-03-29 17:00:31 +02:00
Ruben 977749b0e0
eframe: Automatically change theme when system dark/light mode changes (#2750)
* React to ThemeChanged event from winit

* React to theme change using media query change event in WASM

* Share conversion from bool -> Theme

* Suppress too_many_arguments warning

* Document limitations of automatically following the dark vs light mode preference

* Simplify expression

* Conditionally compile code to prevent unused item warnings

* Remove needless borrow

* Remove another needless borrow

* Make associated functions to standalone

* Request repaint after theme has changed

* Only install event listener when `follow_system_theme` is enabled

* Remove dark-light feature gate

* Detect system theme using winit

* Update documentation

* Fix typos

* fix warning about unused argument

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-03-29 16:39:30 +02:00
amfaber 870264b005
eframe: capture a screenshot using `Frame::request_screenshot`
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-03-29 16:34:22 +02:00
Ivan Sotnikov 74d43bfa17
Fix UI `data()` read mutability (#2742)
* Make `IdTypeMap::get_temp` use immutable `self`

* Add note to `IdTypeMap::get_persisted` about mutability

* Add mention of `ArcSwap` in `IdTypeMap` docs

* Fix formatting with `cargo fmt`
2023-03-29 15:59:24 +02:00
c-git 2946ed74e3
Update serial window example (#2756)
* Update to make it more clear what will happen

* Provide an overview in readme of expectations

* Update screenshot to match new code
2023-03-29 15:55:45 +02:00
Boris-Chengbiao Zhou 8eeb3e0d28
Fix resizable columns option in the table demo (#2780) 2023-03-29 15:53:56 +02:00
Samit Basu f38904336b
Prefer the client width/height for the canvas parent (#2804) 2023-03-29 15:04:04 +02:00
Gabriel Féron 24eccca8e6
Only enable instant/wasm-bindgen when building for wasm32 architecture (#2808) 2023-03-29 14:59:45 +02:00
Ryan Hileman 73a011f83a
fix scroll bars not appearing (#2826) (#2827) 2023-03-29 14:53:24 +02:00
YgorSouza 8ec9233e28
Add #![forbid(unsafe_code)] where unsafe isn't needed (#2773)
To be consistent with the use of the safety badge in the README.
2023-03-29 14:39:51 +02:00
ItsEthra c5caed5b35
Enabled wayland feature for winit when running native (#2751)
* Enabled wayland feature for winit when native

* Enable egui-winit/wayland through eframe instead by on by default
2023-03-29 14:38:27 +02:00
lictex_ 94f8b02286
improve fallback fonts alignment (#2724)
* use font metrics in layout

* properly center scaled fonts

* adjust docs

* fix raised text

* fix easymark viewer small text alignment
caused by variable row heights
2023-03-29 14:36:09 +02:00
Jeremy Leibs 089c7b46f3
Fix the OS check for windows (#2832) 2023-03-23 15:15:00 +01:00
Emil Ernerfeldt 59c2c4c70d
Update tempfile to fix CVE (#2809)
> cargo update -p tempfile
    Updating crates.io index
      Adding errno v0.2.8
      Adding errno-dragonfly v0.1.2
      Adding io-lifetimes v1.0.6
      Adding linux-raw-sys v0.1.4
    Removing remove_dir_all v0.5.3
      Adding rustix v0.36.9
    Updating tempfile v3.3.0 -> v3.4.0
2023-03-14 08:50:06 +01:00
Emil Ernerfeldt f94187ab71 Remove misleading safety-badges
See https://github.com/emilk/egui/issues/2723
2023-02-28 22:35:08 +01:00
谢克 8345847853
fix window position display error (physical pixels converted to logic… (#2763) 2023-02-28 21:35:09 +01:00
Ivan e9d869c4c5
hsva color_slider_2d orientation change (#2727)
* hsva color_slider_2d orientation change

* color_slider_2d doc fix

---------

Co-authored-by: IVANMK-7 <68190772+IVANMK-7@users.noreply.github.com>
2023-02-28 21:21:01 +01:00
Ivan 5910144112
Scroll bar visibility options (#2729)
* add scroll bar visibility options

* ScrollBarVisibility derive Eq

---------

Co-authored-by: IVANMK-7 <68190772+IVANMK-7@users.noreply.github.com>
2023-02-28 21:20:10 +01:00
YgorSouza f85a25307d
Fix deadlock when using show_blocking_widget (#2753)
Calling the layer painter from inside a write() call causes a deadlock
on the Context. This change stores the necessary data (the two
overlapping Rects) in the write() call but uses them outside.

Closes #2752
2023-02-28 20:52:37 +01:00
Emil Ernerfeldt 7215fdfb7c Release eframe 0.21.3 - fix web input of the the letter P 2023-02-15 08:26:45 +01:00
Emil Ernerfeldt e2778d9d6a
eframe: Fix inputting of the letter P on web (#2740)
* eframe: Fix inputting of the letter P on web

* Update changelog

* silence clippy
2023-02-15 08:24:52 +01:00
Emil Ernerfeldt 38849fe381 Release eframe 0.21.2 - support --no-default-features 2023-02-12 19:34:37 +01:00
Emil Ernerfeldt df7e5bd57a
Allow compiling eframe with `--no-default-features` (#2728)
* Check that we can compile eframe with --no-default-features

* Allow compiling eframe with `--no-default-features`

This is useful for libraries that depend on `eframe::Frame`
but don't care what renderer eframe is using.
2023-02-12 19:29:42 +01:00
Emil Ernerfeldt e3e781ced8 fix puffin_profiler example 2023-02-12 19:27:10 +01:00
Emil Ernerfeldt 97756bc246 Add badges to all crates' README.md 2023-02-12 18:08:13 +01:00
Emil Ernerfeldt f71d79a0ff Release egui-winit, eframe 0.21.1 - fix crash on monitor size/dpi change
https://github.com/emilk/egui/pull/2722

The crash could happen if the monitor size or DPI changes between runs
2023-02-12 15:29:47 +01:00
Aevyrie 95247daa17
Fix window position assertion caused by negative window size (#2722) 2023-02-12 15:14:38 +01:00
Emil Ernerfeldt 530e9f667c format: add some blank lines where it was needed 2023-02-10 18:03:46 +01:00
Emil Ernerfeldt 409fb968d3 add cargo config file that sets --cfg=web_sys_unstable_apis on wasm32 2023-02-10 17:56:10 +01:00
Emil Ernerfeldt 1581f0229e examples/README.md: explain that the examples are for master
and add a link to the latest release
2023-02-08 20:34:43 +01:00
Emil Ernerfeldt ae722ab0cf Release 0.21.0 - Deadlock fix and winit update 2023-02-08 20:11:21 +01:00
Emil Ernerfeldt 1384fa3287 Publish new web demo 2023-02-08 20:10:12 +01:00
Emil Ernerfeldt 83b5b81227 Update changelogs with recent additions 2023-02-08 19:36:33 +01:00
Emil Ernerfeldt 63fa3aec10 Update example screenshots 2023-02-08 19:04:04 +01:00
Emil Ernerfeldt ebeb788b1f
We no longer use tts, so remove speech-related dependencies (#2698) 2023-02-08 18:45:44 +01:00
Emil Ernerfeldt 0fc25c2680 Fix: make sure always_on_top is respected on glow again 2023-02-08 18:12:52 +01:00
Emil Ernerfeldt 449dd1c23c
cargo update (#2697)
* cargo update

    Updating anyhow v1.0.68 -> v1.0.69
    Updating bindgen v0.63.0 -> v0.64.0
    Removing cocoa v0.24.1
    Updating glutin v0.30.3 -> v0.30.4
    Updating glutin_egl_sys v0.3.1 -> v0.4.0
    Updating glutin_glx_sys v0.3.0 -> v0.4.0
    Updating glutin_wgl_sys v0.3.0 -> v0.4.0
    Updating proc-macro2 v1.0.50 -> v1.0.51
    Updating rgb v0.8.34 -> v0.8.35
    Updating serde_json v1.0.91 -> v1.0.92
    Updating tiny-skia v0.8.2 -> v0.8.3
    Updating tiny-skia-path v0.8.2 -> v0.8.3
    Removing windows-sys v0.36.1
    Removing windows_aarch64_msvc v0.36.1
    Removing windows_i686_gnu v0.36.1
    Removing windows_i686_msvc v0.36.1
    Removing windows_x86_64_gnu v0.36.1
    Removing windows_x86_64_msvc v0.36.1
    Updating zbus v3.8.0 -> v3.9.0
    Updating zbus_macros v3.8.0 -> v3.9.0

* Update wasm-bindgen to 0.2.84

* cargo update

    Updating js-sys v0.3.60 -> v0.3.61
    Updating wasm-bindgen-futures v0.4.33 -> v0.4.34
    Updating web-sys v0.3.60 -> v0.3.61

* Update pollster to 0.3

* Update rfd to 0.11

* Make sure we never depend on cmake
2023-02-08 18:11:34 +01:00
Emil Ernerfeldt 636a39cbe1
Update `glow` to 0.12 (#2695)
* Remove three-d example due to glow incompatibility

* Update to glow 0.12

* Remove three-d from deny.toml

* Add line to changelog
2023-02-08 17:16:44 +01:00