mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Merge remote-tracking branch 'origin/master' into default_affects_opacity
This commit is contained in:
@@ -87,6 +87,7 @@ env_logger = { version = "0.10", default-features = false, features = [
|
||||
"auto-color",
|
||||
"humantime",
|
||||
] }
|
||||
mimalloc.workspace = true
|
||||
rfd = { version = "0.15.3", optional = true }
|
||||
|
||||
# web:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# egui demo app
|
||||
This app demonstrates [`egui`](https://github.com/emilk/egui/) and [`eframe`](https://github.com/emilk/egui/tree/master/crates/eframe).
|
||||
This app demonstrates [`egui`](https://github.com/emilk/egui/) and [`eframe`](https://github.com/emilk/egui/tree/main/crates/eframe).
|
||||
|
||||
View the demo app online at <https://egui.rs>.
|
||||
|
||||
@@ -12,7 +12,7 @@ Run it locally with `cargo run --release -p egui_demo_app`.
|
||||
./scripts/build_demo_web.sh --open
|
||||
```
|
||||
|
||||
`egui_demo_app` uses [`egui_demo_lib`](https://github.com/emilk/egui/tree/master/crates/egui_demo_lib).
|
||||
`egui_demo_app` uses [`egui_demo_lib`](https://github.com/emilk/egui/tree/main/crates/egui_demo_lib).
|
||||
|
||||
|
||||
## Running with `wgpu` backend
|
||||
|
||||
@@ -80,7 +80,7 @@ struct RotatingTriangle {
|
||||
vertex_array: glow::VertexArray,
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)] // we need unsafe code to use glow
|
||||
#[expect(unsafe_code)] // we need unsafe code to use glow
|
||||
impl RotatingTriangle {
|
||||
fn new(gl: &glow::Context) -> Option<Self> {
|
||||
use glow::HasContext as _;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::num::NonZeroU64;
|
||||
|
||||
use eframe::{
|
||||
egui_wgpu::wgpu::util::DeviceExt,
|
||||
egui_wgpu::wgpu::util::DeviceExt as _,
|
||||
egui_wgpu::{self, wgpu},
|
||||
};
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ pub struct HttpApp {
|
||||
impl Default for HttpApp {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
url: "https://raw.githubusercontent.com/emilk/egui/master/README.md".to_owned(),
|
||||
url: "https://raw.githubusercontent.com/emilk/egui/main/README.md".to_owned(),
|
||||
promise: Default::default(),
|
||||
}
|
||||
}
|
||||
@@ -133,7 +133,7 @@ fn ui_url(ui: &mut egui::Ui, frame: &eframe::Frame, url: &mut String) -> bool {
|
||||
ui.horizontal(|ui| {
|
||||
if ui.button("Source code for this example").clicked() {
|
||||
*url = format!(
|
||||
"https://raw.githubusercontent.com/emilk/egui/master/{}",
|
||||
"https://raw.githubusercontent.com/emilk/egui/main/{}",
|
||||
file!()
|
||||
);
|
||||
trigger_fetch = true;
|
||||
|
||||
@@ -110,7 +110,7 @@ impl BackendPanel {
|
||||
if cfg!(debug_assertions) && cfg!(target_arch = "wasm32") {
|
||||
ui.separator();
|
||||
// For testing panic handling on web:
|
||||
#[allow(clippy::manual_assert)]
|
||||
#[expect(clippy::manual_assert)]
|
||||
if ui.button("panic!()").clicked() {
|
||||
panic!("intentional panic!");
|
||||
}
|
||||
@@ -183,7 +183,7 @@ fn integration_ui(ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
|
||||
ui.label("egui running inside ");
|
||||
ui.hyperlink_to(
|
||||
"eframe",
|
||||
"https://github.com/emilk/egui/tree/master/crates/eframe",
|
||||
"https://github.com/emilk/egui/tree/main/crates/eframe",
|
||||
);
|
||||
ui.label(".");
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ pub use wrap_app::{Anchor, WrapApp};
|
||||
|
||||
/// Time of day as seconds since midnight. Used for clock in demo app.
|
||||
pub(crate) fn seconds_since_midnight() -> f64 {
|
||||
use chrono::Timelike;
|
||||
use chrono::Timelike as _;
|
||||
let time = chrono::Local::now().time();
|
||||
time.num_seconds_from_midnight() as f64 + 1e-9 * (time.nanosecond() as f64)
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
#![allow(rustdoc::missing_crate_level_docs)] // it's an example
|
||||
#![allow(clippy::never_loop)] // False positive
|
||||
|
||||
#[global_allocator]
|
||||
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; // Much faster allocator, can give 20% speedups: https://github.com/emilk/egui/pull/7029
|
||||
|
||||
// When compiling natively:
|
||||
fn main() -> eframe::Result {
|
||||
for arg in std::env::args().skip(1) {
|
||||
@@ -75,7 +78,7 @@ fn start_puffin_server() {
|
||||
|
||||
// We can store the server if we want, but in this case we just want
|
||||
// it to keep running. Dropping it closes the server, so let's not drop it!
|
||||
#[allow(clippy::mem_forget)]
|
||||
#[expect(clippy::mem_forget)]
|
||||
std::mem::forget(puffin_server);
|
||||
}
|
||||
Err(err) => {
|
||||
|
||||
@@ -14,7 +14,7 @@ pub struct WebHandle {
|
||||
#[wasm_bindgen]
|
||||
impl WebHandle {
|
||||
/// Installs a panic hook, then returns.
|
||||
#[allow(clippy::new_without_default)]
|
||||
#[allow(clippy::new_without_default, clippy::allow_attributes)]
|
||||
#[wasm_bindgen(constructor)]
|
||||
pub fn new() -> Self {
|
||||
// Redirect [`log`] message to `console.log` and friends:
|
||||
|
||||
@@ -134,7 +134,7 @@ impl std::fmt::Display for Anchor {
|
||||
|
||||
impl From<Anchor> for egui::WidgetText {
|
||||
fn from(value: Anchor) -> Self {
|
||||
Self::RichText(egui::RichText::new(value.to_string()))
|
||||
Self::from(value.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ impl WrapApp {
|
||||
// This gives us image support:
|
||||
egui_extras::install_image_loaders(&cc.egui_ctx);
|
||||
|
||||
#[allow(unused_mut)]
|
||||
#[allow(unused_mut, clippy::allow_attributes)]
|
||||
let mut slf = Self {
|
||||
state: State::default(),
|
||||
|
||||
|
||||
@@ -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:3f5ccd92f59d55919cbd837de49f2458feb11e74ffd65f82b74ae149e87b9c2e
|
||||
size 178904
|
||||
oid sha256:a8440e6956effab863b64c745fb3b0616a320250f6373fd3a3d66380cfa37c14
|
||||
size 262
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f7572ec2dad9038c24beb9949e4c05155cd0f5479153de6647c38911ec5c67a0
|
||||
size 100779
|
||||
oid sha256:0e37b3ce49c9ccc1a64beb58b176e23ab6c1fa2d897f676b0de85e510e6bfa85
|
||||
size 100845
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use egui::accesskit::Role;
|
||||
use egui::Vec2;
|
||||
use egui_demo_app::{Anchor, WrapApp};
|
||||
use egui_kittest::kittest::Queryable;
|
||||
use egui_kittest::kittest::Queryable as _;
|
||||
use egui_kittest::SnapshotResults;
|
||||
|
||||
#[test]
|
||||
@@ -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:")
|
||||
|
||||
Reference in New Issue
Block a user