From cccdfd246e5615d27c4a5543129153f950d0dd5c Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Tue, 23 May 2023 19:44:49 +0200 Subject: [PATCH] Cleanup ahead of release --- CHANGELOG.md | 6 +++--- README.md | 4 ++-- crates/eframe/CHANGELOG.md | 4 +++- crates/eframe/src/lib.rs | 6 +++--- crates/egui_demo_app/src/backend_panel.rs | 1 + crates/egui_demo_app/src/web.rs | 11 ++++------- examples/hello_world_simple/src/main.rs | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a94770bcb9..7f67fe0fdb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to the `egui` crate will be documented in this file. NOTE: [`epaint`](crates/epaint/CHANGELOG.md), [`eframe`](crates/eframe/CHANGELOG.md), [`egui-winit`](crates/egui-winit/CHANGELOG.md), [`egui_glium`](crates/egui_glium/CHANGELOG.md), [`egui_glow`](crates/egui_glow/CHANGELOG.md) and [`egui-wgpu`](crates/egui-wgpu/CHANGELOG.md) have their own changelogs! -## Unreleased +## Unreleased - A plethora of small improvements ### ⭐ Added * Scroll bar visibility options [#2729](https://github.com/emilk/egui/pull/2729) (thanks [@IVAN-MK7](https://github.com/IVAN-MK7)!) * Add `Grid::with_row_color` [#2519](https://github.com/emilk/egui/pull/2519) (thanks [@imgurbot12](https://github.com/imgurbot12)!) @@ -13,12 +13,12 @@ NOTE: [`epaint`](crates/epaint/CHANGELOG.md), [`eframe`](crates/eframe/CHANGELOG * Return plot transforms [#2935](https://github.com/emilk/egui/pull/2935) * Add `Pointer::is_decidedly_dragging` and `could_any_button_be_click` [#2979](https://github.com/emilk/egui/pull/2979) * Plot widget - allow disabling zoom and drag for x and y separately [#2901](https://github.com/emilk/egui/pull/2901) (thanks [@OmegaJak](https://github.com/OmegaJak)!) -* Add character limit to TextEdit [#2816](https://github.com/emilk/egui/pull/2816) (thanks [@wzid](https://github.com/wzid)!) +* Add character limit to `TextEdit` [#2816](https://github.com/emilk/egui/pull/2816) (thanks [@wzid](https://github.com/wzid)!) * Add `egui::Modifiers::contains` [#2989](https://github.com/emilk/egui/pull/2989) (thanks [@Wumpf](https://github.com/Wumpf)!) ### 🔧 Changed -* Transpose the value/satuation panel of the color picker [#2727](https://github.com/emilk/egui/pull/2727) (thanks [@IVAN-MK7](https://github.com/IVAN-MK7)!) * Improve vertical alignment of fonts [#2724](https://github.com/emilk/egui/pull/2724) (thanks [@lictex](https://github.com/lictex)!) +* Transpose the value/satuation panel of the color picker [#2727](https://github.com/emilk/egui/pull/2727) (thanks [@IVAN-MK7](https://github.com/IVAN-MK7)!) * Replace `ComboBox::show_index` `String` with `Into` [#2790](https://github.com/emilk/egui/pull/2790) (thanks [@tosti007](https://github.com/tosti007)!) * Replace `tracing` with `log` [#2928](https://github.com/emilk/egui/pull/2928) * Only show id clash warnings in debug builds by default [#2930](https://github.com/emilk/egui/pull/2930) diff --git a/README.md b/README.md index 6797802a544..ae9cf01fe0a 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ ui.add(egui::Slider::new(&mut age, 0..=120).text("age")); if ui.button("Click each year").clicked() { age += 1; } -ui.label(format!("Hello '{}', age {}", name, age)); +ui.label(format!("Hello '{name}', age {age}")); ``` @@ -70,7 +70,7 @@ The native backend is [`egui_glow`](https://github.com/emilk/egui/tree/master/cr On Fedora Rawhide you need to run: -`dnf install clang clang-devel clang-tools-extra libxkbcommon-devel pkg-config openssl-devel libxcb-devel gtk3-devel atk` +`dnf install clang clang-devel clang-tools-extra libxkbcommon-devel pkg-config openssl-devel libxcb-devel gtk3-devel atk fontconfig-devel` **NOTE**: This is just for the demo app - egui itself is completely platform agnostic! diff --git a/crates/eframe/CHANGELOG.md b/crates/eframe/CHANGELOG.md index a2027bfad8e..a8968c970c9 100644 --- a/crates/eframe/CHANGELOG.md +++ b/crates/eframe/CHANGELOG.md @@ -31,8 +31,10 @@ NOTE: [`egui-winit`](../egui-winit/CHANGELOG.md), [`egui_glium`](../egui_glium/C #### Web: -* Prefer the client width/height for the canvas parent [#2804](https://github.com/emilk/egui/pull/2804) (thanks [@samitbasu](https://github.com/samitbasu)!) +* ⚠️ BREAKING: `eframe::start_web` has been replaced with `eframe::WebRunner`, which also installs a nice panic hook (no need for `console_error_panic_hook`). * ⚠️ BREAKING: WebGPU is now the default web renderer when using the `wgpu` feature of `eframe`. To use WebGL with `wgpu`, you need to add `wgpu = { version = "0.16.0", features = ["webgl"] }` to your own `Cargo.toml`. ([#2945](https://github.com/emilk/egui/pull/2945)) +* Add `eframe::WebLogger` for redirecting `log` calls to the web console (`console.log`). +* Prefer the client width/height for the canvas parent [#2804](https://github.com/emilk/egui/pull/2804) (thanks [@samitbasu](https://github.com/samitbasu)!) * eframe web: Persist app state to local storage when leaving site [#2927](https://github.com/emilk/egui/pull/2927) * Better panic handling [#2942](https://github.com/emilk/egui/pull/2942) [#2992](https://github.com/emilk/egui/pull/2992) * Update wasm-bindgen to 0.2.86 [#2995](https://github.com/emilk/egui/pull/2995) diff --git a/crates/eframe/src/lib.rs b/crates/eframe/src/lib.rs index b76c78eaf33..afa602cc94d 100644 --- a/crates/eframe/src/lib.rs +++ b/crates/eframe/src/lib.rs @@ -61,7 +61,7 @@ //! #[wasm_bindgen(constructor)] //! pub fn new() -> Self { //! // Redirect [`log`] message to `console.log` and friends: -//! eframe::web::WebLogger::init(log::LevelFilter::Debug).ok(); +//! eframe::WebLogger::init(log::LevelFilter::Debug).ok(); //! //! Self { //! runner: WebRunner::new(), @@ -150,7 +150,7 @@ pub use web_sys; pub mod web; #[cfg(target_arch = "wasm32")] -pub use web::WebRunner; +pub use web::{WebLogger, WebRunner}; // ---------------------------------------------------------------------------- // When compiling natively @@ -254,7 +254,7 @@ pub fn run_native( /// if ui.button("Click each year").clicked() { /// age += 1; /// } -/// ui.label(format!("Hello '{}', age {}", name, age)); +/// ui.label(format!("Hello '{name}', age {age}")); /// }); /// }) /// } diff --git a/crates/egui_demo_app/src/backend_panel.rs b/crates/egui_demo_app/src/backend_panel.rs index 288a953d20e..33d1cc6307e 100644 --- a/crates/egui_demo_app/src/backend_panel.rs +++ b/crates/egui_demo_app/src/backend_panel.rs @@ -148,6 +148,7 @@ impl BackendPanel { #[cfg(target_arch = "wasm32")] ui.collapsing("Web info (location)", |ui| { + ui.style_mut().wrap = Some(false); ui.monospace(format!("{:#?}", frame.info().web_info.location)); }); diff --git a/crates/egui_demo_app/src/web.rs b/crates/egui_demo_app/src/web.rs index 231aaf30adc..2186bf12209 100644 --- a/crates/egui_demo_app/src/web.rs +++ b/crates/egui_demo_app/src/web.rs @@ -1,7 +1,4 @@ -use eframe::{ - wasm_bindgen::{self, prelude::*}, - web::WebRunner, -}; +use eframe::wasm_bindgen::{self, prelude::*}; use crate::WrapApp; @@ -9,7 +6,7 @@ use crate::WrapApp; #[derive(Clone)] #[wasm_bindgen] pub struct WebHandle { - runner: WebRunner, + runner: eframe::WebRunner, } #[wasm_bindgen] @@ -19,10 +16,10 @@ impl WebHandle { #[wasm_bindgen(constructor)] pub fn new() -> Self { // Redirect [`log`] message to `console.log` and friends: - eframe::web::WebLogger::init(log::LevelFilter::Debug).ok(); + eframe::WebLogger::init(log::LevelFilter::Debug).ok(); Self { - runner: WebRunner::new(), + runner: eframe::WebRunner::new(), } } diff --git a/examples/hello_world_simple/src/main.rs b/examples/hello_world_simple/src/main.rs index e30818189b3..bc815738b22 100644 --- a/examples/hello_world_simple/src/main.rs +++ b/examples/hello_world_simple/src/main.rs @@ -26,7 +26,7 @@ fn main() -> Result<(), eframe::Error> { if ui.button("Click each year").clicked() { age += 1; } - ui.label(format!("Hello '{}', age {}", name, age)); + ui.label(format!("Hello '{name}', age {age}")); }); }) }