Commit graph

2368 commits

Author SHA1 Message Date
Emil Ernerfeldt
7b06a8d2d0 Move 'accesskit' to under optional dependencies with a docstring 2022-12-04 15:55:08 +01:00
Emil Ernerfeldt
125a7f0b1e Merge branch 'master' into accesskit 2022-12-04 15:49:26 +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
Matt Campbell
87d3a90718 Final planned refactor: a more flexible approach to hierarchy 2022-11-30 14:42:49 -06:00
Matt Campbell
ae3a982f47 Override a clippy lint; I seem to have no other choice 2022-11-30 14:04:05 -06:00
Matt Campbell
4a273c754d More refactoring of tree construction; don't depend on Arc::get_mut 2022-11-30 13:46:33 -06: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
345b3c77d1 Fix doc comment 2022-11-30 09:38:37 -06:00
Matt Campbell
7763ee09dc Eliminate the need for an explicit is_accesskit_active method, at least for now 2022-11-30 09:38:02 -06:00
Matt Campbell
49bbcf9b2e Refactor node mutation (again) 2022-11-30 09:20:12 -06:00
Matt Campbell
18ccf1fd10 Refactor lazy activation 2022-11-30 08:09:41 -06:00
Matt Campbell
3109ee9825 Make PlatformOutput::accesskit_update an Option 2022-11-30 07:09:03 -06:00
Matt Campbell
d14eab6cb0 See if I can get AccessKit exempted from the 'missing backticks' lint 2022-11-29 20:45:41 -06:00
Matt Campbell
c0668891e6 Tweak one of the doc comments 2022-11-29 20:45:07 -06:00
Matt Campbell
428213398d More documentation, particularly around lazy activation 2022-11-29 20:16:03 -06:00
Matt Campbell
884001f633 Update AccessKit 2022-11-29 19:47:59 -06:00
Matt Campbell
c47c3a1c03 fix clippy lint 2022-11-29 16:40:16 -06:00
Matt Campbell
2114978e9b Lazily activate egui's AccessKit support 2022-11-29 16:21:26 -06:00
Matt Campbell
9473dbdde1 Properly associate the slider label with both the slider and the drag value 2022-11-29 14:03:27 -06:00
Matt Campbell
a31d7dc4f2 Same for Slider 2022-11-29 13:43:37 -06:00
Matt Campbell
599d147cf6 Support the AccessKit SetValue for DragValue; this is the only way for a Windows AT to programmatically adjust the value 2022-11-29 13:13:48 -06:00
Matt Campbell
b65fd40f8c Refactor InputState functions for AccessKit actions 2022-11-29 13:04:37 -06:00
Matt Campbell
9e10822172 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. 2022-11-29 12:16:11 -06:00
Matt Campbell
a472d147d6 fix clippy lint 2022-11-29 11:35:44 -06:00
Matt Campbell
a08282f7af Avoid VoiceOver race condition bug 2022-11-29 11:26:23 -06:00
Matt Campbell
de62604b0d Restore support for increment and decrement actions in DragValue 2022-11-29 11:01:15 -06:00
Matt Campbell
6dd21180da Update AccessKit, introducing support for editable spinners on Windows and an important fix for navigation order on macOS 2022-11-29 10:33:14 -06:00
Matt Campbell
6483b45c6d squash before rebase 2022-11-29 10:26:48 -06: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