Commit graph

2362 commits

Author SHA1 Message Date
Emil Ernerfeldt
452541d7c2 Add a "sponsored by Rerun" section at the end of the README.md 2022-12-06 10:58:51 +01:00
Luke Jones
be4a5be145
egui_glow: update example to latest glutin (#2396)
This lifts the context handling from commit hash 8eb687c as this does
all the required handling for us that the older glutin once did.
2022-12-06 10:02:20 +01:00
Matt Campbell
32144d3cb9
Update README section on accessibility (#2392) 2022-12-05 20:40:01 +01:00
Emil Ernerfeldt
b8a1670781 Change demo keyboard shortcuts to some that work in the browser 2022-12-05 17:57:11 +01:00
Emil Ernerfeldt
a86ec5a749 Remove extra separator in color test 2022-12-05 17:38:38 +01:00
Emil Ernerfeldt
8ae4d49e6e More changelog updates 2022-12-05 17:38:30 +01:00
Mike Krüger
ee2582964d
Added KeyRepeat event. (#2389)
KeyPress no longer repeats.

Co-authored-by: Mike Krueger <mkrueger@posteo.de>
2022-12-05 17:37:25 +01:00
Emil Ernerfeldt
3519358b7b Clippy fix 2022-12-05 13:41:25 +01:00
Emil Ernerfeldt
be6d23eed1 Replace Stroke::none() with Stroke::NONE 2022-12-05 12:59:02 +01:00
Emil Ernerfeldt
df01db2df1 Add show_separator_line to SidePanel and TopBottomPanel
So as not to force it onto all users since #2261
2022-12-05 12:58:26 +01:00
Emil Ernerfeldt
aa503008ae Update changelogs with recent additions 2022-12-05 12:51:00 +01:00
Emil Ernerfeldt
d7fa40ebba
cargo update (#2386)
* Better cargo deny check in check.sh

* cargo update

    Updating ab_glyph v0.2.16 -> v0.2.18
    Updating ab_glyph_rasterizer v0.1.5 -> v0.1.7
    Removing adler32 v1.2.0
    Removing ahash v0.4.7
    Removing ahash v0.8.1
      Adding ahash v0.8.2
    Updating aho-corasick v0.7.18 -> v0.7.20
    Updating android_system_properties v0.1.4 -> v0.1.5
    Removing ansi_term v0.12.1
    Updating anyhow v1.0.62 -> v1.0.66
    Updating ash v0.37.0+1.3.209 -> v0.37.1+1.3.235
    Updating async-channel v1.7.1 -> v1.8.0
    Updating async-executor v1.4.1 -> v1.5.0
    Updating async-io v1.8.0 -> v1.12.0
    Updating async-lock v2.5.0 -> v2.6.0
    Updating async-recursion v0.3.2 -> v1.0.0
    Updating async-trait v0.1.57 -> v0.1.59
    Updating base64 v0.13.0 -> v0.13.1
    Updating bindgen v0.61.0 -> v0.63.0
      Adding block-buffer v0.10.3
    Updating bumpalo v3.11.0 -> v3.11.1
    Updating bytemuck v1.12.1 -> v1.12.3
    Updating bytemuck_derive v1.2.1 -> v1.3.0
    Updating bytes v1.2.1 -> v1.3.0
    Removing cache-padded v1.2.0
    Updating calloop v0.10.1 -> v0.10.3
    Updating cc v1.0.73 -> v1.0.77
    Updating cfg-expr v0.10.3 -> v0.11.0
    Updating chrono v0.4.22 -> v0.4.23
    Updating clang-sys v1.3.3 -> v1.4.0
    Updating clap v3.2.17 -> v3.2.23
    Updating cmake v0.1.48 -> v0.1.49
    Updating cocoa v0.24.0 -> v0.24.1
    Updating concurrent-queue v1.2.4 -> v2.0.0
      Adding cpufeatures v0.2.5
    Updating crossbeam-utils v0.8.11 -> v0.8.14
    Updating crossfont v0.5.0 -> v0.5.1
      Adding crypto-common v0.1.6
      Adding cxx v1.0.83
      Adding cxx-build v1.0.83
      Adding cxxbridge-flags v1.0.83
      Adding cxxbridge-macro v1.0.83
    Updating dark-light v0.2.2 -> v0.2.3
    Removing deflate v1.0.0
      Adding digest v0.10.6
    Updating dlv-list v0.2.3 -> v0.3.0
    Updating document-features v0.2.3 -> v0.2.6
    Updating flate2 v1.0.24 -> v1.0.25
    Updating fontconfig-parser v0.5.0 -> v0.5.1
    Updating fontdb v0.9.1 -> v0.9.3
    Updating form_urlencoded v1.0.1 -> v1.1.0
    Updating futures-core v0.3.23 -> v0.3.25
    Updating futures-io v0.3.23 -> v0.3.25
    Updating futures-sink v0.3.23 -> v0.3.25
    Updating futures-task v0.3.23 -> v0.3.25
    Updating futures-util v0.3.23 -> v0.3.25
      Adding generic-array v0.14.6
    Updating getrandom v0.2.7 -> v0.2.8
    Removing hashbrown v0.9.1
    Updating iana-time-zone v0.1.46 -> v0.1.53
      Adding iana-time-zone-haiku v0.1.1
    Updating idna v0.2.3 -> v0.3.0
    Updating image v0.24.3 -> v0.24.5
    Updating indexmap v1.9.1 -> v1.9.2
    Updating itertools v0.10.3 -> v0.10.5
    Updating itoa v1.0.3 -> v1.0.4
      Adding jni v0.20.0
    Updating jobserver v0.1.24 -> v0.1.25
      Adding jpeg-decoder v0.3.0
    Updating libc v0.2.132 -> v0.2.138
    Updating libloading v0.7.3 -> v0.7.4
    Updating libm v0.2.5 -> v0.2.6
      Adding link-cplusplus v1.0.7
      Adding litrs v0.2.3
    Updating lock_api v0.4.7 -> v0.4.9
    Updating memmap2 v0.5.7 -> v0.5.8
    Removing miniz_oxide v0.5.3
      Adding miniz_oxide v0.5.4
      Adding miniz_oxide v0.6.2
    Updating mio v0.8.4 -> v0.8.5
    Removing nix v0.22.3
    Removing nix v0.23.1
    Removing nix v0.24.2
      Adding nix v0.24.3
      Adding nix v0.25.1
      Adding nu-ansi-term v0.46.0
    Removing num_threads v0.1.6
    Updating once_cell v1.13.1 -> v1.16.0
    Updating ordered-multimap v0.3.1 -> v0.4.3
    Updating ordered-stream v0.0.1 -> v0.1.2
    Updating os_str_bytes v6.3.0 -> v6.4.1
      Adding overload v0.1.1
    Updating owned_ttf_parser v0.15.1 -> v0.17.1
    Updating parking_lot_core v0.9.3 -> v0.9.5
    Updating percent-encoding v2.1.0 -> v2.2.0
    Updating pkg-config v0.3.25 -> v0.3.26
    Updating png v0.17.5 -> v0.17.7
    Updating polling v2.2.0 -> v2.5.1
    Updating ppv-lite86 v0.2.16 -> v0.2.17
    Updating proc-macro2 v1.0.43 -> v1.0.47
    Updating profiling v1.0.6 -> v1.0.7
    Updating rand_core v0.6.3 -> v0.6.4
    Updating regex v1.6.0 -> v1.7.0
    Updating regex-syntax v0.6.27 -> v0.6.28
    Updating rgb v0.8.33 -> v0.8.34
      Adding roxmltree v0.15.1
    Updating rust-ini v0.17.0 -> v0.18.0
    Updating rustls v0.20.6 -> v0.20.7
    Updating scoped-tls v1.0.0 -> v1.0.1
      Adding scratch v1.0.2
    Updating sctk-adwaita v0.4.2 -> v0.4.3
    Updating serde v1.0.143 -> v1.0.149
    Updating serde_derive v1.0.143 -> v1.0.149
    Updating serde_json v1.0.83 -> v1.0.89
    Updating sha1 v0.6.1 -> v0.10.5
    Removing sha1_smol v1.0.0
    Updating smallvec v1.9.0 -> v1.10.0
    Updating socket2 v0.4.4 -> v0.4.7
    Updating svgtypes v0.8.1 -> v0.8.2
    Updating syn v1.0.99 -> v1.0.105
    Removing synstructure v0.12.6
    Updating system-deps v6.0.2 -> v6.0.3
    Updating textwrap v0.15.0 -> v0.16.0
    Updating thiserror v1.0.32 -> v1.0.37
    Updating thiserror-impl v1.0.32 -> v1.0.37
    Removing time v0.1.44
    Removing time v0.3.13
      Adding time v0.1.45
      Adding time v0.3.17
      Adding time-core v0.1.0
      Adding time-macros v0.2.6
    Updating tracing v0.1.36 -> v0.1.37
    Updating tracing-attributes v0.1.22 -> v0.1.23
    Updating tracing-core v0.1.29 -> v0.1.30
    Updating tracing-subscriber v0.3.15 -> v0.3.16
      Adding ttf-parser v0.17.1
      Adding typenum v1.15.0
    Updating unicode-ident v1.0.3 -> v1.0.5
    Updating unicode-normalization v0.1.21 -> v0.1.22
    Updating unicode-script v0.5.4 -> v0.5.5
    Updating unicode-width v0.1.9 -> v0.1.10
    Updating unicode-xid v0.2.3 -> v0.2.4
    Updating url v2.2.2 -> v2.3.1
    Updating version-compare v0.1.0 -> v0.1.1
    Updating wayland-client v0.29.4 -> v0.29.5
    Updating wayland-commons v0.29.4 -> v0.29.5
    Updating wayland-cursor v0.29.4 -> v0.29.5
    Updating wayland-egl v0.29.4 -> v0.29.5
    Updating wayland-protocols v0.29.4 -> v0.29.5
    Updating wayland-scanner v0.29.4 -> v0.29.5
    Updating wayland-sys v0.29.4 -> v0.29.5
    Updating webbrowser v0.8.0 -> v0.8.2
    Updating webpki-roots v0.22.4 -> v0.22.5
    Updating wgpu v0.14.0 -> v0.14.2
    Updating wgpu-core v0.14.0 -> v0.14.2
    Updating wgpu-hal v0.14.0 -> v0.14.1
    Updating wgpu-types v0.14.0 -> v0.14.1
    Updating which v4.2.5 -> v4.3.0
    Updating widestring v0.5.1 -> v1.0.2
      Adding windows-sys v0.42.0
    Updating winreg v0.8.0 -> v0.10.1
    Updating x11-dl v2.20.0 -> v2.20.1
    Updating xmlparser v0.13.3 -> v0.13.5
    Updating zbus v2.3.2 -> v3.6.0
    Updating zbus_macros v2.3.2 -> v3.6.0
    Updating zbus_names v2.2.0 -> v2.4.0
    Updating zerocopy-derive v0.3.1 -> v0.3.2
    Updating zstd-sys v2.0.1+zstd.1.5.2 -> v2.0.4+zstd.1.5.2
    Updating zvariant v3.6.0 -> v3.9.0
    Updating zvariant_derive v3.6.0 -> v3.9.0

* downgrade image, webbrowser and fontconfig-parser to pass cargo deny

avoiding duplicate crate

* Remove unused dependency on egui_extras from screenshot demo

* Downgrade `chrono` to avoid having to fix egui-extras now
2022-12-05 12:12:51 +01:00
Red Artist
8eb687cf04
Glutin Upgrade (#2187)
* working. but x11 blurry

* fixed x11 blurry. was just accidentally using multisampling even when user didnt request it

* allow dbg macro temporarily

* add windows WGL fallback support when EGL fails

* fmt

* glutin features explicitly added

* extract glutin context creation into a fn

* fix warnings
2022-12-05 11:34:28 +01:00
Emil Ernerfeldt
3ba39c3022
Hide all Area:s and Window:s the first frame to hide first-frame-jitters (#2385) 2022-12-05 11:18:01 +01:00
Emil Ernerfeldt
0b2d56cff0
Grid: special-treat first frame to fix bug causing expanding grids (#2384) 2022-12-05 11:16:37 +01:00
Emil Ernerfeldt
4e59296cbb Minor code tweaks 2022-12-05 09:45:07 +01:00
Emil Ernerfeldt
5093b67e9b Enable and fix some more clippy lints 2022-12-05 09:29:59 +01:00
Matt Campbell
e1f348e4b2
Implement accessibility APIs via AccessKit (#2294)
* squash before rebase

* Update AccessKit, introducing support for editable spinners on Windows and an important fix for navigation order on macOS

* Restore support for increment and decrement actions in DragValue

* Avoid VoiceOver race condition bug

* fix clippy lint

* Tell AccessKit that the default action for a text edit (equivalent to a click) is to set the focus. This matters to some platform adapters.

* Refactor InputState functions for AccessKit actions

* Support the AccessKit SetValue for DragValue; this is the only way for a Windows AT to programmatically adjust the value

* Same for Slider

* Properly associate the slider label with both the slider and the drag value

* Lazily activate egui's AccessKit support

* fix clippy lint

* Update AccessKit

* More documentation, particularly around lazy activation

* Tweak one of the doc comments

* See if I can get AccessKit exempted from the 'missing backticks' lint

* Make PlatformOutput::accesskit_update an Option

* Refactor lazy activation

* Refactor node mutation (again)

* Eliminate the need for an explicit is_accesskit_active method, at least for now

* Fix doc comment

* More refactoring of tree construction; don't depend on Arc::get_mut

* Override a clippy lint; I seem to have no other choice

* Final planned refactor: a more flexible approach to hierarchy

* Last AccessKit update for this PR; includes an important macOS DPI fix

* Move and document the optional accesskit dependency

* Fix comment typo

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

* reformat

* More elegant code for conditionally creating a node

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

* Set step to 1.0 for all integer sliders

* Add doc example for Response::labelled_by

* Clarify a TODO comment I left for myself

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-12-04 19:17:12 +01:00
Emil Ernerfeldt
48666e1d7a
Automatically generate screenshots for all examples (#2379) 2022-12-04 17:27:40 +01:00
winne42
b774159fc8
let monospace text style be monospaced (#2201)
* let monospace text style be monospaced

* use monospace shortcut
2022-12-04 15:39:55 +01:00
Emil Ernerfeldt
ec0b2d8e9a Deprecate ui.centered
It didn't do what it advertised to do, and there is no simple way
of doing that right now.
2022-12-04 10:16:37 +01:00
Emil Ernerfeldt
c8771cd13e Add some minor improvements for debugging id clashes 2022-12-02 09:52:26 +01:00
Emil Ernerfeldt
e613315866 Improve issue templates 2022-12-02 09:51:21 +01:00
Emil Ernerfeldt
7133818c59
Make sure scroll bars are always visible (#2371)
* Nicer debug rectangles

* Move scrollbars into the clip-rect so they are always visible

* Improve table demo

* Add options for controlling inner and outer margin of the scroll bars

* Add line to changelog

* Update egui_extras changelog with recent Table improvements

* Refactor Table:s scroll options

* Add Table::auto_size

* Rename it auto_shrink
2022-11-30 22:58:00 +01:00
JP
85f8eeb9d5
Fix key pressed event (#2334)
* Fix key press event

* Add example with key presses

* Changelog line for key_press fix

* PR review improvements

* Add PR link in changelog

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-11-30 20:40:11 +01:00
Emil Ernerfeldt
2dc2a5540d
egui_extras::Table improvements (#2369)
* Use simple `ui.interact` for the resize line

* Introduce TableReizeState

* Simplify some code

* Add striped options to table demo

* Auto-size table columns by double-clicking the resize line

* Table: add option to auto-size the columns

* Table: don't let column width gets too small, unless clipping is on

* egui_extras: always use serde

Otherwise using `get_persisted` etc is impossible,
and working around that tedious.

* Avoid clipping last column in a resizable table

* Some better naming

* Table: Use new `Column` for setting column sizes and properties

Also make `clip` a per-column property

* All Table:s store state for auto-sizing purposes

* Customize each column wether or not it is resizable

* fix some auto-sizing bugs

* Fix shrinkage of adaptive column content

* Rename `scroll` to `vscroll` for clarity

* Add Table::scroll_to_row

* scroll_to_row takes alignment

* Fix bug in table sizing

* Strip: turn clipping OFF by default, because it is dangerous and sucks

* Add TableBody::mac_rect helper

* Table: add options to control the scroll area height.

* Docstring fixes

* Cleanup
2022-11-30 19:56:06 +01:00
Matt Campbell
0336816faf
Fix keyboard support in DragValue (#2342)
* Enable incrementing and decrementing `DragValue` with the keyboard

* As soon as a DragValue is focused, render it in edit mode

* Simpler, more reliable approach to managing the drag value's edit string

* Add changelog entry

* Update doc comment

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

* Add comment explaining why we don't listen for left/right arrow

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-11-29 15:27:14 +01:00
Fotis Gimian
975cbac83a
Update the glow example to avoid a white flash when the app starts. (#2345) 2022-11-29 15:04:17 +01:00
Emil Ernerfeldt
a3f1e5961f Fix bug in keyboard shortcut formatting 2022-11-27 22:03:42 +01:00
Erlend Walstad
c5e6def65e
Only update pixels_per_point when it has changed (#2352) 2022-11-27 17:22:45 +01:00
Erlend Walstad
d2f70cdcd1
Make it easier to convert strings to Id (#2350) 2022-11-27 13:15:18 +01:00
Nagy Tibor
502e1aa229
Do not emit changed responses on unchanged values in selectable_value/radio_value (#2343) 2022-11-25 22:23:56 +01:00
Lukas Hermann
f9066ff285
[WGPU] Allow for depth buffer in web target (#2335)
* Add depth stencil initialization to `Painter`

* Move depth stencil initialization into `resize_and_generate_depth_texture_view`, and call it in `set_window` and `on_window_resized`

* Allow for depth texture in WASM builds

* change `map` to `if let` statement

* use reference for render state

* Clean up descriptors and move texture generation to on resize events

* remove unused field from WebOptions
2022-11-24 20:40:53 +01:00
Emil Ernerfeldt
7d8154971b
Update ndk-sys v0.4.0 -> v0.4.1+23.1.7779620 (#2340)
Closes https://github.com/emilk/egui/issues/2336
2022-11-24 10:09:32 +01:00
Felix Zwettler
f3633534e7
add set_plot_bounds method, giving users the ability to set the plot bounds themselves. (#2320)
* add set_plot_bounds method

* call it from_min_max for consistency with Rect

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-11-22 15:05:23 +01:00
Emil Ernerfeldt
bde47c9957
epaint: cover default fonts in the license field (#2327) 2022-11-22 13:44:01 +01:00
Emil Ernerfeldt
8602326af5 Plot: round hlines, vlines, and grid lines to pixels to avoid aliasing 2022-11-22 13:42:52 +01:00
Emil Ernerfeldt
8671aa26e1 Added support for thin space
https://en.wikipedia.org/wiki/Thin_space
2022-11-21 17:33:23 +01:00
Emil Ernerfeldt
1c8cf9e3d5
Move egui::util::History to emath::History (#2329)
* Move egui::util::History to emath::History

It is a nice thing to use outside of egui,
and it is more math-related than gui-related.

* Fix doctest
2022-11-21 14:14:33 +01:00
Lukas Hermann
f4d8ab9779
[wgpu] Add depth stencil initialization to Painter (#2316) 2022-11-21 10:08:24 +01:00
Clement Rey
dfc1f2c470
add plot_secondary_clicked to plot_ui (#2318) 2022-11-17 17:07:42 +01:00
Emil Ernerfeldt
eca5e6a4d2
Update to Rust 1.65 (#2314)
* Update to Rust 1.65

Because then you can use dynamic linking on Linux

* Fix a bunch of clippy lints

* Update changelogs

* More clippy fixes
2022-11-16 19:08:03 +01:00
Clement Rey
f7019926dc
wgpu backend: do not try to render zero-sized surfaces (#2313)
* wgpu backend: do not try to render zero-sized surfaces

* reverse if

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-11-16 18:03:57 +01:00
Emil Ernerfeldt
9268f43896
eframe: make RequestRepaintEvent into an enum UserEvent (#2311)
Preparation for https://github.com/emilk/egui/pull/2294
to make that a smaller diff.
2022-11-16 12:17:41 +01:00
Robert Walter
0ff1ee3893
feat(combobox): implement text wrap for selected text (#2272)
* feat(combobox): implement text wrap for selected text

* chore(changelog): add line to changelog

* feat(combobox-text-wrap): make wrap boolean

- specifying a wrap width didn't really make sense so now it's boolean
- the selected text will now use the maximum available width while still
  respecting the spacing and icon coming after it

* feat(combobox-text-wrap): update changelog
2022-11-16 11:57:27 +01:00
Arshia Soleimani
0ba04184d5
Improve mouse selection accuracy (#2304)
* updated

* Update crates/egui/src/context.rs

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

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-11-16 11:26:02 +01:00
Matt Fellenz
690dc2d2e8
Add 'none' alias to Sense::hover (#2306) 2022-11-14 11:44:46 +01:00
Emil Ernerfeldt
ef931c406c
Add Window::pivot and position combo boxes better (#2303)
* Paint ComboBox icon differently if opening upwards

* Add Area::pivot and Window::pivot

* Add Window::contrain

* ComboBox: pop up above if it doesn't fit below

* Add line to changelog
2022-11-13 22:17:33 +01:00
LoganDark
f0f41d60e1
eframe: Don't show window until after initialization (#2279)
* Don't show window until after initialization

Shortens #1802, but does not completely solve it

* format code

* Present first frame immediately before showing window

This resolves the white flash almost completely, but is a hack. Window
visibility should be derived from the AppOutput, and the first frame
should not be painted before the event loop has processed initial
events.

Working on a better implementation.

* Integrate window showing with AppOutput

This allows an app to keep the window hidden (never shown) by calling
Frame.set_visible(false) on the first update. This includes a slightly
less nasty hack than the last commit did.

Also fixes an accidental cross-contamination of pull requests.

* fmt

* add comments

* add comments

* add comments

* add comments

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-11-13 20:30:52 +01:00
LoganDark
5bac853d9c
eframe: Repaint immediately on RepaintAsap, fixes #903 (#2280)
* eframe: Repaint immediately on RepaintAsap, fixes #903

This completely eliminates the white flickering seen on Windows when
rapidly resizing a window on the glow backend. The reason that happens
is because DWM only waits for the resize event to be delivered before
displaying the window at its new size. You must repaint synchronously
inside that iteration of the event loop or else you get flickering.

* Differentiate between RepaintAsap and RepaintNext

RepaintNext looks like it is indeed needed in at least one case instead
of RepaintAsap.

* Use RepaintNext in more situations

Starting to understand why this was the behavior. It looks like only a
few special cases should be given RepaintAsap, such as the window being
resized. All other cases should be RepaintNext, as it can wait.

Using RepaintAsap in all situations will cause things like lag when
changing a slider by keyboard with a high key repeat rate.

* Add explanatory comments

I am a total hypocrite for forgetting to add these.

* Rename RepaintAsap to RepaintNow

There is no notion of "possibility" here like there is when waiting for
RedrawEventsCleared. RepaintNow causes an immediate repaint no matter
what.

* Fix RepaintNow comment

"Delays" is ambiguous.
2022-11-13 20:30:39 +01:00