Commit Graph

2927 Commits

Author SHA1 Message Date
Emil Ernerfeldt b766a48fa7
Update wgpu to 0.19 (#3824)
* Closes https://github.com/emilk/egui/issues/3675

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
Co-authored-by: Mingun <Alexander_Sergey@mail.ru>
2024-01-19 10:14:13 +01:00
rustbasic 7733d1d87c
Bug Fix : `Response::is_pointer_button_down_on` is now false the frame the button is released (#3833)
* Closes #3809
* Closes #3669
* Closes #3791

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-17 16:33:11 +01:00
Emil Ernerfeldt f01d337fa8
Update to ehttp 0.4 (#3834) 2024-01-17 15:39:28 +01:00
rustbasic 7bde0252c1
Keep `ViewportInfo::maximized` and `minimized` up-to-date on Windows (#3831)
This works fine on Windows.
2024-01-17 13:01:33 +01:00
Nathan Adams 221a77dd5b
egui-winit: Don't consume clipboard shortcuts (#3812)
<!--
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.
* 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!
-->

This breaking change seems to have snuck in during #3649. Previously it
would never consume these, today it consumes them unconditionally, and
with this change it'll ~~only consume them if egui wants text input~~
never consume them.

This is a blocker for updating our application, sadly :(
2024-01-17 12:13:11 +01:00
Emil Ernerfeldt 42013cd6c2
Fix `stable_dt` (#3832)
This broke in https://github.com/emilk/egui/pull/3172

Since 0.24.1, `stable_dt` has been fixed at 1/60s, which is a little bit
_too_ stable.

The code issue was the logic for asking "Is this the result of an
immeditate repaint?" was completely broken (always returning false).

* Closes https://github.com/emilk/egui/issues/3830
2024-01-17 12:10:51 +01:00
Romet Tagobert 9e924ec5f0
Fix unwraps in SVG scaling (#3826)
Added error messages when scaling to invalid sizes instead of panicking
through unwrap, returning to previous behavior.

Closes <https://github.com/emilk/egui/issues/3825>.
2024-01-16 09:57:48 +01:00
lucasmerlin 4c8b95f365
Fix clickable widgets blocking scrolling on touch screens (#3815)
Currently, when you try dragging a ScrollArea and start over a button,
the button blocks the ScrollArea from receiving the drag event.

This PR updates layer_rects_this_frame and layer_rects_prev_frame to
include the Sense and will use it to check if the previous layer has a
sense that would be a conflict.

<details><summary>Videos</summary>
<p>
(In both videos I'm clicking and dragging)

Before: 


https://github.com/emilk/egui/assets/8009393/83cc5a8a-2283-46d6-9337-164e1289f701

After (I modified the WidgetGallery to be scrollable, as you can see you
can now scroll over buttons and dragging the slider still blocks the
scroll):


https://github.com/emilk/egui/assets/8009393/be634cf8-3af2-4520-ba1c-bb8bfcc82997

Scrolling in the sidebar also works now:


https://github.com/emilk/egui/assets/8009393/d4309bec-22e1-4fb4-a425-7b029237849b


</p>
</details>

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-15 10:08:41 +01:00
Emil Ernerfeldt ce6876e5bd
Add keys `?`, `/`, `|` (#3820)
* Part of #3653 

Also move `enum Key` to own file
2024-01-15 10:08:22 +01:00
hinto-janai c3bc4e26b0
`ComboBox`: add builder method for height (#3001)
Matches the already existing `ComboBox::width()`.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-15 10:07:42 +01:00
Emil Ernerfeldt 5d2e192927
Selectable text in Labels (#3814)
* Closes https://github.com/emilk/egui/issues/3804

Add ability to select the text in labels with mouse-drag, double-click,
and keyboard (once clicked).
Hit Cmd+C to copy the text. If everything of a label with elided text is
selected, the copy command will copy the full non-elided text. IME and
accesskit _should_ work, but is untested.

You can control wether or not text in labels is selected globally in
`style.interaction.selectable_labels` or on a per-label basis in
`Label::selectable`. The default is ON.

This also cleans up the `TextEdit` code somewhat, fixing a couple
smaller bugs along the way.

This does _not_ implement selecting text across multiple widgets. Text
selection is only supported within a single `Label`, `TextEdit`, `Link`
or `Hyperlink`.


![label-text-selection](https://github.com/emilk/egui/assets/1148717/c161e819-50da-4b97-9686-042e6abf3564)


## TODO
* [x] Test
2024-01-14 15:17:55 +01:00
Tarek Sabet 301c72ba22
fixed typos in README.md (#3789)
This just fixes two small typos in the readme.
2024-01-09 11:12:09 +01:00
Emil Ernerfeldt 401de05630
Use `Self` everywhere (#3787)
This turns on the clippy lint
[`clippy::use_self`](https://rust-lang.github.io/rust-clippy/v0.0.212/index.html#use_self)
and fixes it everywhere.
2024-01-08 17:41:21 +01:00
Emil Ernerfeldt 12ad9e7b36 Release 0.25.0 - Better keyboard input 2024-01-08 12:25:43 +01:00
Emil Ernerfeldt 5f55e8ea40 Tweak "About" panel in the demo slightly 2024-01-08 12:20:16 +01:00
Emil Ernerfeldt 4ccd1fc82b Improve docstring 2024-01-08 12:19:53 +01:00
Emil Ernerfeldt 241a5fcda1 Strip trailing periods from changelog entries 2024-01-08 12:19:23 +01:00
Madeline Sparkles b087f58c5d
fix egui-wgpu callback viewport size check (#3759) (#3778)
<!--
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.
* 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 #3759
2024-01-08 11:20:34 +01:00
Emil Ernerfeldt 0e7bf6dfcf Add screenshot to custom_plot_manipulation example 2024-01-08 11:16:44 +01:00
Mike Krüger 8b4c9fd374
Added key mappings for `[`, `]`, `,` and `\`. (#3373)
Added key mappings for '[', ']', ',' and '\'.

* Closes https://github.com/emilk/egui/issues/3372

## Added keys

* egui::Key::Backslash
* egui::Key::OpenBracket
* egui::Key::CloseBracket
* egui::Key::Comma

Co-authored-by: Mike Krüger <mkrueger@posteo.de>
2024-01-08 11:15:15 +01:00
Emil Ernerfeldt d79fae5de1 Add warning about consume_shortcut and friends 2024-01-08 09:49:59 +01:00
StarStarJ 7b105cfa0f
Invalidate font atlas on any change to `pixels_per_point`, not matter how small (#3698)
Apparently the font implementation uses a distance check to decide if
the font(or whatever) need recalculations, after dpi changed:

8d4de866d4/crates/epaint/src/text/fonts.rs (L381-L382)

This leads to warnings when the pixel_per_point diff is very low and
spams the log. (<- this happens for me if i resize my window on kwin,
e.g. maximize it)

(I don't want to debate if the float difference generally makes sense,
so if you want to rework that instead just close this pr)
2024-01-08 09:13:34 +01:00
One b0c7a7fca4
Add missing links to source code (#3770)
<!--
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.
* 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/THE_RELEVANT_ISSUE>.
2024-01-08 09:07:25 +01:00
untbu 937c09f14a
[ScrollArea]: Add option to always scroll the only enabled direction (#3710)
Add option to use the scroll input from both directions to scroll the
enabled direction if scrolling is enabled for only one direction. This
can be used to allow horizontal scrolling without pressing shift if
vertical scrolling is disabled.

Closes <https://github.com/emilk/egui/issues/3624>.
2024-01-07 22:20:31 +01:00
Emil Ernerfeldt 8c30e8c5f7
Highlight submenu buttons when hovered and open (#3780)
Submenu buttons in menues now properly highlight when hovered and when
opened.

…plus a bunch of other cleanup
2024-01-07 22:08:32 +01:00
LoganDark 327f599407
add methods to manipulate TextEditState undoer (#3479)
This feels awful, @emilk why does this have to be an Arc?

Should the Arc be replaced with a new one when set_undoer is called, or
should it just replace the undoer inside the Arc?

Closes #3436
2024-01-07 17:19:37 +01:00
Fleabit 5432f91a4d
Have non-resizable Areas ignore mouse input just beyond their bounds (#3039)
As described in #576, the method `Memory::layer_id_at` expands the
hit-testing region for every `Area` slightly. This is necessary so that,
when the user clicks to resize a `Window`, the mouse input isn't routed
to a different `Window`.

For non-resizable `Area`s (such as dropdown menus, context menus, date
pickers, and any non-resizable `Window`), this causes them to be
surrounded by a "dead zone" where any underlying widgets can't be
hovered or clicked. The effect is particularly noticeable in menu bars.

This commit adds a persisted `edges_padded_for_resize` property to
`Area`, which is `true` when the `Area` belongs to a resizable `Window`
and `false` for all other `Area`s. The hit-testing region is only
expanded when this property is `true`.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-07 17:04:29 +01:00
Guillaume Schmid 1777bb7789
Implemented window header color change when focused (on top). (#3515)
This PR replaces an old one with many problems (no collapse icon, the
header background was not funny colored, ugly...). It fixes those
problems.

It implements the highlight of the header to the focused window. And
allows the rest of the application to know the selected window. It
allows, for instance, to display multiple windows with images and some
additional meta information about those images on the side panel of the
main window. The side panel updates itself according to the selected
image window.

* Added a theme color for the selected window header.
* Added a function to retrieve the LayerId of the focused window.
* Implemented a simple demo of this function in the demo app where a
message states if the Option window is focused (at the bottom of the
Options window).

![Capture d’écran du 2023-10-30
10-30-39](https://github.com/emilk/egui/assets/18464073/fcea4dbf-2b07-485c-8c41-274ad5c738e4)

A technical point: 
The header color is applied with a transparency of 125 so the
collapsible button becomes visible.
The reason is that the collapsible button is rendered before the rest of
the header and before the header size is known.
We cannot draw the background before knowing this value, so rendering
with transparency is a solution to see the collapsible button through
the header background.

This PR has been sponsored by my company, which left me to do it during
my work time.
This is part of an evil plan to convince them to switch to rust for new
projects :)

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-07 16:57:32 +01:00
YgorSouza 4a6999bbad
Add option to customize progress bar rounding (#2881)
The minimum filled width is adapted to the radius and the animation is
disabled so it renders correctly.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-07 16:43:13 +01:00
Mike Tsao 3b19303e02
Fix typo in `crates/egui_glow/README.md` (#2956)
<!--
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.
* 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 thart makes it
difficult for maintainers to 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 you PR, but my time is limited!
-->

Closes <https://github.com/emilk/egui/issues/THE_RELEVANT_ISSUE>.
2024-01-07 16:31:34 +01:00
Danny Stoll 128afdde0a
Changed logic for submenus closing (#3055)
This tiny change removes the trigger for a submenu to close if the mouse
is no longer hovering over it or one of its children. Now, the menu
stays open until a different menu item is selected. This aims to address
<https://github.com/emilk/egui/issues/2853>.

I suspected that a new trigger would need to be implemented so that
multiple menu items don't remain open simultaneously, but after some
testing, this does not appear to occur.

This change leaves `MenuState::hovering_current_submenu` and
`MenuState::close_submenu` as dead code in case they might be useful
later.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-07 16:25:29 +01:00
Ivan bfed2b4195
Add `DragValue`s for RGB(A) in the color picker (#2734)
Added some DragValue widgets in the color_picker widget as input fields
for managing the RGBA values.
In case the provided values result in a not valid premultiplied alpha
RGBA color, a button will appear next to the input fields, to be used to
multiply the values with the alpha channel.


![image](https://user-images.githubusercontent.com/68190772/218438019-8b46936f-d025-4287-ac27-2b937f8f3d7c.png)

Closes <https://github.com/emilk/egui/issues/2716>.

---------

Co-authored-by: IVANMK-7 <68190772+IVANMK-7@users.noreply.github.com>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Co-authored-by: Brian Janssen <tosti007@users.noreply.github.com>
2024-01-07 16:12:59 +01:00
Emil Ernerfeldt 51e5d28b39
Rename `from_hex_string` -> `from_hex`, and `to_hex_string` -> `to_hex` (#3777)
Follow-up to https://github.com/emilk/egui/pull/3570
2024-01-07 10:08:57 +01:00
YgorSouza 669473ccd2
Add `Color32::from_hex_string` and `Color32::to_hex_string` (#3570)
<!--
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.
* 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/3466>.
2024-01-07 08:54:10 +01:00
Emil Ernerfeldt b6fe244810
Fix: apply edited `DragValue` when it looses focus (#3776)
* Closes https://github.com/emilk/egui/issues/2877
* Closes https://github.com/emilk/egui/pull/3451
2024-01-06 23:51:51 +01:00
jayzhudev e13cc69d76
Add a public API for overriding plot legend traces' visibilities (#3534)
Added a public API in `egui_plot -> legend` to allow `hidden_items` to
be overridden in the plot legend widget. This allows convenient control
of traces' visibilities the selection of traces from the application
code.

### Example
```rust
    let legend_config = if plot_selection_changed {
        let hidden_items = match plot_selection {
            PlotSelection::SelectAll => Vec::new(),
            PlotSelection::DeselectAll => all_trace_names,
        };

        Legend::default()
            .position(Corner::RightTop)
            .hidden_items(hidden_items) // Overrides `hidden_items`
    } else {
        Legend::default().position(Corner::RightTop)
    };

    Plot::new(id)
        .legend(legend_config)
        .show(ui, draw_plot);
```

Closes <https://github.com/emilk/egui/issues/3533>.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-06 22:35:54 +01:00
YgorSouza 5ed2c0aa90
Plot custom zoom (#2714)
<!--
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.
* If applicable, add a screenshot or gif.
* Unless this is a trivial change, add a line to the relevant
`CHANGELOG.md` under "Unreleased".
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run
`./sh/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review you PR, but my time is limited!
-->

- Added methods to zoom the plot programmatically, to match the
previously added `translate_bounds()`.
- Added an example of how this method can be used to customize the plot
navigation.

Closes #1164.
2024-01-06 22:34:42 +01:00
YgorSouza 797406de39
Add indeterminate state to checkbox (#3605)
<!--
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.
* 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!
-->
2024-01-06 22:34:23 +01:00
Varphone Wong 932fdae9e6
Fix: allow using the full Private Use Area for custom fonts (#3509)
The ignored characters are used in some custom fonts.

for example: the \u{F0FF} is used as `cleaning_services` in
MaterialIcons-Regular.ttf

<!--
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.
* 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 you PR, but my time is limited!
-->

Closes <https://github.com/emilk/egui/issues/THE_RELEVANT_ISSUE>.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-06 22:33:08 +01:00
Lauro Oyen 5a6d1cbd58
Implement table row selection and hover highlighting (#3347)
* Based on #3105 by @vvv.

## Additions and Changes

- Add `TableBuilder::sense()` and `StripBuilder::sense()` to enable
detecting clicks or drags on table and strip cells.
- Add `TableRow::select()` which takes a boolean that sets the highlight
state for all cells added after a call to it. This allows highlighting
an entire row or specific cells.
- Add `TableRow::response()` which returns the union of the `Response`
of all cells added to the row up to that point. This makes it easy to
detect interactions with an entire row. See below for an alternative
design.
- Add `TableRow::index()` and `TableRow::col_index()` helpers.
- Remove explicit `row_index` from callback passed to
`TableBody::rows()` and `TableBody::heterogeneous_rows()`, possible due
to the above. This is a breaking change but makes the callback
compatible with `TableBody::row()`.
- Update Table example to demonstrate all of the above.

## Design Decisions

An alternative design to `TableRow::response()` would be to return the
row response from `TableBody`s `row()`, `rows()` and
`heterogeneous_rows()` functions. `row()` could just return the
response. `rows()` and `heterogeneous_rows()` could return a tuple of
the hovered row index and that rows response. I feel like this might be
the cleaner soluction if only returning the hovered rows response isn't
too limiting.

I didn't implement `TableBuilder::select_rows()` as described
[here](https://github.com/emilk/egui/pull/3105#issuecomment-1618062533)
because it requires an immutable borrow of the selection state for the
lifetime of the `TableBuilder`. This makes updating the selection state
from within the body unnecessarily complicated. Additionally the current
design allows for selecting specific cells, though that could be
possible by modifying `TableBuilder::select_rows()` to provide row and
column indices like below.

```rust
pub fn select_cells(is_selected: impl Fn(usize, usize) -> bool) -> Self
```

## Hover Highlighting

EDIT: Thanks to @samitbasu we now have hover highlighting too.

~This is not implemented yet. Ideally we'd have an api that allows to
choose between highlighting the hovered cell, column or row. Should
cells containing interactive widgets, be highlighted when hovering over
the widget or only when hovering over the cell itself? I'd like to
implement that before this gets merged though.~

Feedback is more than welcome. I'd be happy to make any changes
necessary to get this merged.

* Closes #1519
* Closes #1553
* Closes #3069

---------

Co-authored-by: Samit Basu <basu.samit@gmail.com>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-06 18:10:34 +01:00
Fredrik Fornwall 37762f72ff
Allow arrow keys to move away focus from a Slider (#3641) 2024-01-06 17:39:34 +01:00
Emil Ernerfeldt 9faf4b44ff
Ignore extra SHIFT and ALT when matching modifiers (#3769)
* Closes https://github.com/emilk/egui/issues/3626

Basically, egui now ignores extra SHIFT and ALT pressed when matching
keyboard shortcuts.
This is because SHIFT and ALT are often requires to produce some logical
keys.
For instance, typing `+` on an English keyboard requires pressing `SHIFT
=`,
so the keyboard shortcut looking for `CTRL +` should ignore the SHIFT
key.

@abey79 You reported problem using `Cmd +` and `Cmd -` to zoom - does
this fix it for you?

You can run with `RUST_LOG=egui_winit=trace cargo run` to see a printout
of how winit reports the logical and physical keys, and how egui
interprets them.

Weirdly, on Mac winit reports `SHIFT =` as `+`, but `CMD SHIFT =` as `=`
(on an English keyboard) so things are… difficult.
2024-01-05 10:53:14 +01:00
Frank Lee 1efa660149
Fix IME input of `CompositionEnd` without a `CompositionStart` (#3768)
* Closes https://github.com/emilk/egui/issues/3766

Add support for type in CompositionEnd only characters without trigger
CompositionStart first.
This usually works with no-latin character input.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-04 15:47:49 +01:00
Emil Ernerfeldt f25e4171b9
Fix: don't open context menu on drag (#3767)
This fixes a bug where the context menu would open when dragging with
the secondary mouse button.

Now the context menu requires a click to open.

This is important for things like plots, where right-click and
right-drag means different things.
2024-01-04 10:29:52 +01:00
Emil Ernerfeldt 34c341444f
Release `egui_plot` 0.24.2 (#3763)
## Changelog
* Fix plot auto-bounds default
[#3722](https://github.com/emilk/egui/pull/3722) (thanks
[@abey79](https://github.com/abey79)!)

---------

Co-authored-by: Antoine Beyeler <49431240+abey79@users.noreply.github.com>
2024-01-03 09:42:56 +01:00
Daniel Buch Hansen e2c1d9f90d
Bump `winit` to `0.29.7` (#3753)
Compiled changelog below:

 - On X11, fix Xft.dpi reload during runtime.
 - On X11, fix window minimize.

- On Web, fix context menu not being disabled by
with_prevent_default(true).
- On Wayland, fix WindowEvent::Destroyed not being delivered after
destroying window.
- Fix EventLoopExtRunOnDemand::run_on_demand not working for consequent
invocation

 - On macOS, remove spurious error logging when handling Fn.
 - On X11, fix an issue where floating point data from the server is
 - misinterpreted during a drag and drop operation.
 - On X11, fix a bug where focusing the window would panic.
 - On macOS, fix refresh_rate_millihertz.
- On Wayland, disable Client Side Decorations when wl_subcompositor is
not supported.
 - On X11, fix Xft.dpi detection from Xresources.
- On Windows, fix consecutive calls to
window.set_fullscreen(Some(Fullscreen::Borderless(None))) resulting in
losing previous window state when eventually exiting fullscreen using
window.set_fullscreen(None).
 - On Wayland, fix resize being sent on focus change.
 - On Windows, fix set_ime_cursor_area.
2024-01-02 07:27:52 +01:00
Emil Ernerfeldt 5cf8a085e3 Document that you need to install additional fonts for asian scripts 2023-12-31 10:27:42 +01:00
Emil Ernerfeldt 12468438a3
`eframe`: Fix building the `wasm32` docs for `docs.rs` (#3757)
* Closes https://github.com/emilk/egui/issues/3756

Fix suggested by @morionelab
2023-12-31 10:26:02 +01:00
Emil Ernerfeldt 9951fe0d36
Fix some clippy 1.75 lints (#3754) 2023-12-30 11:23:21 +01:00
Emil Ernerfeldt 4487f8ff9f
Rename `TextBuffer::replace` to `replace_with` (#3751)
This removes the name conflict with `str::replace`.

* Closes https://github.com/emilk/egui/issues/3746
2023-12-29 17:22:39 +01:00