* Note the namechange of egui::color to egui::ecolor
* Use a solid triangle for collapsing headers and windows
* Add Shadow::NONE
* Add Visuals::panel_fill, window_fill and window_stroke
* Bug fix: ComboBox::width sets the outer width of the ComboBox
* egui_extras::Table: add functions to access the `Ui` for the header/body
* ComboBox: use solid triangle
* Tweak default menu margin
* Nudge panel separator lines so they stay visible
* Update changelogs
* 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>
* 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
* 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>
* 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>
* 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
* 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
* Fixed color edit popup going outside the screen
* Added option to constrain areas
* Constrain color picker area
* Constrain popups
* Updated changelog
* Only show tooltips when mouse pointer is still
Revert to the old behavior by setting
`style.interaction.show_tooltips_only_when_still = false`.
* Area: take `impl Into<Id>`
* refactor tooltips
* Fix was_tooltip_open_last_frame
* Bug fix
* Add some spacing between tooltips
* Turn off optimization for debug builds again
* Optimize rect_contains_pointer
* Fix for colorpicker: make popup immovable
* Area: interact first
* ScrollArea: do interaction first
* Window: shrink double-clickable area of titelbar
* Only the top-most (latest added) interactive widget gets `hovered=true`
* Add Frame::total_margin
* Update changelog
* Add debug-options to visualize what widgets cover which other widget
* Using tracing-subscriber in hello_world example
* Add Key::Plus/Minus/Equals
* Warn if failing to guess OS from User-Agent
* Remove jitter when using Context::set_pixels_per_point
* Demo app: zoom in/out using ⌘+ and ⌘-
* Demo app: make backend panel GUI scale slider better
* Optimize debug builds a bit
* typo
* Update changelog
* Add helper module `egui::gui_zoom` for zooming an app
* Better names, and update changelog
* Combine Plus and Equals keys
* Last fix
* Fix docs
* eframe web: Add WebInfo::user_agent
* Deprecate `Modifier::ALT_SHIFT`
* Add code for formatting Modifiers and Key
* Add type KeyboardShortcut
* Code cleanup
* Add Context::os/set_os to query/set what OS egui believes it is on
* Add Fonts::has_glyph(s)
* Add helper function for formatting keyboard shortcuts
* Faster code
* Add way to set a shortcut text on menu buttons
* Cleanup
* format_keyboard_shortcut -> format_shortcut
* Add TODO about supporting more keyboard sumbols
* Modifiers::plus
* Use the new keyboard shortcuts in emark editor demo
* Explain why ALT+SHIFT is a bad modifier combo
* Fix doctest
* Add API for querying the size of a panel
* demo app: animate backend panel collapse
* Add helper function for animating panels
* More animation functions
* Add line to changelog
Closes https://github.com/emilk/egui/issues/2068
Before this PR, the default font, Ubuntu-Light, was ~11% smaller
than it should have been, and the default monospace font, Hack,
was ~14% smaller. This means that setting the font size `12` in egui
would yield smaller text than using that font size in any other app.
Ooops!
The change is that this PR now takes into account the ttf properties
`units_per_em` and `height_unscaled`.
If your egui application has specified you own font sizes or text styles
you will see the text in your application grow
larger, unless you go in and compensate by dividing all font sizes by
~1.21 for Ubuntu-Light/Proportional and ~1.16 for Hack/Monospace,
and with something else if you are using a custom font!
This effects any use of `FontId`, `RichText::size`, etc.
This PR changes the default `Style::text_styles` to compensate,
so the default egui style should look the same before and after this PR.
* Add `custom_parser` to `DragValue`
* Add `custom_parser` to `Slider`
* Add `binary_u64`, `octal_u64`, and `hexadecimal_u64` to `DragValue`
* Add `binary_u64`, `octal_u64`, and `hexadecimal_u64` to `Slider`
* Fix formatting and errors in docs
* Update CHANGELOG.md
* Fix CI errors
* Replace manual number parsing with i64::from_str_radix. Add support for signed integers.
* Update CHANGELOG.md
* Change documentation.
* Fix documentation.
* Fix documentation.
* Remove unnecessary links.
* Better estimate the plot bounds for generator functions
Avoid infinities, and sample more densely
* Optimize and improve plot auto-bounds logic
* Fix cropping out of the top/bottom of plots during auto-bounds
This is a fix for the behaviour on macOS platforms where any egui app would use the dedicated GPU and consume more power than needed. Not all apps might have dedicated GPU requirements.
* Re-implement PaintCallbacks With Support for WGPU
This makes breaking changes to the PaintCallback system, but makes it
flexible enough to support both the WGPU and glow backends with custom
rendering.
Also adds a WGPU equivalent to the glow demo for custom painting.
This provides a better estimate of a typical frametime in reactive mode.
From the docstring of `stable_dt`:
Time since last frame (in seconds), but gracefully handles the first frame after sleeping in reactive mode.
In reactive mode (available in e.g. `eframe`), `egui` only updates when there is new input or something animating.
This can lead to large gaps of time (sleep), leading to large [`Self::unstable_dt`].
If `egui` requested a repaint the previous frame, then `egui` will use
`stable_dt = unstable_dt;`, but if `egui` did not not request a repaint last frame,
then `egui` will assume `unstable_dt` is too large, and will use
`stable_dt = predicted_dt;`.
This means that for the first frame after a sleep,
`stable_dt` will be a prediction of the delta-time until the next frame,
and in all other situations this will be an accurate measurement of time passed
since the previous frame.
Note that a frame can still stall for various reasons, so `stable_dt` can
still be unusually large in some situations.
When animating something, it is recommended that you use something like
`stable_dt.min(0.1)` - this will give you smooth animations when the framerate is good
(even in reactive mode), but will avoid large jumps when framerate is bad,
and will effectively slow down the animation when FPS drops below 10.
When painting a scatter plot we sometimes want to paint hundreds of thousands of points (filled circles) on screen every frame.
In this PR the font texture atlas is pre-populated with some filled circled of various radii. These are then used when painting (small) filled circled, which means A LOT less triangles and vertices are generated for them.
In a new benchmark we can see a 10x speedup in circle tessellation, but the the real benefit comes in the painting of these circles: since we generate a lot less vertices, the backend painter has less to do.
In a real-life scenario with a lot of things being painted (including around 100k points) I saw tessellation go from 35ms -> 7ms and painting go from 45ms -> 1ms. This means the total frame time went from 80ms to 8ms, or a 10x speedup.