Commit Graph

398 Commits

Author SHA1 Message Date
Emil Ernerfeldt 7e035c6dd1
Allow users to opt-out of default `winit` features (#3228)
* Do not enable winit features by default

* Enable default winit features by default

* Add x11 feature
2023-08-10 17:09:01 +02:00
Emil Ernerfeldt d568d9f5d0
Lint vertical spacing in the code (#3224)
* Lint vertical spacing in the code

* Add some vertical spacing for readability
2023-08-10 15:26:54 +02:00
Emil Ernerfeldt 83c18498e9
Refactor: turn `ClippedShape` from struct-enum to a normal struct (#3225) 2023-08-10 14:50:11 +02:00
Emil Ernerfeldt 66cbb61ad5
Add `PlotUi::response()` to replace `plot_clicked()` etc (#3223)
Closes https://github.com/emilk/egui/pull/2571
2023-08-10 13:14:19 +02:00
Valentin b15e17587a
Document when Galleys get invalidated (#3024) 2023-08-10 13:11:56 +02:00
Emil Ernerfeldt 8cdffc4e2d
Replace uses of `RangeInclusive<f32>` with `emath::Rangef` (#3221)
* Replace uses of `RangeInclusive<f32>` with `emath::Rangef`

* Fix doc-test
2023-08-10 13:07:00 +02:00
Valeriy V. Vorotyntsev 4c3b380889
Fix the "ever-growing height" problem of Strip and Table demos (#3122)
* Fix the "ever-growing height" problem of Strip and Table Demos

Problem
-------

The height of "Table Demo" or "Strip Demo" floating window grows
when the demo app is interacted with. If 'Continuous' mode is enabled
in 'Backend' settings, the window grows irrespectively of user interaction.

Observations
------------

I noticed that [`area_content_ui.min_rect().max.y`][1] is increasing
monotonically with speed 0.5 px/frame.

I also noticed that commenting out `ui.add(crate::egui_github_link_file!());`
[statement][2] in `table_demo.rs` makes the problem disappear.

The "Fix"
---------

I added 0.5 to the height of the row with GitHub link.
This solved the problem.

Closes #3029.

Warning
-------

I failed to find the root cause of the problem.
I don't understand why this change makes the problem disappear.

[1]: 9478e50d01/crates/egui/src/containers/window.rs (L403)
[2]: 9478e50d01/crates/egui_demo_lib/src/demo/table_demo.rs (L114)

* Document `Rect::size`

Other changes:

- `area.rs`: Use existing API.
- `table_demo.rs`: Remove unnecessary call.
2023-08-10 12:35:40 +02:00
Roshan Mehta 01b1b2da76
rotation feature to plot images (#3121) 2023-08-10 09:50:25 +02:00
jacekpoz f2a58244c8
fix the title not being used when app_id is not set (#3107)
Co-authored-by: jacekpoz <jacekpoz@cock.li>
2023-08-10 09:50:15 +02:00
mauliu af6419343d
fix depth texture init with multisampling (#3207)
Co-authored-by: user <email@NEO.com>
2023-08-09 20:59:36 +02:00
Barugon f9f9abf749
`DragValue`: update value on each key press by default (#2880)
* Use `Response::changed` to fix editing issues

* Update comment

* Make update while editing an option

* improve docstring

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-08-09 17:13:58 +02:00
Emil Ernerfeldt 51da2ac490 Improve documentation of Window/Area::resizable 2023-08-09 17:13:10 +02:00
Emil Ernerfeldt 92593b70fa Changelogs: document that they are updated upon release (not by users) 2023-08-09 17:12:47 +02:00
Steven Weiss b2b6558c78
Tiny PR: Document available_width() and available_height() (#3130)
* Update ui.rs docs to clarify available_size and co

Added docs to the available_width() and available_height() methods. 

Added a quick note about the wrapping versions of the methods as well.

* fix a couple of typos, and use code-style for doc-links

* fix doclinks

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-08-09 17:06:33 +02:00
Agustín Díaz f2769f3010
Fix dobule "for" typo (#3189) 2023-08-09 16:48:21 +02:00
Nicolas Riebesel cbdf748a3b
egui: Plot Arrows add method to specify tip_size (#3138)
Normally the tip_size will be dependent on the arrow length.
This patch adds a new method to explicitly set the arrow tip size.
2023-08-09 16:47:46 +02:00
thomaseliot e82ec74c5c
epaint: Add `ColorImage::from_gray` (#3166)
* epaint: Add from_gray_unmultiplied function

* Rename to just `from_gray`

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-08-09 16:46:45 +02:00
Ho Kim 35027d3ebe
Fix a document: `eframe::start_web` (#3026)
In `0.22.0`,  `eframe::start_web` has been replaced with `eframe::WebRunner`, which also installs a nice panic hook (no need for `console_error_panic_hook`).
2023-08-09 16:24:32 +02:00
Yuan Chang 20be0847c8
Add `into_inner` methods. (#3110) 2023-08-09 16:20:59 +02:00
Stephen M. Coakley 486cff8ac3
Fix panic with persistence without window (#3167)
A window may not always be available and may have already been closed by the time an eframe app is closing. An example of this is Android, where the main activity window may have been stopped or discarded because the app is no longer in the foreground, and then the user decides to close your app without resuming it using the multitasking view.

In this case, skip the window persistence step if it does not exist anymore by the time we are saving the persistence data. Currently eframe will panic with `winit window doesn't exist` instead.
2023-08-09 12:42:43 +02:00
Brian Janssen 67ba4f2811
Add comment explaining Tab button (#2872) 2023-08-09 11:48:54 +02:00
Felix Wiegand d483ac47ba
Fix auto_bounds when only one axis has restricted navigation (#3171) 2023-08-09 11:08:04 +02:00
lampsitter cd917e49f2
Separate text cursor from selection visuals (#3181) 2023-08-09 11:07:40 +02:00
Emil Ernerfeldt 0e5f93b65d
Add `Margin::expand_rect` and `shrink_rect` (#3214)
* Add `Margin::expand_rect` and `shrink_rect`

* fix typo

* Use the new helpers
2023-08-08 11:50:10 +02:00
Antoine Beyeler bdc8795b04
Set the correct unicode character for "ctrl" shortcuts (#3186)
Fixes rerun-io/rerun#2862
2023-07-28 17:53:06 +02:00
Serv 339b758c60
fixed char limit (#3173) 2023-07-26 20:21:28 +02:00
Matt Fellenz 65eecde244
Use cfg attribute (#3113) 2023-07-26 19:07:05 +02:00
Forest Anderson 936c9583b5
Spelling fix (#3133) 2023-07-26 19:00:51 +02:00
bernsteining 67d5bd4392
fix(docs): remove duplicate typo (#3111) 2023-07-26 19:00:13 +02:00
jacekpoz beb2ecf7e4
fix typo in NativeOptions docs (#3108)
Co-authored-by: jacekpoz <jacekpoz@cock.li>
2023-07-26 18:59:49 +02:00
Dirk Stolle ff24ffbcbd
Fix a typo (#3149) 2023-07-17 11:14:44 +02:00
Emil Ernerfeldt 083d61fccd
Update to puffin 0.16 (#3144) 2023-07-10 12:29:01 +02:00
icedrocket 2a2529bb9c
eframe: sleep a bit only when minimized (#3139) 2023-07-10 10:56:24 +02:00
amfaber 9478e50d01
Fix panic on wgpu GL backend due to new screenshot capability (#3078)
* Triage for GL backend

* And cargo-fmt

* Changelog update with PR and issue

* Update crates/eframe/src/epi/mod.rs

Co-authored-by: Andreas Reich <r_andreas2@web.de>

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

Co-authored-by: Andreas Reich <r_andreas2@web.de>

* Add "supports_screenshot" to surface state

* Cranky fix

* fmt

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2023-06-15 11:16:25 +02:00
bilabila 9774d4af2c
eframe: fix android app quit on resume with glow backend (#3080) 2023-06-15 09:05:11 +02:00
τ 073f49682d
Expose Raw Window and Display Handles (#3073)
* Expose raw window and display handles in eframe

* Ensure that no one implements `Clone` in the future

* Cleanup

---------

Co-authored-by: Matti Virkkunen <mvirkkunen@gmail.com>
2023-06-11 22:18:28 +02:00
Emil Ernerfeldt 5cd40f9685 Fix some typos 2023-06-11 19:34:32 +02:00
pan93412 860dac69da
eframe: Only run_return twice on Windows (#3053)
The approach of #1889 may remove observers in a view
twice, which produces the Obj-C Exception:

    Cannot remove an observer <...> for the key path
    "nextResponder" from <WinitView ...> because
    it is not registered as an observer.

The above message can only be seen when attaching the
application to debugger. Users normally see:

    [1]    *** trace trap  cargo run

This commit fixes it by only running `event_loop.run_return()`
twice on Windows. Besides:

* We have set `ControlFlow::Exit` on `Event::LoopDestroyed`,
  `EventResult::Exit` and on error; therefore, it is safe
  to not calling `set_exit()`.
* This commit also fix the persistence function in macOS.
  It can't store the content in Memory due to this exception.

Fixed: #2768 (eframe: "App quit unexpectedly" on macOS)

Signed-off-by: pan93412 <pan93412@gmail.com>
2023-06-05 14:57:21 +02:00
Emil Ernerfeldt 0fda44c4ad fix typo in changelog 2023-06-05 14:56:39 +02:00
Emil Ernerfeldt 307565efa5 Release 0.22.0 - A plethora of small improvements 2023-05-23 19:58:04 +02:00
Emil Ernerfeldt cccdfd246e Cleanup ahead of release 2023-05-23 19:53:32 +02:00
Emil Ernerfeldt cb6bcde22c Update changelogs 2023-05-23 17:33:01 +02:00
Emil Ernerfeldt b07a675439 Fix egui_extras chonos dependency list 2023-05-23 13:30:54 +02:00
Emil Ernerfeldt bb252e2788
Check `egui_extras --all-features` on CI (#3019)
* Check egui_extras --all-features on CI

* Fix egui_extras with `datepicker` feature
2023-05-23 09:26:40 +02:00
Emil Ernerfeldt 8c5d235bfb
cargo update (#3018)
* cargo update

    Updating crates.io index
    Updating ab_glyph v0.2.20 -> v0.2.21
    Updating aho-corasick v0.7.20 -> v1.0.1
    Updating android-activity v0.4.0 -> v0.4.1
    Updating anyhow v1.0.69 -> v1.0.71
    Updating arrayref v0.3.6 -> v0.3.7
    Updating async-broadcast v0.5.0 -> v0.5.1
    Updating async-executor v1.5.0 -> v1.5.1
    Updating async-io v1.12.0 -> v1.13.0
    Updating async-lock v2.6.0 -> v2.7.0
    Updating async-recursion v1.0.2 -> v1.0.4
    Updating async-task v4.3.0 -> v4.4.0
    Updating async-trait v0.1.64 -> v0.1.68
    Updating atomic_refcell v0.1.9 -> v0.1.10
      Adding base64 v0.21.1
    Updating bindgen v0.64.0 -> v0.65.1
    Updating bitflags v2.1.0 -> v2.3.1
    Updating block-buffer v0.10.3 -> v0.10.4
    Updating bumpalo v3.12.0 -> v3.13.0
    Updating bytemuck v1.13.0 -> v1.13.1
    Updating bytemuck_derive v1.4.0 -> v1.4.1
    Updating cfg-expr v0.11.0 -> v0.15.1
    Updating chrono v0.4.23 -> v0.4.24
    Updating ciborium v0.2.0 -> v0.2.1
    Updating ciborium-io v0.2.0 -> v0.2.1
    Updating ciborium-ll v0.2.0 -> v0.2.1
    Updating clang-sys v1.4.0 -> v1.6.1
    Updating clap v3.2.23 -> v3.2.25
    Updating cocoa-foundation v0.1.0 -> v0.1.1
    Updating concurrent-queue v2.1.0 -> v2.2.0
    Updating core-foundation-sys v0.8.3 -> v0.8.4
    Updating cpufeatures v0.2.5 -> v0.2.7
    Updating crossbeam-utils v0.8.14 -> v0.8.15
    Removing cxx v1.0.89
    Removing cxx-build v1.0.89
    Removing cxxbridge-flags v1.0.89
    Removing cxxbridge-macro v1.0.89
    Updating digest v0.10.6 -> v0.10.7
    Updating dyn-clone v1.0.10 -> v1.0.11
    Updating enum-map v2.4.2 -> v2.5.0
    Updating enumn v0.1.6 -> v0.1.8
    Removing errno v0.2.8
    Updating fastrand v1.8.0 -> v1.9.0
      Adding fdeflate v0.3.0
    Updating flate2 v1.0.25 -> v1.0.26
    Updating futures-core v0.3.26 -> v0.3.28
    Updating futures-io v0.3.26 -> v0.3.28
    Updating futures-lite v1.12.0 -> v1.13.0
    Updating futures-sink v0.3.26 -> v0.3.28
    Updating futures-task v0.3.26 -> v0.3.28
    Updating futures-util v0.3.26 -> v0.3.28
    Updating generic-array v0.14.6 -> v0.14.7
    Updating getrandom v0.2.8 -> v0.2.9
    Updating gimli v0.27.1 -> v0.27.2
    Updating glutin v0.30.4 -> v0.30.8
    Updating glutin_egl_sys v0.4.0 -> v0.5.0
    Updating gpu-alloc v0.5.3 -> v0.5.4
      Adding home v0.5.5
    Updating iana-time-zone v0.1.53 -> v0.1.56
    Updating iana-time-zone-haiku v0.1.1 -> v0.1.2
    Updating image v0.24.5 -> v0.24.6
    Updating indexmap v1.9.2 -> v1.9.3
    Updating io-lifetimes v1.0.6 -> v1.0.10
    Updating itoa v1.0.5 -> v1.0.6
    Updating jni v0.20.0 -> v0.21.1
    Updating jobserver v0.1.25 -> v0.1.26
    Updating js-sys v0.3.61 -> v0.3.63
    Updating libc v0.2.139 -> v0.2.144
    Removing link-cplusplus v1.0.8
    Removing linux-raw-sys v0.1.4
    Removing linux-raw-sys v0.3.2
      Adding linux-raw-sys v0.3.8
    Updating memmap2 v0.5.8 -> v0.5.10
      Adding miniz_oxide v0.7.1
    Updating mio v0.8.5 -> v0.8.6
    Updating naga v0.12.0 -> v0.12.1
    Removing nom8 v0.2.0
    Updating num_enum v0.5.9 -> v0.5.11
    Updating num_enum_derive v0.5.9 -> v0.5.11
    Updating objc2 v0.3.0-beta.3 -> v0.3.0-beta.3.patch-leaks.3
    Updating once_cell v1.17.0 -> v1.17.1
    Updating orbclient v0.3.42 -> v0.3.45
    Updating ordered-stream v0.1.4 -> v0.2.0
    Updating os_str_bytes v6.4.1 -> v6.5.0
    Updating owned_ttf_parser v0.18.1 -> v0.19.0
    Updating parking v2.0.0 -> v2.1.0
    Updating paste v1.0.11 -> v1.0.12
    Updating pkg-config v0.3.26 -> v0.3.27
    Updating plist v1.4.0 -> v1.4.3
    Updating png v0.17.7 -> v0.17.8
    Updating polling v2.5.2 -> v2.8.0
      Adding prettyplease v0.2.5
    Updating proc-macro-crate v1.3.0 -> v1.3.1
    Updating proc-macro2 v1.0.56 -> v1.0.58
    Updating profiling v1.0.7 -> v1.0.8
    Updating puffin v0.14.2 -> v0.14.3
    Updating quick-xml v0.26.0 -> v0.28.2
    Updating quote v1.0.26 -> v1.0.27
    Updating range-alloc v0.1.2 -> v0.1.3
    Updating redox_syscall v0.3.4 -> v0.3.5
    Updating regex v1.7.1 -> v1.8.2
    Removing regex-syntax v0.6.28
      Adding regex-syntax v0.6.29
      Adding regex-syntax v0.7.2
    Updating rfd v0.11.0 -> v0.11.4
    Updating rgb v0.8.35 -> v0.8.36
    Updating rustc-demangle v0.1.21 -> v0.1.23
    Removing rustix v0.36.9
    Removing rustix v0.37.3
      Adding rustix v0.37.19
    Updating ruzstd v0.3.0 -> v0.3.1
    Updating ryu v1.0.12 -> v1.0.13
    Removing scratch v1.0.3
    Updating sctk-adwaita v0.5.3 -> v0.5.4
    Updating serde v1.0.152 -> v1.0.163
    Updating serde_derive v1.0.152 -> v1.0.163
    Updating serde_json v1.0.92 -> v1.0.96
    Updating serde_repr v0.1.10 -> v0.1.12
      Adding serde_spanned v0.6.2
      Adding simd-adler32 v0.3.5
    Updating slab v0.4.7 -> v0.4.8
    Updating socket2 v0.4.7 -> v0.4.9
    Removing syn v1.0.107
    Removing syn v2.0.15
      Adding syn v1.0.109
      Adding syn v2.0.16
    Updating system-deps v6.0.3 -> v6.1.0
      Adding target-lexicon v0.12.7
    Updating tempfile v3.4.0 -> v3.5.0
    Updating thiserror v1.0.38 -> v1.0.40
    Updating thiserror-impl v1.0.38 -> v1.0.40
    Updating time v0.3.17 -> v0.3.21
    Updating time-core v0.1.0 -> v0.1.1
    Updating time-macros v0.2.6 -> v0.2.9
    Updating tiny-skia v0.8.3 -> v0.8.4
    Updating tiny-skia-path v0.8.3 -> v0.8.4
    Updating toml v0.5.11 -> v0.7.4
    Updating toml_datetime v0.5.1 -> v0.6.2
    Updating toml_edit v0.18.1 -> v0.19.9
    Updating tracing-attributes v0.1.23 -> v0.1.24
    Updating tracing-core v0.1.30 -> v0.1.31
    Updating ttf-parser v0.18.1 -> v0.19.0
    Updating tts v0.25.0 -> v0.25.5
    Updating unicode-bidi v0.3.10 -> v0.3.13
    Updating unicode-ident v1.0.6 -> v1.0.8
    Updating walkdir v2.3.2 -> v2.3.3
    Updating wasm-bindgen-futures v0.4.34 -> v0.4.36
    Updating web-sys v0.3.61 -> v0.3.63
    Updating webbrowser v0.8.7 -> v0.8.10
    Removing wepoll-ffi v0.1.2
    Updating windows v0.43.0 -> v0.48.0
    Removing windows-sys v0.42.0
    Updating windows-targets v0.42.1 -> v0.42.2
    Updating windows_aarch64_gnullvm v0.42.1 -> v0.42.2
    Updating windows_aarch64_msvc v0.42.1 -> v0.42.2
    Updating windows_i686_gnu v0.42.1 -> v0.42.2
    Updating windows_i686_msvc v0.42.1 -> v0.42.2
    Updating windows_x86_64_gnu v0.42.1 -> v0.42.2
    Updating windows_x86_64_gnullvm v0.42.1 -> v0.42.2
    Updating windows_x86_64_msvc v0.42.1 -> v0.42.2
    Updating winit v0.28.1 -> v0.28.6
      Adding winnow v0.4.6
    Updating xml-rs v0.8.4 -> v0.8.13
    Updating zbus v3.9.0 -> v3.10.0
    Updating zbus_macros v3.9.0 -> v3.10.0
    Updating zbus_names v2.5.0 -> v2.5.1
    Updating zstd-sys v2.0.6+zstd.1.5.2 -> v2.0.8+zstd.1.5.5
    Updating zvariant v3.10.0 -> v3.14.0
    Updating zvariant_derive v3.10.0 -> v3.14.0
      Adding zvariant_utils v1.0.1

* Downgrade flate2 and png to avoid duplicated deps

* downgrade plist to avoid duplication of base64 crate

* Allow license `Apache-2.0 WITH LLVM-exception`

* Update to puffin 0.15
2023-05-23 09:25:39 +02:00
Emil Ernerfeldt 03bb89153b
eframe: Use `NativeOptions::AppId` for the persistance location (#3014)
* eframe: Use NativeOptions::AppId for the persistance location

* Fix doclinks

* Fix typo in docs

Closes https://github.com/emilk/egui/issues/3003
2023-05-23 08:38:14 +02:00
Emil Ernerfeldt 9d5b324787 Fix typo in docs
Closes https://github.com/emilk/egui/issues/3003
2023-05-23 08:37:32 +02:00
Emil Ernerfeldt 68a4239036
Fix --no-default-features (#3015) 2023-05-22 22:11:07 +02:00
Emil Ernerfeldt b5c24d6ec8 egui_demo_app: add some native window info 2023-05-22 21:40:16 +02:00
Emil Ernerfeldt 6a80e6fc74 Add doc-test example for Modifiers::matches 2023-05-22 21:40:16 +02:00