Skip to content

Commit

Permalink
Merge branch 'master' into emilk/update-image
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed May 13, 2024
2 parents 38b35fd + acfe9f6 commit c6096c7
Show file tree
Hide file tree
Showing 250 changed files with 6,634 additions and 3,221 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Expand Up @@ -4,3 +4,6 @@
# we don't use `[build]` because of rust analyzer's build cache invalidation https://github.com/emilk/eframe_template/issues/93
[target.wasm32-unknown-unknown]
rustflags = ["--cfg=web_sys_unstable_apis"]

[alias]
xtask = "run --quiet --package xtask --"
2 changes: 2 additions & 0 deletions .gitattributes
@@ -0,0 +1,2 @@
* text=auto eol=lf
Cargo.lock linguist-generated=false
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Expand Up @@ -6,7 +6,7 @@ Please read the "Making a PR" section of [`CONTRIBUTING.md`](https://github.com/
* 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`.
* 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.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_web_demo.yml
Expand Up @@ -43,7 +43,7 @@ jobs:
with:
profile: minimal
target: wasm32-unknown-unknown
toolchain: 1.72.0
toolchain: 1.76.0
override: true

- uses: Swatinem/rust-cache@v2
Expand Down
32 changes: 11 additions & 21 deletions .github/workflows/rust.yml
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.72.0
toolchain: 1.76.0

- name: Install packages (Linux)
if: runner.os == 'Linux'
Expand All @@ -40,11 +40,6 @@ jobs:
- name: Lint vertical spacing
run: ./scripts/lint.py

- name: Install cargo-cranky
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-cranky

- name: check --all-features
run: cargo check --locked --all-features --all-targets

Expand Down Expand Up @@ -78,11 +73,11 @@ jobs:
- name: Test
run: cargo test --all-features

- name: Cranky
run: cargo cranky --all-targets --all-features -- -D warnings
- name: clippy
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Cranky release
run: cargo cranky --all-targets --all-features --release -- -D warnings
- name: clippy release
run: cargo clippy --all-targets --all-features --release -- -D warnings

# ---------------------------------------------------------------------------

Expand All @@ -93,19 +88,14 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.72.0
toolchain: 1.76.0
targets: wasm32-unknown-unknown

- run: sudo apt-get update && sudo apt-get install libgtk-3-dev libatk1.0-dev

- name: Set up cargo cache
uses: Swatinem/rust-cache@v2

- name: Install cargo-cranky
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-cranky

- name: Check wasm32 egui_demo_app
run: cargo check -p egui_demo_app --lib --target wasm32-unknown-unknown

Expand All @@ -118,11 +108,11 @@ jobs:
- name: wasm-bindgen
uses: jetli/wasm-bindgen-action@v0.1.0
with:
version: "0.2.88"
version: "0.2.92"

- run: ./scripts/wasm_bindgen_check.sh --skip-setup

- name: Cranky wasm32
- name: clippy wasm32
run: ./scripts/clippy_wasm.sh

# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -151,7 +141,7 @@ jobs:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
rust-version: "1.72.0"
rust-version: "1.76.0"
log-level: error
command: check
arguments: --target ${{ matrix.target }}
Expand All @@ -166,7 +156,7 @@ jobs:

- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.72.0
toolchain: 1.76.0
targets: aarch64-linux-android

- name: Set up cargo cache
Expand All @@ -184,7 +174,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.72.0
toolchain: 1.76.0

- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,3 +5,4 @@
/.*.json
/.vscode
/media/*
.idea/
2 changes: 2 additions & 0 deletions .typos.toml
Expand Up @@ -3,7 +3,9 @@
# run: typos

[default.extend-words]
ime = "ime" # Input Method Editor
nknown = "nknown" # part of @55nknown username
ro = "ro" # read-only, also part of the username @Phen-Ro

[files]
extend-exclude = ["web_demo/egui_demo_app.js"] # auto-generated
4 changes: 2 additions & 2 deletions .vscode/settings.json
Expand Up @@ -15,7 +15,7 @@
// Tell Rust Analyzer to use its own target directory, so we don't need to wait for it to finish wen we want to `cargo run`
"rust-analyzer.check.overrideCommand": [
"cargo",
"cranky",
"clippy",
"--target-dir=target_ra",
"--workspace",
"--message-format=json",
Expand All @@ -24,7 +24,7 @@
],
"rust-analyzer.cargo.buildScripts.overrideCommand": [
"cargo",
"cranky",
"clippy",
"--quiet",
"--target-dir=target_ra",
"--workspace",
Expand Down
99 changes: 99 additions & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,105 @@ This file is updated upon each release.
Changes since the last release can be found at <https://github.com/emilk/egui/compare/latest...HEAD> or by running the `scripts/generate_changelog.py` script.


## 0.27.2 - 2024-04-02
### 🐛 Fixed
* Fix tooltips for non-interactive widgets [#4291](https://github.com/emilk/egui/pull/4291)
* Fix problem clicking the edge of a `TextEdit` [#4272](https://github.com/emilk/egui/pull/4272)
* Fix: `Response::clicked_elsewhere` takes clip rect into account [#4274](https://github.com/emilk/egui/pull/4274)
* Fix incorrect `Response::interact_rect` for `Area/Window` [#4273](https://github.com/emilk/egui/pull/4273)

### ⭐ Added
* Allow disabling animations on a `ScrollArea` [#4309](https://github.com/emilk/egui/pull/4309) (thanks [@lucasmerlin](https://github.com/lucasmerlin)!)


## 0.27.1 - 2024-03-29
### 🐛 Fixed
* Fix visual glitch on the right side of highly rounded rectangles [#4244](https://github.com/emilk/egui/pull/4244)
* Prevent visual glitch when shadow blur width is very high [#4245](https://github.com/emilk/egui/pull/4245)
* Fix `InputState::any_touches` and add `InputState::has_touch_screen` [#4247](https://github.com/emilk/egui/pull/4247)
* Fix `Context::repaint_causes` returning no causes [#4248](https://github.com/emilk/egui/pull/4248)
* Fix touch-and-hold to open context menu [#4249](https://github.com/emilk/egui/pull/4249)
* Hide shortcut text on zoom buttons if `zoom_with_keyboard` is false [#4262](https://github.com/emilk/egui/pull/4262)

### 🔧 Changed
* Don't apply a clip rect to the contents of an `Area` or `Window` [#4258](https://github.com/emilk/egui/pull/4258)


## 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.

<img width="580" alt="Screenshot 2024-03-26 at 17 00 23" src="https://github.com/emilk/egui/assets/1148717/f1eea39f-17a7-41ca-a983-ee142b04ef26">


### ⚠️ 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
* Avoid interacting twice when not required [#4041](https://github.com/emilk/egui/pull/4041) (thanks [@abey79](https://github.com/abey79)!)

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -44,7 +44,7 @@ Please keep pull requests small and focused. The smaller it is, the more likely

Most PR reviews are done by me, Emil, but I very much appreciate any help I can get reviewing PRs!

It is very easy to add complexity to a project, but remember that each line of code added is code that needs to be maintained in perpituity, so we have a high bar on what get merged!
It is very easy to add complexity to a project, but remember that each line of code added is code that needs to be maintained in perpetuity, so we have a high bar on what get merged!

When reviewing, we look for:
* The PR title and description should be helpful
Expand Down Expand Up @@ -123,7 +123,7 @@ with `Vec2::X` increasing to the right and `Vec2::Y` increasing downwards.

`egui` uses logical _points_ as its coordinate system.
Those related to physical _pixels_ by the `pixels_per_point` scale factor.
For example, a high-dpi screeen can have `pixels_per_point = 2.0`,
For example, a high-dpi screen can have `pixels_per_point = 2.0`,
meaning there are two physical screen pixels for each logical point.

Angles are in radians, and are measured clockwise from the X-axis, which has angle=0.
Expand Down

0 comments on commit c6096c7

Please sign in to comment.