* Closes#4254
Changes egui-winit so that it calls `window.set_ime_cursor_area` when
the IME rect changes or the user interacts with the application instead
of calling it every time the app is rendered. This works around a winit
bug that causes the app to continuously repaint under certain
circumstances on Wayland.
Tested on Wayland and on X11 using the text edit in the egui_demo_app -
no changes in IME functionality as far as I can tell. Untested on
non-Linux platforms.
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This means only one space allocation, which should allow putting it in
more types of layouts (right-to-left, centered, adjusted, …).
It also just makes the code simpler
`clicked_elsewhere` now checks against the clipped `interact_rect` of
the widget instead of the full `rect`.
In practice this shouldn't change much since the function is mostly used
for windows and areas, which aren't clipped.
This is mostly a refactor, but has some performance benefits:
* We (re)use the same tessellator as for everything else, leading to
less allocations
* We cull shapes before rendering them
Adding `RectShape::blur_width` means it can also be used for other
effects, such as glow.
Before, when setting the `zoom_factor`, the website was already
enlarged, but the zoom was ignored when calculating the logical window
size and mouse position, causing an offset between the actual cursor and
selected elements. That is addressed here
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This is particularly interesting if you want to authorize a single hover
tooltip on an item in the event of an interaction.
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
<!--
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 add commits to your PR.
* Remember to run `cargo fmt` and `cargo cranky`.
* 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!
-->
* Closes https://github.com/emilk/egui/issues/4243
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
It would return the causes for repainting again collected this frame,
instead of the cause for repainting the current frame.
* Part of https://github.com/emilk/egui/issues/3931
* Closes https://github.com/emilk/egui/issues/4238
The comment in the code explains it well, but the short of it is this:
we can't handle a shadow blur width larger than the shadow rectangle, so
we need to clamp the blur. This means smaller things will cast shadows
with a smaller blur width, but that's better than having visual
glitches.
Previously, putting the cursor in the gap between two menu buttons would
not hover any of the buttons, but the click-sensitive menu itself. Now
the menu is no longer click-sensitive.
This PR allows customizing the return key in the TextEdit widget. Right
now, it's hard-coded to the Enter key, which is problematic in cases
when you want to use the Enter key for something else, and insert the
newline in a different way instead.
An alternative to the "Phone Size" button useful for testing
`ViewportCommand::InnerSize`.
I created this to make it easy to debug
https://github.com/emilk/egui/issues/4196 there are more details there.
* Closes#3987
* Closes#3988
There is a need to prevent egui::Window from becoming larger than the
Viewport.
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Expose `egui_plot::items::values::PlotGeometry` in public API so that
`PlotItem`, which is already public, can actually be implemented by
applications. Fixes#3464.
---------
Co-authored-by: Dominique Würtz <dom@blaukraut.info>
I'm trying to create some custom collapsing headers that add additional
buttons inside the header itself. Because of this, I load the
`CollapsingState` in my special widget manually. But because
`HeaderResponse` owns the `Ui` and the `CollapsingState`, there is no
way for me to open/close the collapsing header based on response of the
inner widget.
Initially, I considered just exposing `state` member of
`HeaderResponse`, but that exposes too much of the API at the wrong
time, in my opinion.
So instead I found it'd be safer to just expose the open/close API to
the response itself, and that's what this PR does.
Not sure about the api, currently I've mapped the whole XWindowType
enum, but maybe there's something more sensible to do?
* Closes <https://github.com/emilk/egui/issues/4150>
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
I added a handfull of lines to allow for the red highlight on weekends
in `DatePickerPopup` to be disabled.
I tried to follow the rules, but I've never done any kind of PR before,
and I'm also not sure if this is at all the kind of thing that is wanted
at the moment. If it is not, I'm happy to just have this removed. Just a
tiny little addition I would find useful.
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>