1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-28 07:23:13 -04:00
Commit Graph

4144 Commits

Author SHA1 Message Date
adrien
cbb531ec06 modifiers and classes 2026-01-02 20:31:35 +01:00
adrien
c3d7941fb8 Merge branch 'widget_style' into style_modifier 2025-11-21 10:24:40 +01:00
adrien
dbd718104e fix button color 2025-11-21 09:50:07 +01:00
adrien
6710da2440 Merge remote-tracking branch 'upstream/main' 2025-11-19 18:48:03 +01:00
adrien
58992a635a rename style_trait.rs -> widget_style.rs and font/color fallback for button 2025-11-19 09:26:28 +01:00
Emil Ernerfeldt
d53a4a9c1d Update docs to reflect that wgpu is the default renderer (#7719)
I missed a few parts when merging
* https://github.com/emilk/egui/pull/7615
2025-11-18 15:56:35 +01:00
Bruno Paré-Simard
5b6a0196f9 Add Panel to replace SidePanel and TopBottomPanel (#5659)
This combines `SidePanel` and `TopBottomPanel` into a single `Panel`.

The old types are still there as type aliases, but are deprecated.

`.min_width(…)` etc are now called `.min_size(…)` etc.

Again, the old names are still there, but deprecated.

(edited by @emilk)

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2025-11-18 15:46:01 +01:00
Emil Ernerfeldt
178f3c9198 Add ScrollArea::content_margin (#7722)
* Part of https://github.com/emilk/egui/issues/5605
* Part of https://github.com/emilk/egui/issues/3385
2025-11-18 15:30:02 +01:00
Emil Ernerfeldt
f74b7c7e79 Paint mouse cursor in kittest snapshot images (#7721)
Very simple triangle shape, but helps understand why a widget has a
hovered effect
2025-11-18 06:24:03 +01:00
Emil Ernerfeldt
dc0acd2dd1 clippy +nightly fix (#7723) 2025-11-17 05:10:43 +01:00
Emil Ernerfeldt
01770be13e Update changelogs and version for 0.33.2 2025-11-13 15:33:08 +01:00
Lucas Meurer
ecee85fc6b Fix ui.response().interact(Sense::click()) being flakey (#7713)
This fixes calls to `ui.response().interact(Sense::click())` being
flakey. Since egui checks widget interactions at the beginning of the
frame, based on the responses from last frame, we need to ensure that we
always call `create_widget` on `interact` calls, otherwise there can be
a feedback loop where the `Sense` egui acts on flips back and forth
between frames.

Without the fix in `interact`, both the asserts in the new test fail.

Here is a video where I experienced the bug, showing the sense switching
every frame. Every other click would fail to be detected.


https://github.com/user-attachments/assets/6be7ca0e-b50f-4d30-bf87-bbb80c319f3b

Also note, usually it's better to use `UiBuilder::sense()` to give a Ui
some sense, but sometimes you don't have the flexibility, e.g. in a `Ui`
callback from some code external to your project.
2025-11-13 13:52:13 +01:00
Emil Ernerfeldt
9ef610e16b Make wgpu the default renderer for eframe and egui.rs (#7615)
* Closes https://github.com/emilk/egui/issues/5889

See the above issue for motivation.

To use glow instead, disable the default features of `eframe` and opt-in
to `glow`.

This also changes egui.rs to use wgpu, which means WebGPU when
available, and WebGL otherwise
2025-11-13 11:16:23 +01:00
Stefan Tammer
51b0d0e4b9 [egui-wgpu] Put the capture module behind a feature flag, make the egui dependency optional (#7698)
This PR enables users of `egui-wgpu` to render `epaint` primitives
without having to bring in the complete `egui` crate and all it's
dependencies.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2025-11-13 11:16:10 +01:00
WickedShell
9875f22658 Fix double negative in documentation (#7711)
The double negative of not undefined conflicted with the example given
in parens, This just removes the double negative to agree with the rest
of the doc line. I have *not* audited to see if this ordering actually
is strictly forced elsewhere. (Apologies for the smallest documentation
pull request ever)

* [x] I have followed the instructions in the PR template
2025-11-13 10:53:39 +01:00
Emil Ernerfeldt
9a073d9399 Prevent widgets sometimes appearing to move relative to each other (#7710)
Sometimes when moving a window, having a tooltip attached to the mouse
pointer, or scrolling a `ScrollArea`, you would see this disturbing
effect:


![drift-bug](https://github.com/user-attachments/assets/013a5f49-ee02-417c-8441-1e1a0369e8bd)

This is caused by us rounding many visual elements (lines, rectangles,
text, …) to physical pixels in order to keep them sharp. If the
window/tooltip itself is not rounded to a physical pixel, then you can
get this behavior.

So from now on the position of all
areas/windows/tooltips/popups/ScrollArea gets rounded to the closes
pixel.

* Unlocked by https://github.com/emilk/egui/pull/7709
2025-11-13 10:52:46 +01:00
Emil Ernerfeldt
5e6615a129 Prevent drift when resizing and moving windows (#7709)
* Follows https://github.com/emilk/egui/pull/7708
* Related to #202 

This fixes a particular issue where resizing a window would move it, and
resizing it back would not restore it.

You can still move a window by resizing it (I didn't focus on that bug
here), but at least now the window will return to its original position
when you move back the mouse.
2025-11-12 22:40:04 +01:00
Emil Ernerfeldt
115adac41d Add Response::total_drag_delta and PointerState::total_drag_delta (#7708)
Useful in many cases. In a follow-up PR I will use it to prevent drift
when dragging/resizing windows
2025-11-12 22:26:37 +01:00
adrien
0b9f70d47b remove unused import 2025-11-12 18:18:20 +01:00
adrien
2f917bcb9f fix text color override 2025-11-12 17:29:29 +01:00
Emil Ernerfeldt
df6f35d568 eframe: add feature wgpu_no_default_features (#7700)
* Part of https://github.com/emilk/egui/issues/5889
* Closes https://github.com/emilk/egui/issues/7106

This changes the `eframe/wgpu` feature to also enable all the `default`
features of `wgpu` and `egui-wgpu`. This makes switching `eframe`
backend from `glow` to `wgpu` a lot easier.

To get the old behavior (depend on `wgpu` but you must opt-in to all its
features), use the new `wgpu_no_default_features` feature.
2025-11-12 10:51:38 +01:00
Emil Ernerfeldt
1af5d1d37e Remove accesskit feature and always depend on accesskit (#7701)
* Closes #3137

With this, `egui` will always depend on `accesskit`, removing a lot of
`#[cfg(feature = "accesskit")]` throughout the code.
2025-11-12 10:51:28 +01:00
adrien
34bf318782 fix features 2025-11-12 10:05:30 +01:00
Emil Ernerfeldt
f33b0ffe6e Fix link checker 2025-11-12 08:52:43 +01:00
Emil Ernerfeldt
6b79845431 Turn HarnessBuilder::with_options into a proper builder method (#7697)
My bad when first creating it
2025-11-10 21:49:31 +01:00
adrien
c3ce6bf11f cleanup snapshot 2025-11-10 19:26:56 +01:00
adrien
c2a8c06bef cleanup snapshot 2025-11-10 19:26:19 +01:00
adrien
a17aa67267 cleanup 2025-11-10 17:39:33 +01:00
adrien
db4c159061 Merge branch 'widget_style' of github.com:AdrienZianne/egui into widget_style 2025-11-10 17:36:03 +01:00
AdrienZ.
ec558b8ce7 Merge branch 'main' into widget_style 2025-11-10 17:32:16 +01:00
adrien
4bd97cec58 revert gitignore 2025-11-10 17:28:34 +01:00
AdrienZ.
5681add37f Merge branch 'emilk:main' into main 2025-11-10 17:21:05 +01:00
adrien
e1af88748b more pixel diff fix 2025-11-10 17:12:57 +01:00
Emil Ernerfeldt
93425ae06b Allow multiple atoms in Button::shortcut_text and right_text (#7696)
Useful when intermixing text and icons (e.g. for modifiers)
2025-11-10 16:34:58 +01:00
adrien
abeb7a2a9c Merge branch 'widget_style' of github.com:AdrienZianne/egui into widget_style 2025-11-10 10:16:35 +01:00
adrien
33db68f1ba Fix pixel diff 2025-11-10 10:16:20 +01:00
Adrien Zianne
94f8ad6099 fix check 2025-11-07 17:24:16 +01:00
Emil Ernerfeldt
fa4cfec777 Change text color of selected text (#7691)
Selected text now gets the color of `visuals.selection.stroke.color`.
This means you can have inverted colors for selected text, like in the
new test:
<img width="154" height="46" alt="image"
src="https://github.com/user-attachments/assets/2666361d-d7e2-4d50-8e4d-2fcc128f1a81"
/>


It also means the color of selected text in labels matches that of the
text color of selected buttons.
2025-11-07 15:34:36 +01:00
adrien
a74851597a fix snapshot 2025-11-07 14:54:07 +01:00
adrien
b938a27ca9 temp 2025-11-07 14:51:01 +01:00
Emil Ernerfeldt
d8dcb31673 kittest: add drag-and-drop helpers (#7690) 2025-11-07 14:46:09 +01:00
Emil Ernerfeldt
1d4d14f18e Hide scroll bars when dragging other things (#7689)
This closes a small visual glitch where scroll bars would show up when
dragging something unrelated, like a slider or a panel side.
2025-11-07 14:43:49 +01:00
adrien
27f0ec3aef snapshot 2025-11-07 14:21:31 +01:00
Lucas Meurer
04913ed651 Add some more text edit tests (#7608)
Adds tests to text the clip option in text edits and how it behaves with
a placeholder

---------

Co-authored-by: lucasmerlin <8009393+lucasmerlin@users.noreply.github.com>
2025-11-07 13:34:25 +01:00
Lucas Meurer
1e63bfd657 Improve accessibility and testability of ComboBox (#7658)
Changed it to use labeled_by to avoid kittest finding the label when
searching for the ComboBox and also set the value so a screen reader
will know what's selected.
2025-11-07 13:34:18 +01:00
adrien
daccad61cd check passed 2025-11-07 11:34:19 +01:00
Adrien Zianne
2df6154d9d Button resize fix + Margin i8 -> i16 2025-11-07 11:34:19 +01:00
Adrien Zianne
509d17d539 checkbox & cleanup 2025-11-07 11:34:19 +01:00
Adrien Zianne
785e19f999 CheckboxStyle 2025-11-07 11:34:19 +01:00
Adrien Zianne
a40959b047 Finish label 2025-11-07 11:34:18 +01:00