mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Merge branch 'main' into style_modifier
This commit is contained in:
@@ -38,7 +38,7 @@ egui.workspace = true
|
||||
eframe = { workspace = true, optional = true }
|
||||
kittest.workspace = true
|
||||
serde.workspace = true
|
||||
toml.workspace = true
|
||||
toml = {workspace = true, features = ["parse", "serde"] }
|
||||
|
||||
# wgpu dependencies
|
||||
egui-wgpu = { workspace = true, optional = true }
|
||||
|
||||
@@ -97,12 +97,12 @@ You should add the following to your `.gitignore`:
|
||||
* …have a low resolution to avoid growth in repo size
|
||||
* …have a low comparison threshold to avoid the test passing despite unwanted differences (the default threshold should be fine for most usecases!)
|
||||
|
||||
### What do do when CI / another computer produces a different image?
|
||||
### What to do when CI / another computer produces a different image?
|
||||
|
||||
The default tolerance settings should be fine for almost all gui comparison tests.
|
||||
However, especially when you're using custom rendering, you may observe images difference with different setups leading to unexpected test failures.
|
||||
|
||||
First check whether the difference is due to a change in enabled rendering features, potentially due to difference in hardware (/software renderer) capabilitites.
|
||||
First check whether the difference is due to a change in enabled rendering features, potentially due to difference in hardware (/software renderer) capabilities.
|
||||
Generally you should carefully enforcing the same set of features for all test runs, but this may happen nonetheless.
|
||||
|
||||
Once you validated that the differences are miniscule and hard to avoid, you can try to _carefully_ adjust the comparison tolerance setting (`SnapshotOptions::threshold`, TODO([#5683](https://github.com/emilk/egui/issues/5683)): as well as number of pixels allowed to differ) for the specific test.
|
||||
|
||||
@@ -98,9 +98,11 @@ impl Node<'_> {
|
||||
/// This will trigger a [`accesskit::Action::Click`] action.
|
||||
/// In contrast to `click()`, this can also click widgets that are not currently visible.
|
||||
pub fn click_accesskit(&self) {
|
||||
let (target_node, target_tree) = self.accesskit_node.locate();
|
||||
self.event(egui::Event::AccessKitActionRequest(
|
||||
accesskit::ActionRequest {
|
||||
target: self.accesskit_node.id(),
|
||||
target_node,
|
||||
target_tree,
|
||||
action: accesskit::Action::Click,
|
||||
data: None,
|
||||
},
|
||||
@@ -119,9 +121,11 @@ impl Node<'_> {
|
||||
}
|
||||
|
||||
pub fn focus(&self) {
|
||||
let (target_node, target_tree) = self.accesskit_node.locate();
|
||||
self.event(egui::Event::AccessKitActionRequest(ActionRequest {
|
||||
action: accesskit::Action::Focus,
|
||||
target: self.accesskit_node.id(),
|
||||
target_node,
|
||||
target_tree,
|
||||
data: None,
|
||||
}));
|
||||
}
|
||||
@@ -162,45 +166,55 @@ impl Node<'_> {
|
||||
|
||||
/// Scroll the node into view.
|
||||
pub fn scroll_to_me(&self) {
|
||||
let (target_node, target_tree) = self.accesskit_node.locate();
|
||||
self.event(egui::Event::AccessKitActionRequest(ActionRequest {
|
||||
action: accesskit::Action::ScrollIntoView,
|
||||
target: self.accesskit_node.id(),
|
||||
target_node,
|
||||
target_tree,
|
||||
data: None,
|
||||
}));
|
||||
}
|
||||
|
||||
/// Scroll the [`egui::ScrollArea`] containing this node down (100px).
|
||||
pub fn scroll_down(&self) {
|
||||
let (target_node, target_tree) = self.accesskit_node.locate();
|
||||
self.event(egui::Event::AccessKitActionRequest(ActionRequest {
|
||||
action: accesskit::Action::ScrollDown,
|
||||
target: self.accesskit_node.id(),
|
||||
target_node,
|
||||
target_tree,
|
||||
data: None,
|
||||
}));
|
||||
}
|
||||
|
||||
/// Scroll the [`egui::ScrollArea`] containing this node up (100px).
|
||||
pub fn scroll_up(&self) {
|
||||
let (target_node, target_tree) = self.accesskit_node.locate();
|
||||
self.event(egui::Event::AccessKitActionRequest(ActionRequest {
|
||||
action: accesskit::Action::ScrollUp,
|
||||
target: self.accesskit_node.id(),
|
||||
target_node,
|
||||
target_tree,
|
||||
data: None,
|
||||
}));
|
||||
}
|
||||
|
||||
/// Scroll the [`egui::ScrollArea`] containing this node left (100px).
|
||||
pub fn scroll_left(&self) {
|
||||
let (target_node, target_tree) = self.accesskit_node.locate();
|
||||
self.event(egui::Event::AccessKitActionRequest(ActionRequest {
|
||||
action: accesskit::Action::ScrollLeft,
|
||||
target: self.accesskit_node.id(),
|
||||
target_node,
|
||||
target_tree,
|
||||
data: None,
|
||||
}));
|
||||
}
|
||||
|
||||
/// Scroll the [`egui::ScrollArea`] containing this node right (100px).
|
||||
pub fn scroll_right(&self) {
|
||||
let (target_node, target_tree) = self.accesskit_node.locate();
|
||||
self.event(egui::Event::AccessKitActionRequest(ActionRequest {
|
||||
action: accesskit::Action::ScrollRight,
|
||||
target: self.accesskit_node.id(),
|
||||
target_node,
|
||||
target_tree,
|
||||
data: None,
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -859,6 +859,7 @@ impl From<SnapshotResults> for Vec<SnapshotError> {
|
||||
}
|
||||
|
||||
impl Drop for SnapshotResults {
|
||||
#[track_caller]
|
||||
fn drop(&mut self) {
|
||||
// Don't panic if we are already panicking (the test probably failed for another reason)
|
||||
if std::thread::panicking() {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3ca39801faddae7191ed054029263e8eca488d16e1fcbb40fed482d39fc89e8e
|
||||
size 4520
|
||||
oid sha256:00fb02e0cc2c1454d3a3dc0635be24086234c2bc5e2c9fd73741b179622e16d6
|
||||
size 4514
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bafe5d7129cd2137b8f7bc9662b894d959b7042c436443f835ecd421a0d9c33f
|
||||
size 8019
|
||||
oid sha256:d8757e2db9a3892d9347495ad59f14d2bd9164a9ba258375a53c9faf8176b597
|
||||
size 8016
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5b6447dd4bd6489b9b909b8240abe54db16331beaa2fb4656f01f79a08fb25f9
|
||||
size 11112
|
||||
oid sha256:5f4a038f9acbb12880ba6b681ef7d3ae566045c4474aa31e7c6d746c39a649fc
|
||||
size 11108
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4baf110e63fb104f30e9ae06e3601cfb48d7b69aec31636ca470c9ba9f6d44a9
|
||||
size 21659
|
||||
oid sha256:2965482e0161b4ea99aa5b4ece32261dbe246f86fe43054a754fbd556c7a5896
|
||||
size 21666
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:93d2f336e216f371e7239b08113e659bad6c30eb299a2d8ea9537ae1c63533f0
|
||||
size 28503
|
||||
oid sha256:7592ca6213497f686d105a2e686d0c5de364388ddd174cbe8abb425d27ddcab0
|
||||
size 28505
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6bf27cde6a87112a1ae832a65c80a9e34243b6ee368314379f5bf018edf439e5
|
||||
size 33239
|
||||
oid sha256:3a1adf0903f0fc50323c2d77bbc491c950ab0dae6593c004770ea7961c2c6273
|
||||
size 33270
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e8038005841dbf272375388b224dcc9fc1177b5c113d3e6f6dbc2265c88c7e60
|
||||
size 19704
|
||||
oid sha256:bf8177abaa5920e32ad4618f5296355377f475b0c0f9a95f75cbfbe468415fb8
|
||||
size 19696
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e86ed66f3ac3a81998eefbed8cb231edc6522174050676b45e9248f9e7f18533
|
||||
size 2227
|
||||
oid sha256:1dd1f5013587463f002b1becac1560876c462295dbe5dfbb1a9dbce58991e53d
|
||||
size 2209
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4216258893fae554f0ab8b3a76ef0905cacb62c70af47fa811ff6f3d99f9f3ab
|
||||
size 5619
|
||||
oid sha256:be0bd449166878ced27eff4966d1741731e926f9baabe8b590375c20103036dd
|
||||
size 5527
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:21a92c29e27ef0fdec273ea2d94a2b3e74cdf380ec77f4783daeb008bd51db6d
|
||||
size 2767
|
||||
oid sha256:888f8a4d995d718a9a158e563d8ac1434775660b33aebb5f34feea54ffd12600
|
||||
size 2830
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:21a92c29e27ef0fdec273ea2d94a2b3e74cdf380ec77f4783daeb008bd51db6d
|
||||
size 2767
|
||||
oid sha256:888f8a4d995d718a9a158e563d8ac1434775660b33aebb5f34feea54ffd12600
|
||||
size 2830
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f9ca5f8081d677b8bff47813c4eb94319ca03855e780aed834ecc2f3d905a22c
|
||||
size 4852
|
||||
oid sha256:037f3e356d32e1a2c32767460399f919452bff0933e1db7aa113e7e2bdb083f0
|
||||
size 4927
|
||||
|
||||
Reference in New Issue
Block a user