`egui::Table` has a weirdly specific default `max_scroll_height` set to
800.0. This means that even with `vscroll(true)` and `auto_shrink([_,
false])`, the table will not expend to the full available height. This
PR changes this value to `f32::INFINITY`. This makes it consistent with
the corresponding default value of `ScrollArea::max_size.y`, which is
where that `max_scroll_height` ends up being used.
Improved `change_gl_context()`
**Before:**
Create a new `not_current_glcontext`.
**After:**
If `not_current_glcontext` exists, apply it. Otherwise, create it.
This will make the program smoother when dragging, etc.
In order to make it possible that all buttons can have the same style
with a text and an image I created a `menu_text_image_button`.
It works the same way as all the other menu buttons.
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Handle the `IME` event first
There is a need to handle the Ime event first.
Fix Issues : When you press `BackSpace`, the entire text is erased, and
when you press another letter, it appears again.
Fix Issues : When you press `Left`, the character being entered will be
copied once more.
Fix Issues : When you press `Enter`, `Enter` with `repeat` set is
entered and `Enter` is entered twice.
Fix Issues : When you press a key in `IME` mode, `repeat` is often set.
Fix Issues : Since you may be selecting something in the IME, this also
disables the `Arrow` keys.
Before, you could accidentally get multiple tooltips if a tooltips was
interactive (e.g. had a link in it) and on the way to interact with it
you would hover another widget with a tooltip.
This PR ensures that each `LayerId` only has one tooltip open at a time.
You can still have a tooltip for an item inside of a tooltip.
This makes the sizing pass of an `egui_table` ensure the table uses as
little width as possible.
Subsequently, it will redistribute all non-resizable columns on the
available space, so that a table better follow the parent container as
it is resized.
I also added `table.reset()` for forgetting the current column widths.
<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md)
before opening a Pull Request!
* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to test and add commits to your PR.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.
Please be patient! I will review your PR, but my time is limited!
-->
This prevents TextEdit widgets from sending fake primary clicks when a
user types Space / Enter. Small change but having Space / Enter send
`OutputEvent::ValueChanged` instead of `OutputEvent::Clicked` makes more
sense I believe.
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Marking widgets as disabled was not reflected in the accesskit output,
now the disabled status should match.
---------
Co-authored-by: Wybe Westra <w.westra@kwantcontrols.nl>
This allows users to customize how numbers are converted into strings in
a `DragValue`, as a global default.
This can be used (for instance) to show thousands separators, or use `,`
as a decimal separator.