mirror of
https://github.com/emilk/egui.git
synced 2026-09-03 23:30:04 -04:00
Merge branch 'main' into lucas/experiments/measure-widget-size
# Conflicts: # crates/egui/src/atomics/atom.rs # crates/egui/src/atomics/atom_kind.rs # crates/egui/src/atomics/atom_layout.rs # crates/egui/src/containers/sides.rs # crates/egui/src/placer.rs # crates/egui/src/widgets/label.rs # crates/egui/src/widgets/selected_label.rs # crates/egui_demo_lib/src/demo/dancing_strings.rs # crates/egui_extras/src/layout.rs # crates/epaint/src/text/text_layout_types.rs
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
use egui::{
|
||||
Color32, Painter, Pos2, Rect, Shape, Stroke, Ui, Vec2,
|
||||
containers::{CollapsingHeader, Frame},
|
||||
emath, pos2,
|
||||
widgets::Slider,
|
||||
Color32, Painter, Pos2, Rect, Shape, Stroke, Ui, Vec2,
|
||||
};
|
||||
use std::f32::consts::TAU;
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use egui::emath::Rot2;
|
||||
use egui::panel::Side;
|
||||
use egui::panel::TopBottomSide;
|
||||
use egui::ImageFit;
|
||||
use egui::Slider;
|
||||
use egui::Vec2;
|
||||
use egui::emath::Rot2;
|
||||
use egui::panel::Side;
|
||||
use egui::panel::TopBottomSide;
|
||||
|
||||
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
||||
pub struct ImageViewer {
|
||||
|
||||
@@ -146,6 +146,10 @@ impl BackendPanel {
|
||||
// builds to keep the noise down in the official demo.
|
||||
if cfg!(debug_assertions) {
|
||||
ui.collapsing("More…", |ui| {
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("Total ui frames:");
|
||||
ui.monospace(ui.ctx().cumulative_frame_nr().to_string());
|
||||
});
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("Total ui passes:");
|
||||
ui.monospace(ui.ctx().cumulative_pass_nr().to_string());
|
||||
|
||||
@@ -54,7 +54,7 @@ impl FrameHistory {
|
||||
}
|
||||
|
||||
fn graph(&self, ui: &mut egui::Ui) -> egui::Response {
|
||||
use egui::{emath, epaint, pos2, vec2, Pos2, Rect, Sense, Shape, Stroke, TextStyle};
|
||||
use egui::{Pos2, Rect, Sense, Shape, Stroke, TextStyle, emath, epaint, pos2, vec2};
|
||||
|
||||
ui.label("egui CPU usage history");
|
||||
|
||||
|
||||
@@ -16,7 +16,9 @@ fn main() -> eframe::Result {
|
||||
start_puffin_server();
|
||||
|
||||
#[cfg(not(feature = "puffin"))]
|
||||
panic!("Unknown argument: {arg} - you need to enable the 'puffin' feature to use this.");
|
||||
panic!(
|
||||
"Unknown argument: {arg} - you need to enable the 'puffin' feature to use this."
|
||||
);
|
||||
}
|
||||
|
||||
_ => {
|
||||
@@ -39,7 +41,12 @@ fn main() -> eframe::Result {
|
||||
rust_log += &format!(",{loud_crate}=warn");
|
||||
}
|
||||
}
|
||||
std::env::set_var("RUST_LOG", rust_log);
|
||||
|
||||
// SAFETY: we call this from the main thread without any other threads running.
|
||||
#[expect(unsafe_code)]
|
||||
unsafe {
|
||||
std::env::set_var("RUST_LOG", rust_log);
|
||||
}
|
||||
}
|
||||
|
||||
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:61db3807f755ac832ba069e1adaf8aeb550c88737b4907748667a271ae29863d
|
||||
size 334792
|
||||
oid sha256:0bd688ff74f9a096edab545fbcbf61b61a464183da066ae4a120ce1e2abf3e7b
|
||||
size 334969
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:21e0a6cdf175606a513ddf410ae1b873a9817305ecad403116fad3c6ff795fa3
|
||||
size 92185
|
||||
oid sha256:c80c4ae4c2bfbc5c91e9cd94213a4f87646fe910b4a7c747531a1efcf23def47
|
||||
size 92364
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3e6a383dca7e91d07df4bf501e2de13d046f04546a08d026efe3f82fc96b6e29
|
||||
size 178887
|
||||
oid sha256:fc3dbdcd483d4da7a9c1a00f0245a7882997fbcd2d26f8d6a6d2d855f3382063
|
||||
size 179724
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e2fae780123389ca0affa762a5c031b84abcdd31c7a830d485c907c8c370b006
|
||||
size 100780
|
||||
oid sha256:c8ad2c2d494e2287b878049091688069e4d86b69ae72b89cb7ecbe47d8c35e33
|
||||
size 100766
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use egui::accesskit::Role;
|
||||
use egui::Vec2;
|
||||
use egui::accesskit::Role;
|
||||
use egui_demo_app::{Anchor, WrapApp};
|
||||
use egui_kittest::kittest::Queryable as _;
|
||||
use egui_kittest::SnapshotResults;
|
||||
use egui_kittest::kittest::Queryable as _;
|
||||
|
||||
#[test]
|
||||
fn test_demo_app() {
|
||||
@@ -55,7 +55,7 @@ fn test_demo_app() {
|
||||
harness
|
||||
.get_by_role_and_label(Role::TextInput, "URI:")
|
||||
.focus();
|
||||
harness.press_key_modifiers(egui::Modifiers::COMMAND, egui::Key::A);
|
||||
harness.key_press_modifiers(egui::Modifiers::COMMAND, egui::Key::A);
|
||||
|
||||
harness
|
||||
.get_by_role_and_label(Role::TextInput, "URI:")
|
||||
@@ -69,6 +69,6 @@ fn test_demo_app() {
|
||||
// Can't use Harness::run because fractal clock keeps requesting repaints
|
||||
harness.run_steps(4);
|
||||
|
||||
results.add(harness.try_snapshot(&anchor.to_string()));
|
||||
results.add(harness.try_snapshot(anchor.to_string()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user