From 4d4cb3d20db0517e74ca6ab6d3b646f78fd8123b Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Tue, 26 Mar 2024 17:13:57 +0100 Subject: [PATCH] Release 0.27.0 - Nicer menus and new hit test logic --- CHANGELOG.md | 69 ++++++++++++++++++++++++++++++++- Cargo.lock | 24 ++++++------ Cargo.toml | 24 ++++++------ crates/ecolor/CHANGELOG.md | 4 ++ crates/eframe/CHANGELOG.md | 65 ++++++++++++++++++++----------- crates/egui-wgpu/CHANGELOG.md | 4 ++ crates/egui-winit/CHANGELOG.md | 5 +++ crates/egui_extras/CHANGELOG.md | 10 +++++ crates/egui_glow/CHANGELOG.md | 5 +++ crates/egui_plot/CHANGELOG.md | 7 ++++ crates/epaint/CHANGELOG.md | 9 +++++ 11 files changed, 178 insertions(+), 48 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30f329a0e43..128eba907eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,12 +7,79 @@ This file is updated upon each release. Changes since the last release can be found at or by running the `scripts/generate_changelog.py` script. -## Unreleased +## 0.27.0 - 2024-03-26 - Nicer menus and new hit test logic +The hit test logic (what is the user clicking on?) has been completely rewritten, and should now be much more accurate and helpful. +The hit test and interaction logic is run at the start of the frame, using the widgets rects from the previous frame, but the latest mouse coordinates. +It enabled getting a `Response` for a widget _before_ creating it using `Context::read_response`. +This will in the future unlock more powerful widget styling options. +The new hit test also allows clicking slightly outside a button and still hit it, improving the support for touch screens. + +The menus have also been improved so that they both act and feel better, with no change in API. +Included in this is much nicer looking shadows, supporting an offset. + +Screenshot 2024-03-26 at 17 00 23 + ### ⚠️ BREAKING * `Response::clicked*` and `Response::dragged*` may lock the `Context`, so don't call it from a `Context`-locking closure. * `Response::clicked_by` will no longer be true if clicked with keyboard. Use `Response::clicked` instead. * `Memory::focus` has been renamed `Memory::focused` +* `Area::new` now takes an `Id` by argument [#4115](https://github.com/emilk/egui/pull/4115) +* Change the definition of `clicked_by` [#4192](https://github.com/emilk/egui/pull/4192) + +### ☰ Menu related improvements +* Add some distance between parent menu and submenu [#4230](https://github.com/emilk/egui/pull/4230) +* Add `Area::sense` and improve hit-testing of buttons in menus [#4234](https://github.com/emilk/egui/pull/4234) +* Improve logic for when submenus are kept open [#4166](https://github.com/emilk/egui/pull/4166) +* Better align menus with the button that opened them [#4233](https://github.com/emilk/egui/pull/4233) +* Hide hover UI when showing the context menu [#4138](https://github.com/emilk/egui/pull/4138) (thanks [@abey79](https://github.com/abey79)!) +* CSS-like `Shadow` with offset, spread, and blur [#4232](https://github.com/emilk/egui/pull/4232) +* On touch screens, press-and-hold equals a secondary click [#4195](https://github.com/emilk/egui/pull/4195) + +### ⭐ Added +* Add with_taskbar to viewport builder [#3958](https://github.com/emilk/egui/pull/3958) (thanks [@AnotherNathan](https://github.com/AnotherNathan)!) +* Add F21 to F35 key bindings [#4004](https://github.com/emilk/egui/pull/4004) (thanks [@oscargus](https://github.com/oscargus)!) +* Add `Options::debug_paint_interactive_widgets` [#4018](https://github.com/emilk/egui/pull/4018) +* Add `Ui::set_opacity` [#3965](https://github.com/emilk/egui/pull/3965) (thanks [@YgorSouza](https://github.com/YgorSouza)!) +* Add `Response::paint_debug_info()` to make it easy to visualize a widget's id and state [#4056](https://github.com/emilk/egui/pull/4056) (thanks [@abey79](https://github.com/abey79)!) +* Add layer transforms, interaction in layer [#3906](https://github.com/emilk/egui/pull/3906) (thanks [@Tweoss](https://github.com/Tweoss)!) +* Add `ColorImage::from_gray_iter` [#3536](https://github.com/emilk/egui/pull/3536) (thanks [@wangxiaochuTHU](https://github.com/wangxiaochuTHU)!) +* Add API for raw mouse motion [#4063](https://github.com/emilk/egui/pull/4063) (thanks [@GiantBlargg](https://github.com/GiantBlargg)!) +* Add accessibility to `ProgressBar` and `Spinner` [#4139](https://github.com/emilk/egui/pull/4139) (thanks [@DataTriny](https://github.com/DataTriny)!) +* Add x11 window type settings to viewport builder [#4175](https://github.com/emilk/egui/pull/4175) (thanks [@psethwick](https://github.com/psethwick)!) +* Add an API for customizing the return key in TextEdit [#4085](https://github.com/emilk/egui/pull/4085) (thanks [@lemon-sh](https://github.com/lemon-sh)!) +* Convenience `const fn` for `Margin`, `Rounding` and `Shadow` [#4080](https://github.com/emilk/egui/pull/4080) (thanks [@0Qwel](https://github.com/0Qwel)!) +* Serde feature: add serde derives to input related structs [#4100](https://github.com/emilk/egui/pull/4100) (thanks [@gweisert](https://github.com/gweisert)!) +* Give each menu `Area` an id distinct from the id of what was clicked [#4114](https://github.com/emilk/egui/pull/4114) +* `epaint`: Added `Shape::{scale,translate}` wrappers [#4090](https://github.com/emilk/egui/pull/4090) (thanks [@varphone](https://github.com/varphone)!) +* A `Window` can now be resizable in only one direction [#4155](https://github.com/emilk/egui/pull/4155) +* Add `EllipseShape` [#4122](https://github.com/emilk/egui/pull/4122) (thanks [@TheTacBanana](https://github.com/TheTacBanana)!) +* Adjustable Slider rail height [#4092](https://github.com/emilk/egui/pull/4092) (thanks [@rustbasic](https://github.com/rustbasic)!) +* Expose state override for `HeaderResponse` [#4200](https://github.com/emilk/egui/pull/4200) (thanks [@Zeenobit](https://github.com/Zeenobit)!) + +### 🔧 Changed +* `TextEdit`: Change `margin` property to `egui::Margin` type [#3993](https://github.com/emilk/egui/pull/3993) (thanks [@bu5hm4nn](https://github.com/bu5hm4nn)!) +* New widget interaction logic [#4026](https://github.com/emilk/egui/pull/4026) +* `ui.dnd_drop_zone()` now returns `InnerResponse`. [#4079](https://github.com/emilk/egui/pull/4079) (thanks [@sowbug](https://github.com/sowbug)!) +* Support interacting with the background of a `Ui` [#4074](https://github.com/emilk/egui/pull/4074) +* Quickly animate scroll when calling `ui.scroll_to_cursor` etc [#4119](https://github.com/emilk/egui/pull/4119) +* Don't clear modifier state on focus change [#4157](https://github.com/emilk/egui/pull/4157) (thanks [@ming08108](https://github.com/ming08108)!) +* Prevent `egui::Window` from becoming larger than viewport [#4199](https://github.com/emilk/egui/pull/4199) (thanks [@rustbasic](https://github.com/rustbasic)!) +* Don't show URLs when hovering hyperlinks [#4218](https://github.com/emilk/egui/pull/4218) + +### 🐛 Fixed +* Fix incorrect handling of item spacing in `Window` title bar [#3995](https://github.com/emilk/egui/pull/3995) (thanks [@varphone](https://github.com/varphone)!) +* Make `on_disabled_hover_ui` respect `tooltip_delay` [#4012](https://github.com/emilk/egui/pull/4012) (thanks [@YgorSouza](https://github.com/YgorSouza)!) +* Fix `TextEdit` being too short whenever there is horizontal margin [#4005](https://github.com/emilk/egui/pull/4005) (thanks [@gweisert](https://github.com/gweisert)!) +* Fix `Response::interact` and `Ui:interact_with_hovered` [#4013](https://github.com/emilk/egui/pull/4013) +* Fix: `Response.interact_pointer_pos` is `Some` on click and drag released [#4014](https://github.com/emilk/egui/pull/4014) +* Fix custom `Window` `Frame`s [#4009](https://github.com/emilk/egui/pull/4009) (thanks [@varphone](https://github.com/varphone)!) +* Fix: images with background color now respects rounding [#4029](https://github.com/emilk/egui/pull/4029) (thanks [@vincent-sparks](https://github.com/vincent-sparks)!) +* Fixed the incorrect display of the `Window` frame with a wide border or large rounding [#4032](https://github.com/emilk/egui/pull/4032) (thanks [@varphone](https://github.com/varphone)!) +* TextEdit: fix crash when hitting SHIFT + TAB around non-ASCII text [#3984](https://github.com/emilk/egui/pull/3984) (thanks [@rustbasic](https://github.com/rustbasic)!) +* Fix two `ScrollArea` bugs: leaking scroll target and broken animation to target offset [#4174](https://github.com/emilk/egui/pull/4174) (thanks [@abey79](https://github.com/abey79)!) +* Fix bug in `Context::parent_viewport_id` [#4190](https://github.com/emilk/egui/pull/4190) (thanks [@rustbasic](https://github.com/rustbasic)!) +* Remove unnecessary allocation in `RepaintCause::new` [#4146](https://github.com/emilk/egui/pull/4146) (thanks [@valsteen](https://github.com/valsteen)!) ## 0.26.2 - 2024-02-14 diff --git a/Cargo.lock b/Cargo.lock index ba8d5a17a5d..2a517c7059f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1187,7 +1187,7 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "ecolor" -version = "0.26.2" +version = "0.27.0" dependencies = [ "bytemuck", "cint", @@ -1198,7 +1198,7 @@ dependencies = [ [[package]] name = "eframe" -version = "0.26.2" +version = "0.27.0" dependencies = [ "bytemuck", "cocoa", @@ -1236,7 +1236,7 @@ dependencies = [ [[package]] name = "egui" -version = "0.26.2" +version = "0.27.0" dependencies = [ "accesskit", "ahash", @@ -1252,7 +1252,7 @@ dependencies = [ [[package]] name = "egui-wgpu" -version = "0.26.2" +version = "0.27.0" dependencies = [ "bytemuck", "document-features", @@ -1269,7 +1269,7 @@ dependencies = [ [[package]] name = "egui-winit" -version = "0.26.2" +version = "0.27.0" dependencies = [ "accesskit_winit", "arboard", @@ -1287,7 +1287,7 @@ dependencies = [ [[package]] name = "egui_demo_app" -version = "0.26.2" +version = "0.27.0" dependencies = [ "bytemuck", "chrono", @@ -1312,7 +1312,7 @@ dependencies = [ [[package]] name = "egui_demo_lib" -version = "0.26.2" +version = "0.27.0" dependencies = [ "chrono", "criterion", @@ -1327,7 +1327,7 @@ dependencies = [ [[package]] name = "egui_extras" -version = "0.26.2" +version = "0.27.0" dependencies = [ "chrono", "document-features", @@ -1345,7 +1345,7 @@ dependencies = [ [[package]] name = "egui_glow" -version = "0.26.2" +version = "0.27.0" dependencies = [ "bytemuck", "document-features", @@ -1365,7 +1365,7 @@ dependencies = [ [[package]] name = "egui_plot" -version = "0.26.2" +version = "0.27.0" dependencies = [ "document-features", "egui", @@ -1394,7 +1394,7 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "emath" -version = "0.26.2" +version = "0.27.0" dependencies = [ "bytemuck", "document-features", @@ -1469,7 +1469,7 @@ dependencies = [ [[package]] name = "epaint" -version = "0.26.2" +version = "0.27.0" dependencies = [ "ab_glyph", "ahash", diff --git a/Cargo.toml b/Cargo.toml index c3839499667..431bffcfcc9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ members = [ edition = "2021" license = "MIT OR Apache-2.0" rust-version = "1.72" -version = "0.26.2" +version = "0.27.0" [profile.release] @@ -48,17 +48,17 @@ opt-level = 2 [workspace.dependencies] -emath = { version = "0.26.2", path = "crates/emath", default-features = false } -ecolor = { version = "0.26.2", path = "crates/ecolor", default-features = false } -epaint = { version = "0.26.2", path = "crates/epaint", default-features = false } -egui = { version = "0.26.2", path = "crates/egui", default-features = false } -egui_plot = { version = "0.26.2", path = "crates/egui_plot", default-features = false } -egui-winit = { version = "0.26.2", path = "crates/egui-winit", default-features = false } -egui_extras = { version = "0.26.2", path = "crates/egui_extras", default-features = false } -egui-wgpu = { version = "0.26.2", path = "crates/egui-wgpu", default-features = false } -egui_demo_lib = { version = "0.26.2", path = "crates/egui_demo_lib", default-features = false } -egui_glow = { version = "0.26.2", path = "crates/egui_glow", default-features = false } -eframe = { version = "0.26.2", path = "crates/eframe", default-features = false } +emath = { version = "0.27.0", path = "crates/emath", default-features = false } +ecolor = { version = "0.27.0", path = "crates/ecolor", default-features = false } +epaint = { version = "0.27.0", path = "crates/epaint", default-features = false } +egui = { version = "0.27.0", path = "crates/egui", default-features = false } +egui_plot = { version = "0.27.0", path = "crates/egui_plot", default-features = false } +egui-winit = { version = "0.27.0", path = "crates/egui-winit", default-features = false } +egui_extras = { version = "0.27.0", path = "crates/egui_extras", default-features = false } +egui-wgpu = { version = "0.27.0", path = "crates/egui-wgpu", default-features = false } +egui_demo_lib = { version = "0.27.0", path = "crates/egui_demo_lib", default-features = false } +egui_glow = { version = "0.27.0", path = "crates/egui_glow", default-features = false } +eframe = { version = "0.27.0", path = "crates/eframe", default-features = false } #TODO(emilk): make more things workspace dependencies ahash = { version = "0.8.6", default-features = false, features = [ diff --git a/crates/ecolor/CHANGELOG.md b/crates/ecolor/CHANGELOG.md index 8f60af3df13..d21513d6c15 100644 --- a/crates/ecolor/CHANGELOG.md +++ b/crates/ecolor/CHANGELOG.md @@ -6,6 +6,10 @@ This file is updated upon each release. Changes since the last release can be found at or by running the `scripts/generate_changelog.py` script. +## 0.27.0 - 2024-03-26 +* Nothing new + + ## 0.26.2 - 2024-02-14 * Nothing new diff --git a/crates/eframe/CHANGELOG.md b/crates/eframe/CHANGELOG.md index f0566955899..3f3c3d689ff 100644 --- a/crates/eframe/CHANGELOG.md +++ b/crates/eframe/CHANGELOG.md @@ -7,6 +7,25 @@ This file is updated upon each release. Changes since the last release can be found at or by running the `scripts/generate_changelog.py` script. +## 0.27.0 - 2024-03-26 +* Update to document-features 0.2.8 [#4003](https://github.com/emilk/egui/pull/4003) +* Added `App::raw_input_hook` allows for the manipulation or filtering of raw input events [#4008](https://github.com/emilk/egui/pull/4008) (thanks [@varphone](https://github.com/varphone)!) + +#### Desktop/Native +* Add with_taskbar to viewport builder [#3958](https://github.com/emilk/egui/pull/3958) (thanks [@AnotherNathan](https://github.com/AnotherNathan)!) +* Add `winuser` feature to `winapi` to fix unresolved import [#4037](https://github.com/emilk/egui/pull/4037) (thanks [@varphone](https://github.com/varphone)!) +* Add `get_proc_address` in CreationContext [#4145](https://github.com/emilk/egui/pull/4145) (thanks [@Chaojimengnan](https://github.com/Chaojimengnan)!) +* Don't clear modifier state on focus change [#4157](https://github.com/emilk/egui/pull/4157) (thanks [@ming08108](https://github.com/ming08108)!) +* Add x11 window type settings to viewport builder [#4175](https://github.com/emilk/egui/pull/4175) (thanks [@psethwick](https://github.com/psethwick)!) + +#### Web +* Add `webgpu` feature by default to wgpu [#4124](https://github.com/emilk/egui/pull/4124) (thanks [@ctaggart](https://github.com/ctaggart)!) +* Update kb modifiers from web mouse events [#4156](https://github.com/emilk/egui/pull/4156) (thanks [@ming08108](https://github.com/ming08108)!) +* Fix crash on `request_animation_frame` when destroying web runner [#4169](https://github.com/emilk/egui/pull/4169) (thanks [@jprochazk](https://github.com/jprochazk)!) +* Fix bug parsing url query with escaped & or = [#4172](https://github.com/emilk/egui/pull/4172) +* `Location::query_map`: support repeated key [#4183](https://github.com/emilk/egui/pull/4183) + + ## 0.26.2 - 2024-02-14 * Add `winuser` feature to `winapi` to fix unresolved import [#4037](https://github.com/emilk/egui/pull/4037) (thanks [@varphone](https://github.com/varphone)!) @@ -22,38 +41,38 @@ Changes since the last release can be found at or by running the `scripts/generate_changelog.py` script. +## 0.27.0 - 2024-03-26 +* Improve panic message in egui-wgpu when failing to create buffers [#3986](https://github.com/emilk/egui/pull/3986) + + ## 0.26.2 - 2024-02-14 * Nothing new diff --git a/crates/egui-winit/CHANGELOG.md b/crates/egui-winit/CHANGELOG.md index 95961377e68..ff85f8b5dcb 100644 --- a/crates/egui-winit/CHANGELOG.md +++ b/crates/egui-winit/CHANGELOG.md @@ -5,6 +5,11 @@ This file is updated upon each release. Changes since the last release can be found at or by running the `scripts/generate_changelog.py` script. +## 0.27.0 - 2024-03-26 +* Update memoffset to 0.9.0, arboard to 3.3.1, and remove egui_glow's needless dependency on pure_glow's deps [#4036](https://github.com/emilk/egui/pull/4036) (thanks [@Nopey](https://github.com/Nopey)!) +* Don't clear modifier state on focus change [#4157](https://github.com/emilk/egui/pull/4157) (thanks [@ming08108](https://github.com/ming08108)!) + + ## 0.26.2 - 2024-02-14 * Update memoffset to 0.9.0, arboard to 3.3.1, and remove egui_glow's needless dependency on pure_glow's deps [#4036](https://github.com/emilk/egui/pull/4036) (thanks [@Nopey](https://github.com/Nopey)!) diff --git a/crates/egui_extras/CHANGELOG.md b/crates/egui_extras/CHANGELOG.md index 5863612d76a..fd498f3773a 100644 --- a/crates/egui_extras/CHANGELOG.md +++ b/crates/egui_extras/CHANGELOG.md @@ -5,6 +5,16 @@ This file is updated upon each release. Changes since the last release can be found at or by running the `scripts/generate_changelog.py` script. +## 0.27.0 - 2024-03-26 +* Add scroll bar visibility option to `Table` widget [#3981](https://github.com/emilk/egui/pull/3981) (thanks [@richardhozak](https://github.com/richardhozak)!) +* Update `ehttp` to 0.5 [#4055](https://github.com/emilk/egui/pull/4055) +* Fix: assign a different id to each table cell, avoiding id clashes [#4076](https://github.com/emilk/egui/pull/4076) +* Fix interaction with widgets inside selectable rows of `Table` [#4077](https://github.com/emilk/egui/pull/4077) +* Fixed handling of `file://` protocol for images [#4107](https://github.com/emilk/egui/pull/4107) (thanks [@varphone](https://github.com/varphone)!) +* Option to change date picker format [#4180](https://github.com/emilk/egui/pull/4180) (thanks [@zaaarf](https://github.com/zaaarf)!) +* Added ability to disable highlighting of weekend days in `DatePickerPopup`. [#4151](https://github.com/emilk/egui/pull/4151) (thanks [@hiyosilver](https://github.com/hiyosilver)!) + + ## 0.26.2 - 2024-02-14 * Nothing new diff --git a/crates/egui_glow/CHANGELOG.md b/crates/egui_glow/CHANGELOG.md index abb7a71292a..970fb87a2b2 100644 --- a/crates/egui_glow/CHANGELOG.md +++ b/crates/egui_glow/CHANGELOG.md @@ -6,6 +6,11 @@ Changes since the last release can be found at or by running the `scripts/generate_changelog.py` script. +## 0.27.0 - 2024-03-26 +* Add `sense` option to `Plot` [#4052](https://github.com/emilk/egui/pull/4052) (thanks [@AmesingFlank](https://github.com/AmesingFlank)!) +* Plot widget - allow disabling scroll for x and y separately [#4051](https://github.com/emilk/egui/pull/4051) (thanks [@YgorSouza](https://github.com/YgorSouza)!) +* Fix panic when the base step size is set to 0 [#4078](https://github.com/emilk/egui/pull/4078) (thanks [@abey79](https://github.com/abey79)!) +* Expose `PlotGeometry` in public API [#4193](https://github.com/emilk/egui/pull/4193) (thanks [@dwuertz](https://github.com/dwuertz)!) + + ## 0.26.2 - 2024-02-14 * Nothing new diff --git a/crates/epaint/CHANGELOG.md b/crates/epaint/CHANGELOG.md index 02c2bc66641..4e222f85563 100644 --- a/crates/epaint/CHANGELOG.md +++ b/crates/epaint/CHANGELOG.md @@ -5,6 +5,15 @@ This file is updated upon each release. Changes since the last release can be found at or by running the `scripts/generate_changelog.py` script. +## 0.27.0 - 2024-03-26 +* Add `ColorImage::from_gray_iter` [#3536](https://github.com/emilk/egui/pull/3536) (thanks [@wangxiaochuTHU](https://github.com/wangxiaochuTHU)!) +* Convenience const fn for `Margin`, `Rounding` and `Shadow` [#4080](https://github.com/emilk/egui/pull/4080) (thanks [@0Qwel](https://github.com/0Qwel)!) +* Added `Shape::{scale,translate}` wrappers [#4090](https://github.com/emilk/egui/pull/4090) (thanks [@varphone](https://github.com/varphone)!) +* Add `EllipseShape` [#4122](https://github.com/emilk/egui/pull/4122) (thanks [@TheTacBanana](https://github.com/TheTacBanana)!) +* Add `Margin` to `epaint` [#4231](https://github.com/emilk/egui/pull/4231) +* CSS-like `Shadow` with offset, spread, and blur [#4232](https://github.com/emilk/egui/pull/4232) + + ## 0.26.2 - 2024-02-14 * Nothing new