diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 906e409f..bdfe2d65 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,7 +2,7 @@ name: Feature request about: Suggest an idea for this project title: '' -labels: enhancement +labels: feature-request assignees: '' --- diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 2c1f4a1e..96db0602 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -17,7 +17,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.54.0 + toolchain: 1.56.0 override: true - run: sudo apt-get update && sudo apt-get install libspeechd-dev - uses: actions-rs/cargo@v1 @@ -32,7 +32,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.54.0 + toolchain: 1.56.0 override: true - run: sudo apt-get update && sudo apt-get install libspeechd-dev - uses: actions-rs/cargo@v1 @@ -48,7 +48,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.54.0 + toolchain: 1.56.0 override: true - run: rustup target add wasm32-unknown-unknown - uses: actions-rs/cargo@v1 @@ -64,7 +64,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.54.0 + toolchain: 1.56.0 override: true - run: rustup target add wasm32-unknown-unknown - uses: actions-rs/cargo@v1 @@ -80,7 +80,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.54.0 + toolchain: 1.56.0 override: true - run: sudo apt-get update && sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev libgtk-3-dev # libgtk-3-dev is used by rfd - uses: actions-rs/cargo@v1 @@ -96,7 +96,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.54.0 + toolchain: 1.56.0 override: true - run: rustup component add rustfmt - uses: actions-rs/cargo@v1 @@ -112,7 +112,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.54.0 + toolchain: 1.56.0 override: true - run: rustup component add clippy - run: sudo apt-get update && sudo apt-get install libspeechd-dev libgtk-3-dev # libgtk-3-dev is used by rfd @@ -129,7 +129,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.54.0 + toolchain: 1.56.0 override: true - run: sudo apt-get update && sudo apt-get install libspeechd-dev - run: cargo doc -p emath -p epaint -p egui -p eframe -p epi -p egui_web -p egui-winit -p egui_glium -p egui_glow --lib --no-deps --all-features @@ -142,7 +142,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.54.0 + toolchain: 1.56.0 override: true - run: sudo apt-get update && sudo apt-get install libspeechd-dev - run: rustup target add wasm32-unknown-unknown diff --git a/CHANGELOG.md b/CHANGELOG.md index fb2e98a6..ab5175d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,28 +8,47 @@ NOTE: [`epaint`](epaint/CHANGELOG.md), [`eframe`](eframe/CHANGELOG.md), [`egui_w ## Unreleased ### Added ⭐ -* Add context menus: See `Ui::menu_button` and `Response::context_menu` ([#543](https://github.com/emilk/egui/pull/543)). +* Added `Ui::add_visible` and `Ui::add_visible_ui`. + +### Changed 🔧 +* Renamed `Ui::visible` to `Ui::is_visible`. + + +## 0.16.1 - 2021-12-31 - Add back `CtxRef::begin_frame,end_frame` + +### Added ⭐ +* Add back `CtxRef::begin_frame,end_frame` as an alternative to `CtxRef::run`. + + +## 0.16.0 - 2021-12-29 - Context menus and rich text + +### Added ⭐ +* Added context menus: See `Ui::menu_button` and `Response::context_menu` ([#543](https://github.com/emilk/egui/pull/543)). * Most widgets containing text (`Label`, `Button` etc) now supports rich text ([#855](https://github.com/emilk/egui/pull/855)). * Plots: - * Add bar charts and box plots ([#863](https://github.com/emilk/egui/pull/863)). + * Added bar charts and box plots ([#863](https://github.com/emilk/egui/pull/863)). * You can now query information about the plot (e.g. get the mouse position in plot coordinates, or the plot bounds) while adding items. `Plot` ([#766](https://github.com/emilk/egui/pull/766) and [#892](https://github.com/emilk/egui/pull/892)). * You can now read and write the cursor of a `TextEdit` ([#848](https://github.com/emilk/egui/pull/848)). * When using a custom font you can now specify a font index ([#873](https://github.com/emilk/egui/pull/873)). -* Add vertical sliders with `Slider::new(…).vertical()` ([#875](https://github.com/emilk/egui/pull/875)). -* Add `Button::image_and_text` ([#832](https://github.com/emilk/egui/pull/832)). +* Added vertical sliders with `Slider::new(…).vertical()` ([#875](https://github.com/emilk/egui/pull/875)). +* Added `Button::image_and_text` ([#832](https://github.com/emilk/egui/pull/832)). +* Added `CollapsingHeader::open` to control if it is open or collapsed ([#1006](https://github.com/emilk/egui/pull/1006)). +* Added `egui::widgets::color_picker::color_picker_color32` to show the color picker. ### Changed 🔧 +* MSRV (Minimum Supported Rust Version) is now `1.56.0`. * `ui.add(Button::new("…").text_color(…))` is now `ui.button(RichText::new("…").color(…))` (same for `Label` )([#855](https://github.com/emilk/egui/pull/855)). * Plots now provide a `show` method that has to be used to add items to and show the plot ([#766](https://github.com/emilk/egui/pull/766)). -* Replace `CtxRef::begin_frame` and `end_frame` with `CtxRef::run` ([#872](https://github.com/emilk/egui/pull/872)). -* Replace `scroll_delta` and `zoom_delta` in `RawInput` with `Event::Scroll` and `Event::Zoom`. -* Unifiy the four `Memory` data buckets (`data`, `data_temp`, `id_data` and `id_data_temp`) into a single `Memory::data`, with a new interface ([#836](https://github.com/emilk/egui/pull/836)). -* Replace `Ui::__test` with `egui::__run_test_ui` ([#872](https://github.com/emilk/egui/pull/872)). +* `menu::menu(ui, ...)` is now `ui.menu_button(...)` ([#543](https://github.com/emilk/egui/pull/543)) +* Replaced `CtxRef::begin_frame` and `end_frame` with `CtxRef::run` ([#872](https://github.com/emilk/egui/pull/872)). +* Replaced `scroll_delta` and `zoom_delta` in `RawInput` with `Event::Scroll` and `Event::Zoom`. +* Unified the four `Memory` data buckets (`data`, `data_temp`, `id_data` and `id_data_temp`) into a single `Memory::data`, with a new interface ([#836](https://github.com/emilk/egui/pull/836)). +* Replaced `Ui::__test` with `egui::__run_test_ui` ([#872](https://github.com/emilk/egui/pull/872)). ### Fixed 🐛 -* Fix `ComboBox` and other popups getting clipped to parent window ([#885](https://github.com/emilk/egui/pull/885)). +* Fixed `ComboBox` and other popups getting clipped to parent window ([#885](https://github.com/emilk/egui/pull/885)). * The color picker is now better att keeping the same hue even when saturation goes to zero ([#886](https://github.com/emilk/egui/pull/886)). ### Removed 🔥 @@ -37,16 +56,19 @@ NOTE: [`epaint`](epaint/CHANGELOG.md), [`eframe`](eframe/CHANGELOG.md), [`egui_w * Removed `egui::paint` (use `egui::epaint` instead). ### Contributors 🙏 -* [5225225](https://github.com/5225225): ([#849](https://github.com/emilk/egui/pull/849)). -* [B-Reif](https://github.com/B-Reif) ([#875](https://github.com/emilk/egui/pull/875)). -* [Bromeon](https://github.com/Bromeon): ([#863](https://github.com/emilk/egui/pull/863)). -* [d10sfan](https://github.com/d10sfan) ([#832](https://github.com/emilk/egui/pull/832)). -* [EmbersArc](https://github.com/EmbersArc): ([#766](https://github.com/emilk/egui/pull/766), [#892](https://github.com/emilk/egui/pull/892)). -* [Hperigo](https://github.com/Hperigo): ([#905](https://github.com/emilk/egui/pull/905)). -* [mankinskin](https://github.com/mankinskin) ([#543](https://github.com/emilk/egui/pull/543)). -* [niladic](https://github.com/niladic): ([#499](https://github.com/emilk/egui/pull/499), [#863](https://github.com/emilk/egui/pull/863)). -* [sumibi-yakitori](https://github.com/sumibi-yakitori) ([#830](https://github.com/emilk/egui/pull/830)). -* [t18b219k](https://github.com/t18b219k): ([#868](https://github.com/emilk/egui/pull/868), [#888](https://github.com/emilk/egui/pull/888)). +* [5225225](https://github.com/5225225): [#849](https://github.com/emilk/egui/pull/849). +* [aevyrie](https://github.com/aevyrie): [#966](https://github.com/emilk/egui/pull/966). +* [B-Reif](https://github.com/B-Reif): [#875](https://github.com/emilk/egui/pull/875). +* [Bromeon](https://github.com/Bromeon): [#863](https://github.com/emilk/egui/pull/863), [#918](https://github.com/emilk/egui/pull/918). +* [d10sfan](https://github.com/d10sfan): [#832](https://github.com/emilk/egui/pull/832). +* [EmbersArc](https://github.com/EmbersArc): [#766](https://github.com/emilk/egui/pull/766), [#892](https://github.com/emilk/egui/pull/892). +* [Hperigo](https://github.com/Hperigo): [#905](https://github.com/emilk/egui/pull/905). +* [isegal](https://github.com/isegal): [#934](https://github.com/emilk/egui/pull/934). +* [mankinskin](https://github.com/mankinskin): [#543](https://github.com/emilk/egui/pull/543). +* [niladic](https://github.com/niladic): [#499](https://github.com/emilk/egui/pull/499), [#863](https://github.com/emilk/egui/pull/863). +* [singalen](https://github.com/singalen): [#973](https://github.com/emilk/egui/pull/973). +* [sumibi-yakitori](https://github.com/sumibi-yakitori): [#830](https://github.com/emilk/egui/pull/830), [#870](https://github.com/emilk/egui/pull/870). +* [t18b219k](https://github.com/t18b219k): [#868](https://github.com/emilk/egui/pull/868), [#888](https://github.com/emilk/egui/pull/888). ## 0.15.0 - 2021-10-24 - Syntax highlighting and hscroll diff --git a/Cargo.lock b/Cargo.lock index bf052252..21e50dee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,25 +4,25 @@ version = 3 [[package]] name = "ab_glyph" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af0ac006645f86f20f6c6fa4dcaef920bf803df819123626f9440e35835e7d80" +checksum = "20b228f2c198f98d4337ceb560333fb12cbb2f4948a953bf8c57d09deb219603" dependencies = [ "ab_glyph_rasterizer", - "owned_ttf_parser 0.12.1", + "owned_ttf_parser", ] [[package]] name = "ab_glyph_rasterizer" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9fe5e32de01730eb1f6b7f5b51c17e03e2325bf40a74f754f04f130043affff" +checksum = "a13739d7177fbd22bb0ed28badfff9f372f8bef46c863db4e1c6248f6b223b6e" [[package]] name = "addr2line" -version = "0.15.2" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" dependencies = [ "gimli", ] @@ -53,26 +53,13 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.15" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" dependencies = [ "memchr", ] -[[package]] -name = "andrew" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4afb09dd642feec8408e33f92f3ffc4052946f6b20f32fb99c1f58cd4fa7cf" -dependencies = [ - "bitflags", - "rusttype", - "walkdir", - "xdg", - "xml-rs", -] - [[package]] name = "android_glue" version = "0.2.3" @@ -81,18 +68,18 @@ checksum = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" [[package]] name = "ansi_term" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ "winapi", ] [[package]] name = "anyhow" -version = "1.0.44" +version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1" +checksum = "84450d0b4a8bd1ba4144ce8ce718fbc5d071358b1e5384bace6536b3d1f2d5b3" [[package]] name = "atk-sys" @@ -131,9 +118,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.59" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4717cfcbfaa661a0fd48f8453951837ae7e8f81e481fbb136e3202d72805a744" +checksum = "321629d8ba6513061f26707241fa9bc89524ff1cd7a915a97ef0c62c666ce1b6" dependencies = [ "addr2line", "cc", @@ -161,9 +148,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.59.1" +version = "0.59.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453c49e5950bb0eb63bb3df640e31618846c89d5b7faa54040d76e98e0134375" +checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" dependencies = [ "bitflags", "cexpr", @@ -203,18 +190,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "bitvec" -version = "0.19.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8942c8d352ae1838c9dda0b0ca2ab657696ef2232a20147cf1b30ae1a9cb4321" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - [[package]] name = "block" version = "0.1.6" @@ -223,9 +198,9 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "bstr" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" dependencies = [ "lazy_static", "memchr", @@ -241,9 +216,9 @@ checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" [[package]] name = "bytemuck" -version = "1.7.2" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72957246c41db82b8ef88a5486143830adeb8227ef9837740bdec67724cf2c5b" +checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f" dependencies = [ "bytemuck_derive", ] @@ -283,12 +258,12 @@ dependencies = [ [[package]] name = "calloop" -version = "0.6.5" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b036167e76041694579972c28cf4877b4f92da222560ddb49008937b6a6727c" +checksum = "bf2eec61efe56aa1e813f5126959296933cf0700030e4314786c48779a66ab82" dependencies = [ "log", - "nix 0.18.0", + "nix", ] [[package]] @@ -302,9 +277,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.71" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" +checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" [[package]] name = "cesu8" @@ -314,11 +289,11 @@ checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" [[package]] name = "cexpr" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db507a7679252d2276ed0dd8113c6875ec56d3089f9225b2b42c30cc1f8e5c89" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ - "nom 6.2.1", + "nom", ] [[package]] @@ -361,7 +336,7 @@ dependencies = [ "libc", "num-integer", "num-traits", - "time", + "time 0.1.43", "wasm-bindgen", "winapi", ] @@ -380,20 +355,20 @@ checksum = "5d83feae28854d73f33659f9018546157422ddf5b84264ce171a766d8547d77b" [[package]] name = "clang-sys" -version = "1.2.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10612c0ec0e0a1ff0e97980647cb058a6e7aedb913d01d009c406b8b7d0b26ee" +checksum = "fa66045b9cb23c2e9c1520732030608b02ee07e5cfaa5a521ec15ded7fa24c90" dependencies = [ "glob", "libc", - "libloading 0.7.1", + "libloading", ] [[package]] name = "clap" -version = "2.33.3" +version = "2.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ "ansi_term", "atty", @@ -424,7 +399,7 @@ dependencies = [ "block", "cocoa-foundation", "core-foundation 0.9.2", - "core-graphics 0.22.2", + "core-graphics 0.22.3", "foreign-types", "libc", "objc", @@ -453,20 +428,14 @@ checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] name = "combine" -version = "4.6.1" +version = "4.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a909e4d93292cd8e9c42e189f61681eff9d67b6541f96b8a1a737f23737bd001" +checksum = "b2b2f5d0ee456f3928812dfc8c6d9a1d592b98678f6d56db9b0cd2b7bc6c8db5" dependencies = [ "bytes", "memchr", ] -[[package]] -name = "const-sha1" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb58b6451e8c2a812ad979ed1d83378caa5e927eef2622017a45f251457c2c9d" - [[package]] name = "copypasta" version = "0.7.1" @@ -527,9 +496,9 @@ dependencies = [ [[package]] name = "core-graphics" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "269f35f69b542b80e736a20a89a05215c0ce80c2c03c514abb2e318b78379d86" +checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" dependencies = [ "bitflags", "core-foundation 0.9.2", @@ -565,9 +534,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +checksum = "738c290dfaea84fc1ca15ad9c168d083b05a714e1efddd8edaab678dc28d2836" dependencies = [ "cfg-if 1.0.0", ] @@ -608,20 +577,6 @@ dependencies = [ "itertools", ] -[[package]] -name = "crossbeam" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae5588f6b3c3cb05239e90bd110f257254aecd01e4635400391aeae07497845" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-epoch", - "crossbeam-queue", - "crossbeam-utils", -] - [[package]] name = "crossbeam-channel" version = "0.5.1" @@ -656,16 +611,6 @@ dependencies = [ "scopeguard", ] -[[package]] -name = "crossbeam-queue" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b10ddc024425c88c2ad148c1b0fd53f4c6d38db9697c9f1588381212fa657c9" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", -] - [[package]] name = "crossbeam-utils" version = "0.8.5" @@ -684,7 +629,7 @@ checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" dependencies = [ "bstr", "csv-core", - "itoa", + "itoa 0.4.8", "ryu", "serde", ] @@ -699,10 +644,16 @@ dependencies = [ ] [[package]] -name = "darling" -version = "0.10.2" +name = "cty" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + +[[package]] +name = "darling" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0d720b8683f8dd83c65155f0530560cba68cd2bf395f6513a483caee57ff7f4" dependencies = [ "darling_core", "darling_macro", @@ -710,23 +661,23 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.10.2" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +checksum = "7a340f241d2ceed1deb47ae36c4144b2707ec7dd0b649f894cb39bb595986324" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.9.3", + "strsim 0.10.0", "syn", ] [[package]] name = "darling_macro" -version = "0.10.2" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +checksum = "72c41b3b7352feb3211a0d743dc5700a4e3b60f51bd2b368892d1e0f9a95f44b" dependencies = [ "darling_core", "quote", @@ -764,26 +715,6 @@ dependencies = [ "dirs-sys-next", ] -[[package]] -name = "dirs" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -801,22 +732,13 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" -[[package]] -name = "dlib" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" -dependencies = [ - "libloading 0.6.7", -] - [[package]] name = "dlib" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" dependencies = [ - "libloading 0.7.1", + "libloading", ] [[package]] @@ -854,7 +776,7 @@ checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" [[package]] name = "eframe" -version = "0.15.0" +version = "0.16.0" dependencies = [ "egui", "egui-winit", @@ -868,7 +790,7 @@ dependencies = [ [[package]] name = "egui" -version = "0.15.0" +version = "0.16.1" dependencies = [ "ahash", "epaint", @@ -879,11 +801,12 @@ dependencies = [ [[package]] name = "egui-winit" -version = "0.15.0" +version = "0.16.0" dependencies = [ "copypasta", "egui", "epi", + "instant", "serde", "tts", "webbrowser", @@ -892,7 +815,7 @@ dependencies = [ [[package]] name = "egui_datepicker" -version = "0.15.0" +version = "0.16.0" dependencies = [ "chrono", "egui", @@ -902,7 +825,7 @@ dependencies = [ [[package]] name = "egui_demo_app" -version = "0.15.0" +version = "0.16.0" dependencies = [ "eframe", "egui_demo_lib", @@ -910,7 +833,7 @@ dependencies = [ [[package]] name = "egui_demo_lib" -version = "0.15.0" +version = "0.16.0" dependencies = [ "chrono", "criterion", @@ -928,14 +851,14 @@ dependencies = [ [[package]] name = "egui_dynamic_grid" -version = "0.15.0" +version = "0.16.0" dependencies = [ "egui", ] [[package]] name = "egui_glium" -version = "0.15.0" +version = "0.16.0" dependencies = [ "egui", "egui-winit", @@ -946,7 +869,7 @@ dependencies = [ [[package]] name = "egui_glow" -version = "0.15.0" +version = "0.16.0" dependencies = [ "egui", "egui-winit", @@ -961,7 +884,7 @@ dependencies = [ [[package]] name = "egui_web" -version = "0.15.0" +version = "0.16.0" dependencies = [ "egui", "egui_glow", @@ -996,7 +919,7 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "emath" -version = "0.15.0" +version = "0.16.0" dependencies = [ "bytemuck", "mint", @@ -1026,9 +949,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.8.4" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" +checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" dependencies = [ "atty", "humantime", @@ -1039,7 +962,7 @@ dependencies = [ [[package]] name = "epaint" -version = "0.15.0" +version = "0.16.0" dependencies = [ "ab_glyph", "ahash", @@ -1054,7 +977,7 @@ dependencies = [ [[package]] name = "epi" -version = "0.15.0" +version = "0.16.0" dependencies = [ "directories-next", "egui", @@ -1115,12 +1038,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "funty" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" - [[package]] name = "gcc" version = "0.3.55" @@ -1170,9 +1087,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.24.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" +checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" [[package]] name = "gio-sys" @@ -1210,9 +1127,9 @@ dependencies = [ [[package]] name = "glium" -version = "0.30.2" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "506a2aa1564891d447ae5d1ba37519a8efd6d01ea3e7952da81aa30430c90007" +checksum = "0ab4f09b43d8ee427a700cb9ed3b20e0e858d62a509edded1a98ca5707d68e19" dependencies = [ "backtrace", "fnv", @@ -1232,9 +1149,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "glow" -version = "0.11.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f04649123493bc2483cbef4daddb45d40bbdae5adb221a63a23efdb0cc99520" +checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919" dependencies = [ "js-sys", "slotmap", @@ -1244,9 +1161,9 @@ dependencies = [ [[package]] name = "glutin" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "762d6cd2e1b855d99668ebe591cc9058659d85ac39a9a2078000eb122ddba8f0" +checksum = "00ea9dbe544bc8a657c4c4a798c2d16cd01b549820e47657297549d28371f6d2" dependencies = [ "android_glue", "cgl", @@ -1258,7 +1175,7 @@ dependencies = [ "glutin_glx_sys", "glutin_wgl_sys", "lazy_static", - "libloading 0.7.1", + "libloading", "log", "objc", "osmesa-sys", @@ -1429,13 +1346,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", ] [[package]] name = "itertools" -version = "0.10.1" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" dependencies = [ "either", ] @@ -1446,6 +1366,12 @@ version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" +[[package]] +name = "itoa" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" + [[package]] name = "jni" version = "0.19.0" @@ -1507,25 +1433,15 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.104" +version = "0.2.112" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2f96d100e1cf1929e7719b7edb3b90ab5298072638fccd77be9ce942ecdfce" +checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" [[package]] name = "libloading" -version = "0.6.7" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" -dependencies = [ - "cfg-if 1.0.0", - "winapi", -] - -[[package]] -name = "libloading" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0cf036d15402bea3c5d4de17b3fce76b3e4a56ebc1f577be0e7a72f7c607cf0" +checksum = "afe203d669ec979b7128619bae5a63b7b42e9203c1b29146079ee05e2f604b52" dependencies = [ "cfg-if 1.0.0", "winapi", @@ -1581,42 +1497,33 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "memchr" -version = "2.3.4" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "memmap2" -version = "0.1.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a" -dependencies = [ - "libc", -] - -[[package]] -name = "memmap2" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723e3ebdcdc5c023db1df315364573789f8857c11b631a2fdfad7c00f5c046b4" +checksum = "00b6c2ebff6180198788f5db08d7ce3bc1d0b617176678831a7510825973e357" dependencies = [ "libc", ] [[package]] name = "memoffset" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" dependencies = [ "autocfg", ] [[package]] name = "minimal-lexical" -version = "0.1.4" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c64630dcdd71f1a64c435f54885086a0de5d6a12d104d69b165fb7d5286d677" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" @@ -1645,9 +1552,9 @@ checksum = "162e591484b4b8fe9e1ca16ebf07ab584fdc3334508d76a788cd54d89cfc20dc" [[package]] name = "mio" -version = "0.7.14" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +checksum = "ba272f85fa0b41fc91872be579b3bbe0f56b792aa361a380eb669469f68dafb2" dependencies = [ "libc", "log", @@ -1656,18 +1563,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "mio-misc" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ddf05411bb159cdb5801bb10002afb66cb4572be656044315e363460ce69dc2" -dependencies = [ - "crossbeam", - "crossbeam-queue", - "log", - "mio", -] - [[package]] name = "miow" version = "0.3.7" @@ -1679,10 +1574,11 @@ dependencies = [ [[package]] name = "ndk" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8794322172319b972f528bf90c6b467be0079f1fa82780ffb431088e741a73ab" +checksum = "96d868f654c72e75f8687572699cdabe755f03effbb62542768e995d5b8d699d" dependencies = [ + "bitflags", "jni-sys", "ndk-sys", "num_enum", @@ -1691,9 +1587,9 @@ dependencies = [ [[package]] name = "ndk-glue" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5caf0c24d51ac1c905c27d4eda4fa0635bbe0de596b8f79235e0b17a4d29385" +checksum = "fc291b8de2095cba8dab7cf381bf582ff4c17a09acf854c32e46545b08085d28" dependencies = [ "lazy_static", "libc", @@ -1705,12 +1601,12 @@ dependencies = [ [[package]] name = "ndk-macro" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" +checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" dependencies = [ "darling", - "proc-macro-crate 0.1.5", + "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -1718,32 +1614,21 @@ dependencies = [ [[package]] name = "ndk-sys" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c44922cb3dbb1c70b5e5f443d63b64363a898564d739ba5198e3a9138442868d" +checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" [[package]] name = "nix" -version = "0.18.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" -dependencies = [ - "bitflags", - "cc", - "cfg-if 0.1.10", - "libc", -] - -[[package]] -name = "nix" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a" +checksum = "cf1e25ee6b412c2a1e3fcb6a4499a5c1bfe7f43e014bdce9a6b6666e5aa2d187" dependencies = [ "bitflags", "cc", "cfg-if 1.0.0", "libc", + "memoffset", ] [[package]] @@ -1754,21 +1639,9 @@ checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" [[package]] name = "nom" -version = "6.2.1" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c5c51b9083a3c620fa67a2a635d1ce7d95b897e957d6b28ff9a5da960a103a6" -dependencies = [ - "bitvec", - "funty", - "memchr", - "version_check", -] - -[[package]] -name = "nom" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffd9d26838a953b4af82cbeb9f1592c6798916983959be223a7124e992742c1" +checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109" dependencies = [ "memchr", "minimal-lexical", @@ -1827,9 +1700,9 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ "hermit-abi", "libc", @@ -1837,9 +1710,9 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9bd055fb730c4f8f4f57d45d35cd6b3f0980535b056dc7ff119cee6a66ed6f" +checksum = "085fe377a4b2805c0fbc09484415ec261174614b7f080b0e0d520456ac421a67" dependencies = [ "derivative", "num_enum_derive", @@ -1847,11 +1720,11 @@ dependencies = [ [[package]] name = "num_enum_derive" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486ea01961c4a818096de679a8b740b26d9033146ac5291b1c98557658f8cdd9" +checksum = "5249369707a1e07b39f78d98c8f34e00aca7dcb053812fdbb5ad7be82c1bba38" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -1898,15 +1771,18 @@ dependencies = [ [[package]] name = "object" -version = "0.24.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5b3dd1c072ee7963717671d1ca129f1048fda25edea6b752bfc71ac8854170" +checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" +dependencies = [ + "memchr", +] [[package]] name = "once_cell" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" [[package]] name = "oorandom" @@ -1925,20 +1801,11 @@ dependencies = [ [[package]] name = "owned_ttf_parser" -version = "0.6.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f923fb806c46266c02ab4a5b239735c144bdeda724a50ed058e5226f594cde3" +checksum = "65ee3f72636e6f164cc41c9f9057f4e58c4e13507699ea7f5e5242b64b8198ee" dependencies = [ - "ttf-parser 0.6.2", -] - -[[package]] -name = "owned_ttf_parser" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60ac8dda2e5cc09bf6480e3b3feff9783db251710c922ae9369a429c51efdeb0" -dependencies = [ - "ttf-parser 0.12.3", + "ttf-parser", ] [[package]] @@ -1992,21 +1859,21 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "pkg-config" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10e2fcbb64ecbe64c8e040a386c3104d384583af58b956d870aaaf229df6e66d" +checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" [[package]] name = "plist" -version = "1.2.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38d026d73eeaf2ade76309d0c65db5a35ecf649e3cec428db316243ea9d6711" +checksum = "bd39bc6cdc9355ad1dc5eeedefee696bb35c34caf21768741e81826c0bbd7225" dependencies = [ "base64", - "chrono", "indexmap", "line-wrap", "serde", + "time 0.3.5", "xml-rs", ] @@ -2050,15 +1917,6 @@ dependencies = [ "miniz_oxide 0.3.7", ] -[[package]] -name = "proc-macro-crate" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" -dependencies = [ - "toml", -] - [[package]] name = "proc-macro-crate" version = "1.1.0" @@ -2071,35 +1929,38 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.30" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc3358ebc67bc8b7fa0c007f945b0b18226f78437d61bec735a9eb96b61ee70" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" dependencies = [ "unicode-xid", ] [[package]] -name = "quote" -version = "1.0.10" +name = "quick-xml" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" +checksum = "8533f14c8382aaad0d592c812ac3b826162128b65662331e1127b45c3d18536b" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47aa80447ce4daf1717500037052af176af5d38cc3e571d9ec1c7353fc10c87d" dependencies = [ "proc-macro2", ] -[[package]] -name = "radium" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "941ba9d78d8e2f7ce474c015eea4d9c6d25b6a3327f9832ee29a4de27f91bbb8" - [[package]] name = "raw-window-handle" -version = "0.3.3" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" +checksum = "fba75eee94a9d5273a68c9e1e105d9cffe1ef700532325788389e5a83e2522b7" dependencies = [ - "libc", + "cty", ] [[package]] @@ -2148,9 +2009,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.4.6" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a26af418b574bd56588335b3a3659a65725d4e636eb1016c2f9e3b38c7cc759" +checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" dependencies = [ "aho-corasick", "memchr", @@ -2171,9 +2032,9 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "rfd" -version = "0.5.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acac5884e3a23b02ebd6ce50fd2729732cdbdb16ea944fbbfbfa638a67992aa" +checksum = "6b0c25b610bf37d9874ff224ab2791ff2272bedeb5638a2dca8b18e1270ed69b" dependencies = [ "block", "dispatch", @@ -2189,7 +2050,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winapi", + "windows", ] [[package]] @@ -2241,9 +2102,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b5ac6078ca424dc1d3ae2328526a76787fecc7f8011f520e3276730e711fc95" +checksum = "d37e5e2290f3e040b594b1a9e04377c2c671f1a1cfd9bfdef82106ac1c113f84" dependencies = [ "log", "ring", @@ -2251,21 +2112,11 @@ dependencies = [ "webpki", ] -[[package]] -name = "rusttype" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc7c727aded0be18c5b80c1640eae0ac8e396abf6fa8477d96cb37d18ee5ec59" -dependencies = [ - "ab_glyph_rasterizer", - "owned_ttf_parser 0.6.0", -] - [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" [[package]] name = "safemem" @@ -2312,9 +2163,9 @@ checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" [[package]] name = "serde" -version = "1.0.130" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" +checksum = "8b9875c23cf305cd1fd7eb77234cbb705f21ea6a72c637a5c6db5fe4b8e7f008" dependencies = [ "serde_derive", ] @@ -2331,9 +2182,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.130" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" +checksum = "ecc0db5cb2556c0e558887d9bbdcf6ac4471e83ff66cf696e5419024d1606276" dependencies = [ "proc-macro2", "quote", @@ -2342,11 +2193,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.68" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" +checksum = "bcbd0344bc6533bc7ec56df11d42fb70f1b912351c0825ccb7211b59d8af7cf5" dependencies = [ - "itoa", + "itoa 1.0.1", "ryu", "serde", ] @@ -2384,35 +2235,18 @@ checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" [[package]] name = "smithay-client-toolkit" -version = "0.12.3" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4750c76fd5d3ac95fa3ed80fe667d6a3d8590a960e5b575b98eea93339a80b80" +checksum = "1325f292209cee78d5035530932422a30aa4c8fda1a16593ac083c1de211e68a" dependencies = [ - "andrew", "bitflags", "calloop", - "dlib 0.4.2", + "dlib", "lazy_static", "log", - "memmap2 0.1.0", - "nix 0.18.0", - "wayland-client", - "wayland-cursor", - "wayland-protocols", -] - -[[package]] -name = "smithay-client-toolkit" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec783683499a2cfc85b6df3d04f83b1907b5cbd98a1aed44667dbdf1eac4e64c" -dependencies = [ - "bitflags", - "dlib 0.5.0", - "lazy_static", - "log", - "memmap2 0.2.3", - "nix 0.20.0", + "memmap2", + "nix", + "pkg-config", "wayland-client", "wayland-cursor", "wayland-protocols", @@ -2420,19 +2254,19 @@ dependencies = [ [[package]] name = "smithay-clipboard" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "986c5b4a7bd4f50d4c51f81f844745535cb488360f9cf63293780b109b9295f3" +checksum = "610b551bd25378bfd2b8e7a0fcbd83d427e8f2f6a40c47ae0f70688e9949dd55" dependencies = [ - "smithay-client-toolkit 0.14.0", + "smithay-client-toolkit", "wayland-client", ] [[package]] name = "speech-dispatcher" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076efad2c03a1c5cc41eaa82c30770130e014f6544769edea79e096a2f134412" +checksum = "9b684552615661fef2658506637989f8a8ead697c83c9a35a12d2a11bbd96955" dependencies = [ "lazy_static", "speech-dispatcher-sys", @@ -2462,9 +2296,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "strsim" -version = "0.9.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strum" @@ -2486,9 +2320,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.80" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194" +checksum = "ecb2e6da8ee5eb9a61068762a32fa9619cc591ceb055b3687f4cd4051ec2e06b" dependencies = [ "proc-macro2", "quote", @@ -2541,12 +2375,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36ae8932fcfea38b7d3883ae2ab357b0d57a02caaa18ebb4f5ece08beaec4aa0" -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - [[package]] name = "termcolor" version = "1.1.2" @@ -2595,6 +2423,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "time" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41effe7cfa8af36f439fac33861b66b049edc6f9a32331e2312660529c1c24ad" +dependencies = [ + "itoa 0.4.8", + "libc", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -2607,9 +2445,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83b2a3d4d9091d0abd7eba4dc2710b1718583bd4d8992e2190720ea38f391f7" +checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" dependencies = [ "tinyvec_macros", ] @@ -2631,21 +2469,15 @@ dependencies = [ [[package]] name = "ttf-parser" -version = "0.6.2" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" - -[[package]] -name = "ttf-parser" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ae2f58a822f08abdaf668897e96a5656fe72f5a9ce66422423e8849384872e6" +checksum = "76dacc724328b3d5e2ed67f9e30cdb56893a34ab239032502cc8f19f8dae4bbc" [[package]] name = "tts" -version = "0.17.3" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3701ee536e3a14925c181a858e087ec7a7129c437f06acd3c6d785b463f1c060" +checksum = "38dcd7e0cdd94949f55b94c24ccbb7922437883ec268dbbac23480db32287016" dependencies = [ "cocoa-foundation", "dyn-clonable", @@ -2709,12 +2541,13 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "ureq" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd912a3d096959150c4d71ac752e13f1683085922658c205b89b40fe8ebe07f" +checksum = "9399fa2f927a3d327187cbd201480cee55bee6ac5d3c77dd27f0c6814cff16d5" dependencies = [ "base64", "chunked_transfer", + "flate2", "log", "once_cell", "rustls", @@ -2749,9 +2582,9 @@ checksum = "1c18c859eead79d8b95d09e4678566e8d70105c4e7b251f707a03df32442661b" [[package]] name = "version_check" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" @@ -2838,14 +2671,14 @@ checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" [[package]] name = "wayland-client" -version = "0.28.6" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ab332350e502f159382201394a78e3cc12d0f04db863429260164ea40e0355" +checksum = "9108ec1c37f4774d0c2937ba1a6c23d1786b2152c4a13bd9fdb20e42d16e8841" dependencies = [ "bitflags", "downcast-rs", "libc", - "nix 0.20.0", + "nix", "scoped-tls", "wayland-commons", "wayland-scanner", @@ -2854,11 +2687,11 @@ dependencies = [ [[package]] name = "wayland-commons" -version = "0.28.6" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21817947c7011bbd0a27e11b17b337bfd022e8544b071a2641232047966fbda" +checksum = "265ef51b3b3e5c9ef098f10425c39624663f459c3821dcaacc4748be975f1beb" dependencies = [ - "nix 0.20.0", + "nix", "once_cell", "smallvec", "wayland-sys", @@ -2866,20 +2699,20 @@ dependencies = [ [[package]] name = "wayland-cursor" -version = "0.28.6" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be610084edd1586d45e7bdd275fe345c7c1873598caa464c4fb835dee70fa65a" +checksum = "6c19bb6628daf4097e58b7911481e8371e13318d5a60894779901bd3267407a7" dependencies = [ - "nix 0.20.0", + "nix", "wayland-client", "xcursor", ] [[package]] name = "wayland-egl" -version = "0.28.6" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99ba1ab1e18756b23982d36f08856d521d7df45015f404a2d7c4f0b2d2f66956" +checksum = "accf27d1e5e1f64ba30b683fd926c2c916cc1014bea3376fb258e80abf622e40" dependencies = [ "wayland-client", "wayland-sys", @@ -2887,9 +2720,9 @@ dependencies = [ [[package]] name = "wayland-protocols" -version = "0.28.6" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "286620ea4d803bacf61fa087a4242ee316693099ee5a140796aaba02b29f861f" +checksum = "7b3b6f1dc0193072ef4eadcb144da30d58c1f2895516c063804d213310703c8e" dependencies = [ "bitflags", "wayland-client", @@ -2899,9 +2732,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.28.6" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce923eb2deb61de332d1f356ec7b6bf37094dc5573952e1c8936db03b54c03f1" +checksum = "eaaf2bc85e7b9143159af96bd23d954a5abe391c4376db712320643280fdc6f4" dependencies = [ "proc-macro2", "quote", @@ -2910,11 +2743,11 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.28.6" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d841fca9aed7febf9bed2e9796c49bf58d4152ceda8ac949ebe00868d8f0feb8" +checksum = "ba9e06acb775b3007f8d3094438306979e572d1d3b844d7a71557a84b055d959" dependencies = [ - "dlib 0.5.0", + "dlib", "lazy_static", "pkg-config", ] @@ -2961,10 +2794,12 @@ dependencies = [ [[package]] name = "which" -version = "3.1.1" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724" +checksum = "ea187a8ef279bc014ec368c27a920da2024d2a711109bfbe3440585d5cf27ad9" dependencies = [ + "either", + "lazy_static", "libc", ] @@ -3007,44 +2842,58 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.9.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "361f3533a83ee1a28c9be59683f40043db02dbedf6479ce8795657386195c97f" +checksum = "aac7fef12f4b59cd0a29339406cc9203ab44e440ddff6b3f5a41455349fa9cf3" dependencies = [ - "const-sha1", - "windows_gen", - "windows_macros", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", ] [[package]] -name = "windows_gen" -version = "0.9.1" +name = "windows_aarch64_msvc" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54154dbc515d58723f6b6053c12f1065da7389f733660581b2391bd1af480452" -dependencies = [ - "syn", -] +checksum = "c3d027175d00b01e0cbeb97d6ab6ebe03b12330a35786cbaca5252b1c4bf5d9b" [[package]] -name = "windows_macros" -version = "0.9.1" +name = "windows_i686_gnu" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f7794c652845dc466cb8dc1b86c08345707c8144bc53e9086430047c7d33b76" -dependencies = [ - "syn", - "windows_gen", -] +checksum = "8793f59f7b8e8b01eda1a652b2697d87b93097198ae85f823b969ca5b89bba58" + +[[package]] +name = "windows_i686_msvc" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8602f6c418b67024be2996c512f5f995de3ba417f4c75af68401ab8756796ae4" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d615f419543e0bd7d2b3323af0d86ff19cbc4f816e6453f36a2c2ce889c354" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d95421d9ed3672c280884da53201a5c46b7b2765ca6faf34b0d71cf34a3561" [[package]] name = "winit" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79610794594d5e86be473ef7763f604f2159cbac8c94debd00df8fb41e86c2f8" +checksum = "70466a5f4825cc88c92963591b06dbc255420bffe19d847bfcda475e82d079c0" dependencies = [ "bitflags", + "block", "cocoa", "core-foundation 0.9.2", - "core-graphics 0.22.2", + "core-graphics 0.22.3", "core-video-sys", "dispatch", "instant", @@ -3052,7 +2901,6 @@ dependencies = [ "libc", "log", "mio", - "mio-misc", "ndk", "ndk-glue", "ndk-sys", @@ -3060,24 +2908,20 @@ dependencies = [ "parking_lot", "percent-encoding", "raw-window-handle", - "scopeguard", - "smithay-client-toolkit 0.12.3", + "smithay-client-toolkit", + "wasm-bindgen", "wayland-client", + "wayland-protocols", + "web-sys", "winapi", "x11-dl", ] -[[package]] -name = "wyz" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" - [[package]] name = "x11-clipboard" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b397ace6e980510de59a4fe3d4c758dffab231d6d747ce9fa1aba6b6035d5f32" +checksum = "473068b7b80ac86a18328824f1054e5e007898c47b5bbc281bd7abe32bc3653c" dependencies = [ "xcb", ] @@ -3095,12 +2939,13 @@ dependencies = [ [[package]] name = "xcb" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62056f63138b39116f82a540c983cc11f1c90cd70b3d492a70c25eaa50bd22a6" +checksum = "771e2b996df720cd1c6dd9ff90f62d91698fd3610cc078388d0564bdd6622a9c" dependencies = [ "libc", "log", + "quick-xml", ] [[package]] @@ -3109,16 +2954,7 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7" dependencies = [ - "nom 7.0.0", -] - -[[package]] -name = "xdg" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a23fe958c70412687039c86f578938b4a0bb50ec788e96bce4d6ab00ddd5803" -dependencies = [ - "dirs", + "nom", ] [[package]] diff --git a/README.md b/README.md index 92cd8f50..ab50bdd0 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ [![Build Status](https://github.com/emilk/egui/workflows/CI/badge.svg)](https://github.com/emilk/egui/actions?workflow=CI) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![Apache](https://img.shields.io/badge/license-Apache-blue.svg) +[![Discord](https://img.shields.io/discord/900275882684477440?label=egui%20discord)](https://discord.gg/JFcEma9bJq) egui is a simple, fast, and highly portable immediate mode GUI library for Rust. egui runs on the web, natively, and [in your favorite game engine](#integrations) (or will soon). @@ -31,11 +32,11 @@ Sections: ## Quick start -If you just want to write a GUI application in Rust (for the web or for native), go to and follow the instructions there! +If you just want to write a GUI application in Rust (for the web or for native), go to and follow the instructions there! The official docs are at . For inspiration, check out the [the egui web demo](https://emilk.github.io/egui/index.html) and follow the links in it to its source code. There is also an excellent tutorial video at . If you want to integrate egui into an existing engine, go to the [Integrations](#integrations) section. -If you have questions, use [Discussions](https://github.com/emilk/egui/discussions). If you want to contribute to egui, please read the [Contributing Guidelines](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md) +If you have questions, use [GitHub Discussions](https://github.com/emilk/egui/discussions). There is also [an egui discord server](https://discord.gg/JFcEma9bJq). If you want to contribute to egui, please read the [Contributing Guidelines](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md). ## Demo @@ -43,13 +44,13 @@ If you have questions, use [Discussions](https://github.com/emilk/egui/discussio To test the demo app locally, run `cargo run --release -p egui_demo_app`. -The native backend is [`egui_glium`](https://github.com/emilk/egui/tree/master/egui_glium) (using [`glium`](https://github.com/glium/glium)) and should work out-of-the-box on Mac and Windows, but on Linux you need to first run: +The native backend is [`egui_glow`](https://github.com/emilk/egui/tree/master/egui_glow) (using [`glow`](https://crates.io/crates/glow)) and should work out-of-the-box on Mac and Windows, but on Linux you need to first run: `sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev` On Fedora Rawhide you need to run: -`dnf install clang clang-devel clang-tools-extra speech-dispatcher-devel libxkbcommon-devel pkg-config openssl-devel` +`dnf install clang clang-devel clang-tools-extra speech-dispatcher-devel libxkbcommon-devel pkg-config openssl-devel libxcb-devel` **NOTE**: This is just for the demo app - egui itself is completely platform agnostic! @@ -321,7 +322,7 @@ On Linux and Mac, Firefox will copy the WebGL render target from GPU, to CPU and To alleviate the above mentioned performance issues the default max-width of an egui web app is 1024 points. You can change this by overriding the `fn max_size_points` of [`epi::App`](https://docs.rs/epi/latest/epi/trait.App.html). ### How do I render 3D stuff in an egui area? -egui can't do 3D graphics itself, but if you use a 3D library (e.g. [`glium`](https://github.com/glium/glium) using [`egui_glium`](https://github.com/emilk/egui/tree/master/egui_glium), or [`miniquad`](https://github.com/not-fl3/miniquad) using [`egui-miniquad`](https://github.com/not-fl3/egui-miniquad)) you can render your 3D content to a texture, then display it using [`ui.image(…)`](https://docs.rs/egui/latest/egui/struct.Ui.html#method.image). You first need to convert the native texture to an [`egui::TextureId`](https://docs.rs/egui/latest/egui/enum.TextureId.html), and how to do this depends on the integration you use (e.g. [`register_glium_texture`](https://docs.rs/egui_glium/latest/egui_glium/struct.Painter.html#method.register_glium_texture)). +egui can't do 3D graphics itself, but if you use a 3D library (e.g. [`glium`](https://github.com/glium/glium) using [`egui_glium`](https://github.com/emilk/egui/tree/master/egui_glium), or [`miniquad`](https://github.com/not-fl3/miniquad) using [`egui-miniquad`](https://github.com/not-fl3/egui-miniquad)) you can render your 3D content to a texture, then display it using [`ui.image(…)`](https://docs.rs/egui/latest/egui/struct.Ui.html#method.image). You first need to convert the native texture to an [`egui::TextureId`](https://docs.rs/egui/latest/egui/enum.TextureId.html), and how to do this depends on the integration you use (e.g. [`register_glium_texture`](https://docs.rs/epi/latest/epi/trait.NativeTexture.html#tymethod.register_native_texture)). There is an example for showing a native glium texture in an egui window at . @@ -338,7 +339,7 @@ All colors have premultiplied alpha. egui uses the builder pattern for construction widgets. For instance: `ui.add(Label::new("Hello").text_color(RED));` I am not a big fan of the builder pattern (it is quite verbose both in implementation and in use) but until Rust has named, default arguments it is the best we can do. To alleviate some of the verbosity there are common-case helper functions, like `ui.label("Hello");`. -Instead of using matching `begin/end` style function calls (which can be error prone) egui prefers to use `FnOnce` closures passed to a wrapping function. Lambdas are a bit ugly though, so I'd like to find a nicer solution to this. +Instead of using matching `begin/end` style function calls (which can be error prone) egui prefers to use `FnOnce` closures passed to a wrapping function. Lambdas are a bit ugly though, so I'd like to find a nicer solution to this. More discussion of this at . ### Inspiration diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 00000000..077fb745 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,3 @@ +This folder contains the files required for the egui web demo hosted at . + +The reason the folder is called "docs" is because that is the name that GitHub requires in order to host a web page from the `master` branch of a repository. diff --git a/docs/egui_demo_app.js b/docs/egui_demo_app.js index ab1e7068..4e627b80 100644 --- a/docs/egui_demo_app.js +++ b/docs/egui_demo_app.js @@ -213,47 +213,47 @@ function makeMutClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_30(arg0, arg1) { - wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h22dce46016b364fe(arg0, arg1); + wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hedff1e3c1ca6c71c(arg0, arg1); } function __wbg_adapter_33(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h04545aeee2637565(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1d2f25dc91669030(arg0, arg1, addHeapObject(arg2)); } function __wbg_adapter_36(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h04545aeee2637565(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1d2f25dc91669030(arg0, arg1, addHeapObject(arg2)); } function __wbg_adapter_39(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h04545aeee2637565(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1d2f25dc91669030(arg0, arg1, addHeapObject(arg2)); } function __wbg_adapter_42(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h04545aeee2637565(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1d2f25dc91669030(arg0, arg1, addHeapObject(arg2)); } function __wbg_adapter_45(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h04545aeee2637565(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1d2f25dc91669030(arg0, arg1, addHeapObject(arg2)); } function __wbg_adapter_48(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h04545aeee2637565(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1d2f25dc91669030(arg0, arg1, addHeapObject(arg2)); } -function __wbg_adapter_51(arg0, arg1) { - wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h768f86e2936098f5(arg0, arg1); +function __wbg_adapter_51(arg0, arg1, arg2) { + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1d2f25dc91669030(arg0, arg1, addHeapObject(arg2)); } -function __wbg_adapter_54(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h04545aeee2637565(arg0, arg1, addHeapObject(arg2)); +function __wbg_adapter_54(arg0, arg1) { + wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__he78f81eace0d019f(arg0, arg1); } function __wbg_adapter_57(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h04545aeee2637565(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1d2f25dc91669030(arg0, arg1, addHeapObject(arg2)); } function __wbg_adapter_60(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hbf24353061fe7bc4(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h84e1489b515e3492(arg0, arg1, addHeapObject(arg2)); } function makeClosure(arg0, arg1, dtor, f) { @@ -278,11 +278,11 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_63(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h35a934a712e366af(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h72e381f5228369dd(arg0, arg1, addHeapObject(arg2)); } function __wbg_adapter_66(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h35a934a712e366af(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h72e381f5228369dd(arg0, arg1, addHeapObject(arg2)); } /** @@ -356,6 +356,15 @@ async function init(input) { imports.wbg.__wbindgen_object_drop_ref = function(arg0) { takeObject(arg0); }; + imports.wbg.__wbindgen_cb_drop = function(arg0) { + const obj = takeObject(arg0).original; + if (obj.cnt-- == 1) { + obj.a = 0; + return true; + } + var ret = false; + return ret; + }; imports.wbg.__wbindgen_string_get = function(arg0, arg1) { const obj = getObject(arg1); var ret = typeof(obj) === 'string' ? obj : undefined; @@ -368,30 +377,21 @@ async function init(input) { var ret = getStringFromWasm0(arg0, arg1); return addHeapObject(ret); }; - imports.wbg.__wbindgen_cb_drop = function(arg0) { - const obj = takeObject(arg0).original; - if (obj.cnt-- == 1) { - obj.a = 0; - return true; - } - var ret = false; - return ret; - }; imports.wbg.__wbindgen_number_get = function(arg0, arg1) { const obj = getObject(arg1); var ret = typeof(obj) === 'number' ? obj : undefined; getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); }; + imports.wbg.__wbindgen_object_clone_ref = function(arg0) { + var ret = getObject(arg0); + return addHeapObject(ret); + }; imports.wbg.__wbindgen_boolean_get = function(arg0) { const v = getObject(arg0); var ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2; return ret; }; - imports.wbg.__wbindgen_object_clone_ref = function(arg0) { - var ret = getObject(arg0); - return addHeapObject(ret); - }; imports.wbg.__wbg_instanceof_WebGl2RenderingContext_56ad96bfac3f5531 = function(arg0) { var ret = getObject(arg0) instanceof WebGL2RenderingContext; return ret; @@ -621,14 +621,9 @@ async function init(input) { var ret = getObject(arg0).setTimeout(getObject(arg1), arg2); return ret; }, arguments) }; - imports.wbg.__wbg_writeText_3b86a6dbc18b261b = function(arg0, arg1, arg2) { - var ret = getObject(arg0).writeText(getStringFromWasm0(arg1, arg2)); - return addHeapObject(ret); - }; - imports.wbg.__wbg_clipboardData_d717f7cf398c0dd9 = function(arg0) { - var ret = getObject(arg0).clipboardData; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; + imports.wbg.__wbg_addEventListener_52721772cc0a7f30 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3)); + }, arguments) }; imports.wbg.__wbg_matches_76fae292b8cd60a6 = function(arg0) { var ret = getObject(arg0).matches; return ret; @@ -704,6 +699,82 @@ async function init(input) { var ret = getObject(arg0)[arg1 >>> 0]; return isLikeNone(ret) ? 0 : addHeapObject(ret); }; + imports.wbg.__wbg_type_7a49279491e15d0a = function(arg0, arg1) { + var ret = getObject(arg1).type; + var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; + }; + imports.wbg.__wbg_preventDefault_9866c9fd51eecfb6 = function(arg0) { + getObject(arg0).preventDefault(); + }; + imports.wbg.__wbg_stopPropagation_ae76be6b0f664ee8 = function(arg0) { + getObject(arg0).stopPropagation(); + }; + imports.wbg.__wbg_length_a2870b8b80e120c3 = function(arg0) { + var ret = getObject(arg0).length; + return ret; + }; + imports.wbg.__wbg_get_b84d80d476cf15e4 = function(arg0, arg1) { + var ret = getObject(arg0)[arg1 >>> 0]; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_speaking_6ee7e15af03f4ade = function(arg0) { + var ret = getObject(arg0).speaking; + return ret; + }; + imports.wbg.__wbg_cancel_db8fc22aeb60a627 = function(arg0) { + getObject(arg0).cancel(); + }; + imports.wbg.__wbg_speak_a2c1dfdf7b0927fc = function(arg0, arg1) { + getObject(arg0).speak(getObject(arg1)); + }; + imports.wbg.__wbg_length_1d27563e3515722e = function(arg0) { + var ret = getObject(arg0).length; + return ret; + }; + imports.wbg.__wbg_item_a23b382195352a8a = function(arg0, arg1) { + var ret = getObject(arg0).item(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_get_20b719b18767c76e = function(arg0, arg1) { + var ret = getObject(arg0)[arg1 >>> 0]; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_name_6af1a38f3edc1522 = function(arg0, arg1) { + var ret = getObject(arg1).name; + var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; + }; + imports.wbg.__wbg_lastModified_c61609c3c6a0bd88 = function(arg0) { + var ret = getObject(arg0).lastModified; + return ret; + }; + imports.wbg.__wbg_instanceof_HtmlCanvasElement_25d964a0dde6717e = function(arg0) { + var ret = getObject(arg0) instanceof HTMLCanvasElement; + return ret; + }; + imports.wbg.__wbg_width_555f63ab09ba7d3f = function(arg0) { + var ret = getObject(arg0).width; + return ret; + }; + imports.wbg.__wbg_setwidth_c1a7061891b71f25 = function(arg0, arg1) { + getObject(arg0).width = arg1 >>> 0; + }; + imports.wbg.__wbg_height_7153faec70fbaf7b = function(arg0) { + var ret = getObject(arg0).height; + return ret; + }; + imports.wbg.__wbg_setheight_88894b05710ff752 = function(arg0, arg1) { + getObject(arg0).height = arg1 >>> 0; + }; + imports.wbg.__wbg_getContext_f701d0231ae22393 = function() { return handleError(function (arg0, arg1, arg2) { + var ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }, arguments) }; imports.wbg.__wbg_keyCode_490ed69472addfdc = function(arg0) { var ret = getObject(arg0).keyCode; return ret; @@ -735,82 +806,6 @@ async function init(input) { getInt32Memory0()[arg0 / 4 + 1] = len0; getInt32Memory0()[arg0 / 4 + 0] = ptr0; }; - imports.wbg.__wbg_speaking_6ee7e15af03f4ade = function(arg0) { - var ret = getObject(arg0).speaking; - return ret; - }; - imports.wbg.__wbg_cancel_db8fc22aeb60a627 = function(arg0) { - getObject(arg0).cancel(); - }; - imports.wbg.__wbg_speak_a2c1dfdf7b0927fc = function(arg0, arg1) { - getObject(arg0).speak(getObject(arg1)); - }; - imports.wbg.__wbg_type_7a49279491e15d0a = function(arg0, arg1) { - var ret = getObject(arg1).type; - var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len0 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len0; - getInt32Memory0()[arg0 / 4 + 0] = ptr0; - }; - imports.wbg.__wbg_preventDefault_9866c9fd51eecfb6 = function(arg0) { - getObject(arg0).preventDefault(); - }; - imports.wbg.__wbg_stopPropagation_ae76be6b0f664ee8 = function(arg0) { - getObject(arg0).stopPropagation(); - }; - imports.wbg.__wbg_name_6af1a38f3edc1522 = function(arg0, arg1) { - var ret = getObject(arg1).name; - var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len0 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len0; - getInt32Memory0()[arg0 / 4 + 0] = ptr0; - }; - imports.wbg.__wbg_lastModified_c61609c3c6a0bd88 = function(arg0) { - var ret = getObject(arg0).lastModified; - return ret; - }; - imports.wbg.__wbg_length_a2870b8b80e120c3 = function(arg0) { - var ret = getObject(arg0).length; - return ret; - }; - imports.wbg.__wbg_get_b84d80d476cf15e4 = function(arg0, arg1) { - var ret = getObject(arg0)[arg1 >>> 0]; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_instanceof_HtmlCanvasElement_25d964a0dde6717e = function(arg0) { - var ret = getObject(arg0) instanceof HTMLCanvasElement; - return ret; - }; - imports.wbg.__wbg_width_555f63ab09ba7d3f = function(arg0) { - var ret = getObject(arg0).width; - return ret; - }; - imports.wbg.__wbg_setwidth_c1a7061891b71f25 = function(arg0, arg1) { - getObject(arg0).width = arg1 >>> 0; - }; - imports.wbg.__wbg_height_7153faec70fbaf7b = function(arg0) { - var ret = getObject(arg0).height; - return ret; - }; - imports.wbg.__wbg_setheight_88894b05710ff752 = function(arg0, arg1) { - getObject(arg0).height = arg1 >>> 0; - }; - imports.wbg.__wbg_getContext_f701d0231ae22393 = function() { return handleError(function (arg0, arg1, arg2) { - var ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2)); - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }, arguments) }; - imports.wbg.__wbg_length_1d27563e3515722e = function(arg0) { - var ret = getObject(arg0).length; - return ret; - }; - imports.wbg.__wbg_item_a23b382195352a8a = function(arg0, arg1) { - var ret = getObject(arg0).item(arg1 >>> 0); - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_get_20b719b18767c76e = function(arg0, arg1) { - var ret = getObject(arg0)[arg1 >>> 0]; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; imports.wbg.__wbg_clipboard_3dff7cff084c4be2 = function(arg0) { var ret = getObject(arg0).clipboard; return isLikeNone(ret) ? 0 : addHeapObject(ret); @@ -838,6 +833,14 @@ async function init(input) { var ret = getObject(arg0).arrayBuffer(); return addHeapObject(ret); }; + imports.wbg.__wbg_width_d55d3698a2514ec1 = function(arg0) { + var ret = getObject(arg0).width; + return ret; + }; + imports.wbg.__wbg_height_df08a93b45ce76ec = function(arg0) { + var ret = getObject(arg0).height; + return ret; + }; imports.wbg.__wbg_top_3946f8347860b55c = function(arg0) { var ret = getObject(arg0).top; return ret; @@ -873,6 +876,14 @@ async function init(input) { var ret = getObject(arg0).scrollLeft; return ret; }; + imports.wbg.__wbg_clientWidth_4d9e01af2b5b9f21 = function(arg0) { + var ret = getObject(arg0).clientWidth; + return ret; + }; + imports.wbg.__wbg_clientHeight_87c209f0cacf2e97 = function(arg0) { + var ret = getObject(arg0).clientHeight; + return ret; + }; imports.wbg.__wbg_getBoundingClientRect_2fba0402ea2a6ec4 = function(arg0) { var ret = getObject(arg0).getBoundingClientRect(); return addHeapObject(ret); @@ -980,6 +991,10 @@ async function init(input) { var ret = getObject(arg0).getExtension(getStringFromWasm0(arg1, arg2)); return isLikeNone(ret) ? 0 : addHeapObject(ret); }, arguments) }; + imports.wbg.__wbg_getParameter_6412bd2d0602696d = function() { return handleError(function (arg0, arg1) { + var ret = getObject(arg0).getParameter(arg1 >>> 0); + return addHeapObject(ret); + }, arguments) }; imports.wbg.__wbg_getProgramInfoLog_b60e82d52c200cbd = function(arg0, arg1, arg2) { var ret = getObject(arg1).getProgramInfoLog(getObject(arg2)); var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); @@ -1078,13 +1093,9 @@ async function init(input) { imports.wbg.__wbg_focus_00530e359f44fc6e = function() { return handleError(function (arg0) { getObject(arg0).focus(); }, arguments) }; - imports.wbg.__wbg_data_dbff09eb89176161 = function(arg0, arg1) { - var ret = getObject(arg1).data; - var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len0 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len0; - getInt32Memory0()[arg0 / 4 + 0] = ptr0; - }; + imports.wbg.__wbg_setProperty_1460c660bc329763 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).setProperty(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; imports.wbg.__wbg_hash_0fff5255cf3c317c = function() { return handleError(function (arg0, arg1) { var ret = getObject(arg1).hash; var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); @@ -1122,9 +1133,13 @@ async function init(input) { imports.wbg.__wbg_setItem_b0c4561489dffecd = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { getObject(arg0).setItem(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); }, arguments) }; - imports.wbg.__wbg_setProperty_1460c660bc329763 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { - getObject(arg0).setProperty(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); - }, arguments) }; + imports.wbg.__wbg_data_dbff09eb89176161 = function(arg0, arg1) { + var ret = getObject(arg1).data; + var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; + }; imports.wbg.__wbg_type_a6fcda966902940d = function(arg0, arg1) { var ret = getObject(arg1).type; var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); @@ -1169,13 +1184,18 @@ async function init(input) { var ret = getObject(arg0).deltaMode; return ret; }; + imports.wbg.__wbg_writeText_3b86a6dbc18b261b = function(arg0, arg1, arg2) { + var ret = getObject(arg0).writeText(getStringFromWasm0(arg1, arg2)); + return addHeapObject(ret); + }; + imports.wbg.__wbg_clipboardData_d717f7cf398c0dd9 = function(arg0) { + var ret = getObject(arg0).clipboardData; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; imports.wbg.__wbg_dataTransfer_ebba35c1049e694f = function(arg0) { var ret = getObject(arg0).dataTransfer; return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_addEventListener_52721772cc0a7f30 = function() { return handleError(function (arg0, arg1, arg2, arg3) { - getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3)); - }, arguments) }; imports.wbg.__wbg_instanceof_Response_e1b11afbefa5b563 = function(arg0) { var ret = getObject(arg0) instanceof Response; return ret; @@ -1371,56 +1391,56 @@ async function init(input) { var ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1990 = function(arg0, arg1, arg2) { - var ret = makeMutClosure(arg0, arg1, 769, __wbg_adapter_30); + imports.wbg.__wbindgen_closure_wrapper1901 = function(arg0, arg1, arg2) { + var ret = makeMutClosure(arg0, arg1, 720, __wbg_adapter_30); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1991 = function(arg0, arg1, arg2) { - var ret = makeMutClosure(arg0, arg1, 769, __wbg_adapter_33); + imports.wbg.__wbindgen_closure_wrapper1902 = function(arg0, arg1, arg2) { + var ret = makeMutClosure(arg0, arg1, 720, __wbg_adapter_33); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1993 = function(arg0, arg1, arg2) { - var ret = makeMutClosure(arg0, arg1, 769, __wbg_adapter_36); + imports.wbg.__wbindgen_closure_wrapper1904 = function(arg0, arg1, arg2) { + var ret = makeMutClosure(arg0, arg1, 720, __wbg_adapter_36); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1995 = function(arg0, arg1, arg2) { - var ret = makeMutClosure(arg0, arg1, 769, __wbg_adapter_39); + imports.wbg.__wbindgen_closure_wrapper1906 = function(arg0, arg1, arg2) { + var ret = makeMutClosure(arg0, arg1, 720, __wbg_adapter_39); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1997 = function(arg0, arg1, arg2) { - var ret = makeMutClosure(arg0, arg1, 769, __wbg_adapter_42); + imports.wbg.__wbindgen_closure_wrapper1908 = function(arg0, arg1, arg2) { + var ret = makeMutClosure(arg0, arg1, 720, __wbg_adapter_42); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1999 = function(arg0, arg1, arg2) { - var ret = makeMutClosure(arg0, arg1, 769, __wbg_adapter_45); + imports.wbg.__wbindgen_closure_wrapper1911 = function(arg0, arg1, arg2) { + var ret = makeMutClosure(arg0, arg1, 720, __wbg_adapter_45); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper2002 = function(arg0, arg1, arg2) { - var ret = makeMutClosure(arg0, arg1, 769, __wbg_adapter_48); + imports.wbg.__wbindgen_closure_wrapper1913 = function(arg0, arg1, arg2) { + var ret = makeMutClosure(arg0, arg1, 720, __wbg_adapter_48); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper2004 = function(arg0, arg1, arg2) { - var ret = makeMutClosure(arg0, arg1, 769, __wbg_adapter_51); + imports.wbg.__wbindgen_closure_wrapper1915 = function(arg0, arg1, arg2) { + var ret = makeMutClosure(arg0, arg1, 720, __wbg_adapter_51); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper2006 = function(arg0, arg1, arg2) { - var ret = makeMutClosure(arg0, arg1, 769, __wbg_adapter_54); + imports.wbg.__wbindgen_closure_wrapper1917 = function(arg0, arg1, arg2) { + var ret = makeMutClosure(arg0, arg1, 720, __wbg_adapter_54); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper2008 = function(arg0, arg1, arg2) { - var ret = makeMutClosure(arg0, arg1, 769, __wbg_adapter_57); + imports.wbg.__wbindgen_closure_wrapper1919 = function(arg0, arg1, arg2) { + var ret = makeMutClosure(arg0, arg1, 720, __wbg_adapter_57); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper2042 = function(arg0, arg1, arg2) { - var ret = makeMutClosure(arg0, arg1, 802, __wbg_adapter_60); + imports.wbg.__wbindgen_closure_wrapper2113 = function(arg0, arg1, arg2) { + var ret = makeMutClosure(arg0, arg1, 823, __wbg_adapter_60); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper2109 = function(arg0, arg1, arg2) { - var ret = makeClosure(arg0, arg1, 851, __wbg_adapter_63); + imports.wbg.__wbindgen_closure_wrapper2179 = function(arg0, arg1, arg2) { + var ret = makeClosure(arg0, arg1, 871, __wbg_adapter_63); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper2111 = function(arg0, arg1, arg2) { - var ret = makeClosure(arg0, arg1, 851, __wbg_adapter_66); + imports.wbg.__wbindgen_closure_wrapper2181 = function(arg0, arg1, arg2) { + var ret = makeClosure(arg0, arg1, 871, __wbg_adapter_66); return addHeapObject(ret); }; diff --git a/docs/egui_demo_app_bg.wasm b/docs/egui_demo_app_bg.wasm index 63e178c5..0cfdb5f3 100644 Binary files a/docs/egui_demo_app_bg.wasm and b/docs/egui_demo_app_bg.wasm differ diff --git a/docs/favicon.ico b/docs/favicon.ico new file mode 100755 index 00000000..61ad031a Binary files /dev/null and b/docs/favicon.ico differ diff --git a/docs/index.html b/docs/index.html index 9cfcb27a..47975923 100644 --- a/docs/index.html +++ b/docs/index.html @@ -45,12 +45,59 @@ left: 50%; transform: translate(-50%, 0%); } + + .loading { + margin-right: auto; + margin-left: auto; + display: block; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + color: white; + font-size: 24px; + font-family: Ubuntu-Light, Helvetica, sans-serif; + } + + /* ---------------------------------------------- */ + /* Loading animation from https://loading.io/css/ */ + .lds-dual-ring { + display: inline-block; + width: 24px; + height: 24px; + } + + .lds-dual-ring:after { + content: " "; + display: block; + width: 24px; + height: 24px; + margin: 0px; + border-radius: 50%; + border: 3px solid #fff; + border-color: #fff transparent #fff transparent; + animation: lds-dual-ring 1.2s linear infinite; + } + + @keyframes lds-dual-ring { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } + } - + +
+ Loading…   +
+
diff --git a/eframe/CHANGELOG.md b/eframe/CHANGELOG.md index a49b7349..a6480965 100644 --- a/eframe/CHANGELOG.md +++ b/eframe/CHANGELOG.md @@ -5,6 +5,14 @@ NOTE: [`egui_web`](egui_web/CHANGELOG.md), [`egui-winit`](egui-winit/CHANGELOG.m ## Unreleased +* The default native backend is now `egui_glow` (instead of `egui_glium`) ([#1020](https://github.com/emilk/egui/pull/1020)). +* The default web painter is now `egui_glow` (instead of WebGL) ([#1020](https://github.com/emilk/egui/pull/1020)). + + +## 0.16.0 - 2021-12-29 +* `Frame` can now be cloned, saved, and passed to background threads ([#999](https://github.com/emilk/egui/pull/999)). +* Added `Frame::request_repaint` to replace `repaint_signal` ([#999](https://github.com/emilk/egui/pull/999)). +* Added `Frame::alloc_texture/free_texture` to replace `tex_allocator` ([#999](https://github.com/emilk/egui/pull/999)). ## 0.15.0 - 2021-10-24 diff --git a/eframe/Cargo.toml b/eframe/Cargo.toml index 66185b3b..a01d380a 100644 --- a/eframe/Cargo.toml +++ b/eframe/Cargo.toml @@ -1,9 +1,10 @@ [package] name = "eframe" -version = "0.15.0" +version = "0.16.0" authors = ["Emil Ernerfeldt "] description = "egui framework - write GUI apps that compiles to web and/or natively" -edition = "2018" +edition = "2021" +rust-version = "1.56" homepage = "https://github.com/emilk/egui/tree/master/eframe" license = "MIT OR Apache-2.0" readme = "README.md" @@ -23,25 +24,25 @@ all-features = true [lib] [dependencies] -egui = { version = "0.15.0", path = "../egui", default-features = false } -epi = { version = "0.15.0", path = "../epi" } +egui = { version = "0.16.0", path = "../egui", default-features = false } +epi = { version = "0.16.0", path = "../epi" } # native: [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -egui-winit = { version = "0.15.0", path = "../egui-winit", default-features = false } -egui_glium = { version = "0.15.0", path = "../egui_glium", default-features = false, features = ["clipboard", "epi", "links"], optional = true } -egui_glow = { version = "0.15.0", path = "../egui_glow", default-features = false, features = ["clipboard", "epi", "links", "winit"], optional = true } +egui-winit = { version = "0.16.0", path = "../egui-winit", default-features = false } +egui_glium = { version = "0.16.0", path = "../egui_glium", default-features = false, features = ["clipboard", "epi", "links"], optional = true } +egui_glow = { version = "0.16.0", path = "../egui_glow", default-features = false, features = ["clipboard", "epi", "links", "winit"], optional = true } # web: [target.'cfg(target_arch = "wasm32")'.dependencies] -egui_web = { version = "0.15.0", path = "../egui_web", default-features = false } +egui_web = { version = "0.16.0", path = "../egui_web", default-features = false, features = ["glow"] } [dev-dependencies] image = { version = "0.23", default-features = false, features = ["png"] } -rfd = "0.5.0" +rfd = "0.6" [features] -default = ["default_fonts", "egui_glium"] +default = ["default_fonts", "egui_glow"] # If set, egui will use `include_bytes!` to bundle some fonts. # If you plan on specifying your own fonts you may disable this feature. diff --git a/eframe/README.md b/eframe/README.md index 1c452a6d..9bdf221c 100644 --- a/eframe/README.md +++ b/eframe/README.md @@ -10,6 +10,10 @@ To get started, go to and follow the instructions there! +You can also take a look at [the `eframe` examples folder](https://github.com/emilk/egui/tree/master/eframe/examples). There is also an excellent tutorial video at . + +For how to use `egui`, see [the egui docs](https://docs.rs/egui). + --- `eframe` is a very thin crate that re-exports [`egui`](https://github.com/emilk/egui) and[`epi`](https://github.com/emilk/egui/tree/master/epi) with thin wrappers over the backends. @@ -24,17 +28,17 @@ sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev lib ## Alternatives -The default native backend for `eframe` is currently [`egui_glium`](https://github.com/emilk/egui/tree/master/egui_glium), but you can try out the new [`egui_glow`](https://github.com/emilk/egui/tree/master/egui_glow) backend by putting this in your `Cargo.toml`: +The default native backend for `eframe` is currently [`egui_glow`](https://github.com/emilk/egui/tree/master/egui_glow), but you can switch to the previous [`egui_glium`](https://github.com/emilk/egui/tree/master/egui_glium) backend by putting this in your `Cargo.toml`: ``` toml -eframe = { version = "*", default-features = false, features = ["default_fonts", "egui_glow"] } +eframe = { version = "*", default-features = false, features = ["default_fonts", "egui_glium"] } ``` `eframe` is not the only way to write an app using `egui`! You can also try [`egui-miniquad`](https://github.com/not-fl3/egui-miniquad) and [`egui_sdl2_gl`](https://github.com/ArjunNair/egui_sdl2_gl). ## Companion crates -Not all rust crates work when compiles to WASM, but here are some useful crates have been designed to work well both natively and as WASM: +Not all rust crates work when compiled to WASM, but here are some useful crates have been designed to work well both natively and as WASM: * Audio: [`cpal`](https://github.com/RustAudio/cpal). * HTTP client: [`ehttp`](https://github.com/emilk/ehttp). diff --git a/eframe/examples/custom_font.rs b/eframe/examples/custom_font.rs new file mode 100644 index 00000000..199521da --- /dev/null +++ b/eframe/examples/custom_font.rs @@ -0,0 +1,65 @@ +use eframe::{egui, epi}; + +struct MyApp { + text: String, +} + +impl Default for MyApp { + fn default() -> Self { + Self { + text: "Edit this text field if you want".to_owned(), + } + } +} + +impl epi::App for MyApp { + fn name(&self) -> &str { + "egui example: custom font" + } + + fn setup( + &mut self, + ctx: &egui::CtxRef, + _frame: &epi::Frame, + _storage: Option<&dyn epi::Storage>, + ) { + // Start with the default fonts (we will be adding to them rather than replacing them). + let mut fonts = egui::FontDefinitions::default(); + + // Install my own font (maybe supporting non-latin characters). + // .ttf and .otf files supported. + fonts.font_data.insert( + "my_font".to_owned(), + egui::FontData::from_static(include_bytes!("../../epaint/fonts/Hack-Regular.ttf")), + ); + + // Put my font first (highest priority) for proportional text: + fonts + .fonts_for_family + .entry(egui::FontFamily::Proportional) + .or_default() + .insert(0, "my_font".to_owned()); + + // Put my font as last fallback for monospace: + fonts + .fonts_for_family + .entry(egui::FontFamily::Monospace) + .or_default() + .push("my_font".to_owned()); + + // Tell egui to use these fonts: + ctx.set_fonts(fonts); + } + + fn update(&mut self, ctx: &egui::CtxRef, _frame: &epi::Frame) { + egui::CentralPanel::default().show(ctx, |ui| { + ui.heading("egui using custom fonts"); + ui.text_edit_multiline(&mut self.text); + }); + } +} + +fn main() { + let options = eframe::NativeOptions::default(); + eframe::run_native(Box::new(MyApp::default()), options); +} diff --git a/eframe/examples/file_dialog.rs b/eframe/examples/file_dialog.rs index 2de6e3f4..b9767e3e 100644 --- a/eframe/examples/file_dialog.rs +++ b/eframe/examples/file_dialog.rs @@ -1,3 +1,5 @@ +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release + use eframe::{egui, epi}; #[derive(Default)] @@ -11,13 +13,11 @@ impl epi::App for MyApp { "Native file dialogs and drag-and-drop files" } - fn update(&mut self, ctx: &egui::CtxRef, _frame: &mut epi::Frame<'_>) { + fn update(&mut self, ctx: &egui::CtxRef, _frame: &epi::Frame) { egui::CentralPanel::default().show(ctx, |ui| { ui.label("Drag-and-drop files onto the window!"); - if cfg!(target_os = "macos") { - // Awaiting fix of winit bug: https://github.com/rust-windowing/winit/pull/2027 - } else if ui.button("Open file…").clicked() { + if ui.button("Open file…").clicked() { if let Some(path) = rfd::FileDialog::new().pick_file() { self.picked_path = Some(path.display().to_string()); } diff --git a/eframe/examples/hello_world.rs b/eframe/examples/hello_world.rs index 4437f1a3..9a944929 100644 --- a/eframe/examples/hello_world.rs +++ b/eframe/examples/hello_world.rs @@ -1,3 +1,5 @@ +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release + use eframe::{egui, epi}; struct MyApp { @@ -19,7 +21,7 @@ impl epi::App for MyApp { "My egui App" } - fn update(&mut self, ctx: &egui::CtxRef, frame: &mut epi::Frame<'_>) { + fn update(&mut self, ctx: &egui::CtxRef, frame: &epi::Frame) { let Self { name, age } = self; egui::CentralPanel::default().show(ctx, |ui| { diff --git a/eframe/examples/image.rs b/eframe/examples/image.rs index ebf5850e..91e0f4f5 100644 --- a/eframe/examples/image.rs +++ b/eframe/examples/image.rs @@ -1,3 +1,5 @@ +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release + use eframe::{egui, epi}; #[derive(Default)] @@ -10,26 +12,20 @@ impl epi::App for MyApp { "Show an image with eframe/egui" } - fn update(&mut self, ctx: &egui::CtxRef, frame: &mut epi::Frame<'_>) { + fn update(&mut self, ctx: &egui::CtxRef, frame: &epi::Frame) { if self.texture.is_none() { // Load the image: let image_data = include_bytes!("rust-logo-256x256.png"); use image::GenericImageView; let image = image::load_from_memory(image_data).expect("Failed to load image"); let image_buffer = image.to_rgba8(); - let size = (image.width() as usize, image.height() as usize); + let size = [image.width() as usize, image.height() as usize]; let pixels = image_buffer.into_vec(); - assert_eq!(size.0 * size.1 * 4, pixels.len()); - let pixels: Vec<_> = pixels - .chunks_exact(4) - .map(|p| egui::Color32::from_rgba_unmultiplied(p[0], p[1], p[2], p[3])) - .collect(); + let image = epi::Image::from_rgba_unmultiplied(size, &pixels); // Allocate a texture: - let texture = frame - .tex_allocator() - .alloc_srgba_premultiplied(size, &pixels); - let size = egui::Vec2::new(size.0 as f32, size.1 as f32); + let texture = frame.alloc_texture(image); + let size = egui::Vec2::new(size[0] as f32, size[1] as f32); self.texture = Some((size, texture)); } diff --git a/eframe/src/lib.rs b/eframe/src/lib.rs index dd9036db..2fff7519 100644 --- a/eframe/src/lib.rs +++ b/eframe/src/lib.rs @@ -6,6 +6,8 @@ //! //! To get started, look at . //! +//! You can also take a look at [the `eframe` examples folder](https://github.com/emilk/egui/tree/master/eframe/examples). +//! //! You write your application code for [`epi`] (implementing [`epi::App`]) and then //! call from [`crate::run_native`] your `main.rs`, and/or call `eframe::start_web` from your `lib.rs`. //! @@ -24,7 +26,7 @@ //! "My egui App" //! } //! -//! fn update(&mut self, ctx: &egui::CtxRef, frame: &mut epi::Frame<'_>) { +//! fn update(&mut self, ctx: &egui::CtxRef, frame: &epi::Frame) { //! egui::CentralPanel::default().show(ctx, |ui| { //! ui.heading("Hello World!"); //! }); @@ -55,7 +57,12 @@ // Forbid warnings in release builds: #![cfg_attr(not(debug_assertions), deny(warnings))] #![forbid(unsafe_code)] -#![warn(clippy::all, missing_crate_level_docs, missing_docs, rust_2018_idioms)] +#![warn( + clippy::all, + missing_docs, + rust_2018_idioms, + rustdoc::missing_crate_level_docs +)] #![allow(clippy::needless_doctest_main)] pub use {egui, epi}; @@ -110,7 +117,7 @@ pub fn start_web(canvas_id: &str, app: Box) -> Result<(), wasm_bin // ---------------------------------------------------------------------------- // When compiling natively -/// Call from `fn main` like this: ` +/// Call from `fn main` like this: /// ``` no_run /// use eframe::{epi, egui}; /// @@ -122,7 +129,7 @@ pub fn start_web(canvas_id: &str, app: Box) -> Result<(), wasm_bin /// "My egui App" /// } /// -/// fn update(&mut self, ctx: &egui::CtxRef, frame: &mut epi::Frame<'_>) { +/// fn update(&mut self, ctx: &egui::CtxRef, frame: &epi::Frame) { /// egui::CentralPanel::default().show(ctx, |ui| { /// ui.heading("Hello World!"); /// }); @@ -141,8 +148,25 @@ pub fn run_native(app: Box, native_options: epi::NativeOptions) -> egui_glium::run(app, &native_options) } -/// Call from `fn main` like this: ` +/// Call from `fn main` like this: /// ``` no_run +/// use eframe::{epi, egui}; +/// +/// #[derive(Default)] +/// struct MyEguiApp {} +/// +/// impl epi::App for MyEguiApp { +/// fn name(&self) -> &str { +/// "My egui App" +/// } +/// +/// fn update(&mut self, ctx: &egui::CtxRef, frame: &epi::Frame) { +/// egui::CentralPanel::default().show(ctx, |ui| { +/// ui.heading("Hello World!"); +/// }); +/// } +///} +/// /// fn main() { /// let app = MyEguiApp::default(); /// let native_options = eframe::NativeOptions::default(); diff --git a/egui-winit/CHANGELOG.md b/egui-winit/CHANGELOG.md index 3c1a56b7..e2eb6621 100644 --- a/egui-winit/CHANGELOG.md +++ b/egui-winit/CHANGELOG.md @@ -4,9 +4,15 @@ All notable changes to the `egui-winit` integration will be noted in this file. ## Unreleased -* Add helper `EpiIntegration` ([#871](https://github.com/emilk/egui/pull/871)). -* Fix shift key getting stuck enabled with the X11 option `shift:both_capslock` enabled ([#849](https://github.com/emilk/egui/pull/849)). -* Remove `State::is_quit_event` and `State::is_quit_shortcut` ([#881](https://github.com/emilk/egui/pull/881)). +* Replaced `std::time::Instant` with `instant::Instant` for WebAssembly compatability ([#1023](https://github.com/emilk/egui/pull/1023)) + + +## 0.16.0 - 2021-12-29 +* Added helper `EpiIntegration` ([#871](https://github.com/emilk/egui/pull/871)). +* Fixed shift key getting stuck enabled with the X11 option `shift:both_capslock` enabled ([#849](https://github.com/emilk/egui/pull/849)). +* Removed `State::is_quit_event` and `State::is_quit_shortcut` ([#881](https://github.com/emilk/egui/pull/881)). +* Updated `winit` to 0.26 ([#930](https://github.com/emilk/egui/pull/930)). + ## 0.15.0 - 2021-10-24 First stand-alone release. Previously part of `egui_glium`. diff --git a/egui-winit/Cargo.toml b/egui-winit/Cargo.toml index ecfe7166..917a3ae5 100644 --- a/egui-winit/Cargo.toml +++ b/egui-winit/Cargo.toml @@ -1,9 +1,10 @@ [package] name = "egui-winit" -version = "0.15.0" +version = "0.16.0" authors = ["Emil Ernerfeldt "] description = "Bindings for using egui with winit" -edition = "2018" +edition = "2021" +rust-version = "1.56" homepage = "https://github.com/emilk/egui/tree/master/egui-winit" license = "MIT OR Apache-2.0" readme = "README.md" @@ -21,17 +22,18 @@ include = [ all-features = true [dependencies] -egui = { version = "0.15.0", path = "../egui", default-features = false, features = ["single_threaded"] } -winit = "0.25" +egui = { version = "0.16.0", path = "../egui", default-features = false, features = ["single_threaded"] } +instant = { version = "0.1", features = ["wasm-bindgen"] } +winit = "0.26" -epi = { version = "0.15.0", path = "../epi", optional = true } +epi = { version = "0.16.0", path = "../epi", optional = true } copypasta = { version = "0.7", optional = true } serde = { version = "1.0", optional = true, features = ["derive"] } webbrowser = { version = "0.5", optional = true } # feature screen_reader -tts = { version = "0.17", optional = true } +tts = { version = "0.19", optional = true } [features] default = ["clipboard", "links"] diff --git a/egui-winit/src/epi.rs b/egui-winit/src/epi.rs index a10dcd7a..badea97a 100644 --- a/egui-winit/src/epi.rs +++ b/egui-winit/src/epi.rs @@ -55,9 +55,10 @@ pub fn handle_app_output( window: &winit::window::Window, current_pixels_per_point: f32, app_output: epi::backend::AppOutput, -) { +) -> epi::backend::TexAllocationData { let epi::backend::AppOutput { quit: _, + tex_allocation_data, window_size, window_title, decorated, @@ -85,6 +86,8 @@ pub fn handle_app_output( if drag_window { let _ = window.drag_window(); } + + tex_allocation_data } // ---------------------------------------------------------------------------- @@ -92,7 +95,7 @@ pub fn handle_app_output( /// For loading/saving app state and/or egui memory to disk. pub struct Persistence { storage: Option>, - last_auto_save: std::time::Instant, + last_auto_save: instant::Instant, } #[allow(clippy::unused_self)] @@ -113,7 +116,7 @@ impl Persistence { Self { storage: create_storage(app_name), - last_auto_save: std::time::Instant::now(), + last_auto_save: instant::Instant::now(), } } @@ -174,7 +177,7 @@ impl Persistence { egui_ctx: &egui::Context, window: &winit::window::Window, ) { - let now = std::time::Instant::now(); + let now = instant::Instant::now(); if now - self.last_auto_save > app.auto_save_interval() { self.save(app, egui_ctx, window); self.last_auto_save = now; @@ -186,13 +189,11 @@ impl Persistence { /// Everything needed to make a winit-based integration for [`epi`]. pub struct EpiIntegration { - integration_name: &'static str, + frame: epi::Frame, persistence: crate::epi::Persistence, - repaint_signal: std::sync::Arc, pub egui_ctx: egui::CtxRef, egui_winit: crate::State, pub app: Box, - latest_frame_time: Option, /// When set, it is time to quit quit: bool, } @@ -201,8 +202,7 @@ impl EpiIntegration { pub fn new( integration_name: &'static str, window: &winit::window::Window, - tex_allocator: &mut dyn epi::TextureAllocator, - repaint_signal: std::sync::Arc, + repaint_signal: std::sync::Arc, persistence: crate::epi::Persistence, app: Box, ) -> Self { @@ -210,54 +210,50 @@ impl EpiIntegration { *egui_ctx.memory() = persistence.load_memory().unwrap_or_default(); - let mut slf = Self { - integration_name, - persistence, + let frame = epi::Frame::new(epi::backend::FrameData { + info: epi::IntegrationInfo { + name: integration_name, + web_info: None, + prefer_dark_mode: None, // TODO: figure out system default + cpu_usage: None, + native_pixels_per_point: Some(crate::native_pixels_per_point(window)), + }, + output: Default::default(), repaint_signal, + }); + + let mut slf = Self { + frame, + persistence, egui_ctx, egui_winit: crate::State::new(window), app, - latest_frame_time: None, quit: false, }; - slf.setup(window, tex_allocator); + slf.setup(window); if slf.app.warm_up_enabled() { - slf.warm_up(window, tex_allocator); + slf.warm_up(window); } slf } - fn setup( - &mut self, - window: &winit::window::Window, - tex_allocator: &mut dyn epi::TextureAllocator, - ) { - let mut app_output = epi::backend::AppOutput::default(); - let mut frame = epi::backend::FrameBuilder { - info: integration_info(self.integration_name, window, None), - tex_allocator, - output: &mut app_output, - repaint_signal: self.repaint_signal.clone(), - } - .build(); + fn setup(&mut self, window: &winit::window::Window) { self.app - .setup(&self.egui_ctx, &mut frame, self.persistence.storage()); - + .setup(&self.egui_ctx, &self.frame, self.persistence.storage()); + let app_output = self.frame.take_app_output(); self.quit |= app_output.quit; - - crate::epi::handle_app_output(window, self.egui_ctx.pixels_per_point(), app_output); + let tex_alloc_data = + crate::epi::handle_app_output(window, self.egui_ctx.pixels_per_point(), app_output); + self.frame.lock().output.tex_allocation_data = tex_alloc_data; // Do it later } - fn warm_up( - &mut self, - window: &winit::window::Window, - tex_allocator: &mut dyn epi::TextureAllocator, - ) { + fn warm_up(&mut self, window: &winit::window::Window) { let saved_memory = self.egui_ctx.memory().clone(); self.egui_ctx.memory().set_everything_is_visible(true); - self.update(window, tex_allocator); + let (_, tex_alloc_data, _) = self.update(window); + self.frame.lock().output.tex_allocation_data = tex_alloc_data; // handle it next frame *self.egui_ctx.memory() = saved_memory; // We don't want to remember that windows were huge. self.egui_ctx.clear_animations(); } @@ -277,38 +273,31 @@ impl EpiIntegration { pub fn update( &mut self, window: &winit::window::Window, - tex_allocator: &mut dyn epi::TextureAllocator, - ) -> (bool, Vec) { - let frame_start = std::time::Instant::now(); + ) -> ( + bool, + epi::backend::TexAllocationData, + Vec, + ) { + let frame_start = instant::Instant::now(); let raw_input = self.egui_winit.take_egui_input(window); - - let mut app_output = epi::backend::AppOutput::default(); - let mut frame = epi::backend::FrameBuilder { - info: integration_info(self.integration_name, window, self.latest_frame_time), - tex_allocator, - output: &mut app_output, - repaint_signal: self.repaint_signal.clone(), - } - .build(); - - let app = &mut self.app; // TODO: remove when we update MSVR to 1.56 let (egui_output, shapes) = self.egui_ctx.run(raw_input, |egui_ctx| { - app.update(egui_ctx, &mut frame); + self.app.update(egui_ctx, &self.frame); }); let needs_repaint = egui_output.needs_repaint; self.egui_winit .handle_output(window, &self.egui_ctx, egui_output); + let app_output = self.frame.take_app_output(); self.quit |= app_output.quit; + let tex_allocation_data = + crate::epi::handle_app_output(window, self.egui_ctx.pixels_per_point(), app_output); - crate::epi::handle_app_output(window, self.egui_ctx.pixels_per_point(), app_output); + let frame_time = (instant::Instant::now() - frame_start).as_secs_f64() as f32; + self.frame.lock().info.cpu_usage = Some(frame_time); - let frame_time = (std::time::Instant::now() - frame_start).as_secs_f64() as f32; - self.latest_frame_time = Some(frame_time); - - (needs_repaint, shapes) + (needs_repaint, tex_allocation_data, shapes) } pub fn maybe_autosave(&mut self, window: &winit::window::Window) { @@ -322,17 +311,3 @@ impl EpiIntegration { .save(&mut *self.app, &self.egui_ctx, window); } } - -fn integration_info( - integration_name: &'static str, - window: &winit::window::Window, - previous_frame_time: Option, -) -> epi::IntegrationInfo { - epi::IntegrationInfo { - name: integration_name, - web_info: None, - prefer_dark_mode: None, // TODO: figure out system default - cpu_usage: previous_frame_time, - native_pixels_per_point: Some(crate::native_pixels_per_point(window)), - } -} diff --git a/egui-winit/src/lib.rs b/egui-winit/src/lib.rs index 7232a14b..a3288954 100644 --- a/egui-winit/src/lib.rs +++ b/egui-winit/src/lib.rs @@ -76,9 +76,9 @@ clippy::verbose_file_reads, clippy::zero_sized_map_values, future_incompatible, - missing_crate_level_docs, nonstandard_style, - rust_2018_idioms + rust_2018_idioms, + rustdoc::missing_crate_level_docs )] #![allow(clippy::float_cmp)] #![allow(clippy::manual_range_contains)] @@ -105,7 +105,7 @@ pub fn screen_size_in_pixels(window: &winit::window::Window) -> egui::Vec2 { /// Handles the integration between egui and winit. pub struct State { - start_time: std::time::Instant, + start_time: instant::Instant, egui_input: egui::RawInput, pointer_pos_in_points: Option, any_pointer_button_down: bool, @@ -137,7 +137,7 @@ impl State { /// Initialize with a given dpi scaling. pub fn from_pixels_per_point(pixels_per_point: f32) -> Self { Self { - start_time: std::time::Instant::now(), + start_time: instant::Instant::now(), egui_input: egui::RawInput { pixels_per_point: Some(pixels_per_point), ..Default::default() @@ -458,6 +458,9 @@ impl State { // https://github.com/rust-windowing/winit/issues/1695 being closed delta.x *= -1.0; } + if cfg!(target_os = "windows") { + delta.x *= -1.0; // until https://github.com/rust-windowing/winit/pull/2101 is merged + } if self.egui_input.modifiers.ctrl || self.egui_input.modifiers.command { // Treat as zoom instead: diff --git a/egui/Cargo.toml b/egui/Cargo.toml index d2091dde..6f9ed8b2 100644 --- a/egui/Cargo.toml +++ b/egui/Cargo.toml @@ -1,9 +1,10 @@ [package] name = "egui" -version = "0.15.0" +version = "0.16.1" authors = ["Emil Ernerfeldt "] description = "Simple, portable immediate mode GUI library for Rust" -edition = "2018" +edition = "2021" +rust-version = "1.56" homepage = "https://github.com/emilk/egui" license = "MIT OR Apache-2.0" readme = "../README.md" @@ -23,7 +24,7 @@ all-features = true [lib] [dependencies] -epaint = { version = "0.15.0", path = "../epaint", default-features = false } +epaint = { version = "0.16.0", path = "../epaint", default-features = false } ahash = "0.7" nohash-hasher = "0.2" diff --git a/egui/examples/README.md b/egui/examples/README.md new file mode 100644 index 00000000..44a9fe08 --- /dev/null +++ b/egui/examples/README.md @@ -0,0 +1,5 @@ +There are no stand-alone egui examples, because egui is not stand-alone! + +There are plenty of examples in [the online demo](https://emilk.github.io/egui/). You can find the source code for it at . + +If you are using `eframe`, check out [the `eframe` examples](https://github.com/emilk/egui/tree/master/eframe/examples) and [the `eframe` template repository](https://github.com/emilk/eframe_template/). diff --git a/egui/src/containers/collapsing_header.rs b/egui/src/containers/collapsing_header.rs index 9618b5b8..66c6b213 100644 --- a/egui/src/containers/collapsing_header.rs +++ b/egui/src/containers/collapsing_header.rs @@ -144,6 +144,7 @@ pub(crate) fn paint_icon(ui: &mut Ui, openness: f32, response: &Response) { pub struct CollapsingHeader { text: WidgetText, default_open: bool, + open: Option, id_source: Id, enabled: bool, selectable: bool, @@ -164,6 +165,7 @@ impl CollapsingHeader { Self { text, default_open: false, + open: None, id_source, enabled: true, selectable: false, @@ -179,6 +181,16 @@ impl CollapsingHeader { self } + /// Calling `.open(Some(true))` will make the collapsing header open this frame (or stay open). + /// + /// Calling `.open(Some(false))` will make the collapsing header close this frame (or stay closed). + /// + /// Calling `.open(None)` has no effect (default). + pub fn open(mut self, open: Option) -> Self { + self.open = open; + self + } + /// Explicitly set the source of the `Id` of this widget, instead of using title label. /// This is useful if the title label is dynamic or not unique. pub fn id_source(mut self, id_source: impl Hash) -> Self { @@ -186,12 +198,6 @@ impl CollapsingHeader { self } - #[deprecated = "Replaced by: CollapsingHeader::new(RichText::new(text).text_style(…))"] - pub fn text_style(mut self, text_style: TextStyle) -> Self { - self.text = self.text.text_style(text_style); - self - } - /// If you set this to `false`, the `CollapsingHeader` will be grayed out and un-clickable. /// /// This is a convenience for [`Ui::set_enabled`]. @@ -256,6 +262,7 @@ impl CollapsingHeader { let Self { text, default_open, + open, id_source, enabled: _, selectable: _, @@ -291,10 +298,16 @@ impl CollapsingHeader { ); let mut state = State::from_memory_with_default_open(ui.ctx(), id, default_open); - if header_response.clicked() { + if let Some(open) = open { + if open != state.open { + state.toggle(ui); + header_response.mark_changed(); + } + } else if header_response.clicked() { state.toggle(ui); header_response.mark_changed(); } + header_response .widget_info(|| WidgetInfo::labeled(WidgetType::CollapsingHeader, text.text())); diff --git a/egui/src/containers/scroll_area.rs b/egui/src/containers/scroll_area.rs index e6a70530..6bfc942a 100644 --- a/egui/src/containers/scroll_area.rs +++ b/egui/src/containers/scroll_area.rs @@ -733,13 +733,16 @@ impl Prepared { state.offset = state.offset.min(available_offset); state.offset = state.offset.max(Vec2::ZERO); - // Is scroll handle at end of content? If so enter sticky mode. + // Is scroll handle at end of content, or is there no scrollbar + // yet (not enough content), but sticking is requested? If so, enter sticky mode. // Only has an effect if stick_to_end is enabled but we save in // state anyway so that entering sticky mode at an arbitrary time // has appropriate effect. state.scroll_stuck_to_end = [ - state.offset[0] == available_offset[0], - state.offset[1] == available_offset[1], + (state.offset[0] == available_offset[0]) + || (self.stick_to_end[0] && available_offset[0] < 0.), + (state.offset[1] == available_offset[1]) + || (self.stick_to_end[1] && available_offset[1] < 0.), ]; state.show_scroll = show_scroll_this_frame; diff --git a/egui/src/context.rs b/egui/src/context.rs index 83032b2d..9e28348d 100644 --- a/egui/src/context.rs +++ b/egui/src/context.rs @@ -26,6 +26,9 @@ use epaint::{stats::*, text::Fonts, *}; /// /// [`CtxRef`] is cheap to clone, and any clones refers to the same mutable data. /// +/// A [`CtxRef`] is only valid for the duration of a frame, and so you should not store a [`CtxRef`] between frames. +/// A new [`CtxRef`] is created each frame by calling [`Self::run`]. +/// /// # Example: /// /// ``` no_run @@ -49,7 +52,6 @@ use epaint::{stats::*, text::Fonts, *}; /// paint(clipped_meshes); /// } /// ``` -/// #[derive(Clone)] pub struct CtxRef(std::sync::Arc); @@ -97,19 +99,54 @@ impl CtxRef { /// /// This will modify the internal reference to point to a new generation of [`Context`]. /// Any old clones of this [`CtxRef`] will refer to the old [`Context`], which will not get new input. + /// + /// You can alternatively run [`Self::begin_frame`] and [`Self::end_frame`]. + /// + /// ``` rust + /// // One egui context that you keep reusing: + /// let mut ctx = egui::CtxRef::default(); + /// + /// // Each frame: + /// let input = egui::RawInput::default(); + /// let (output, shapes) = ctx.run(input, |ctx| { + /// egui::CentralPanel::default().show(&ctx, |ui| { + /// ui.label("Hello egui!"); + /// }); + /// }); + /// // handle output, paint shapes + /// ``` #[must_use] pub fn run( &mut self, new_input: RawInput, run_ui: impl FnOnce(&CtxRef), ) -> (Output, Vec) { + self.begin_frame(new_input); + run_ui(self); + self.end_frame() + } + + /// An alternative to calling [`Self::run`]. + /// + /// ``` rust + /// // One egui context that you keep reusing: + /// let mut ctx = egui::CtxRef::default(); + /// + /// // Each frame: + /// let input = egui::RawInput::default(); + /// ctx.begin_frame(input); + /// + /// egui::CentralPanel::default().show(&ctx, |ui| { + /// ui.label("Hello egui!"); + /// }); + /// + /// let (output, shapes) = ctx.end_frame(); + /// // handle output, paint shapes + /// ``` + pub fn begin_frame(&mut self, new_input: RawInput) { let mut self_: Context = (*self.0).clone(); self_.begin_frame_mut(new_input); *self = Self(Arc::new(self_)); - - run_ui(self); - - self.end_frame() } // --------------------------------------------------------------------- @@ -299,6 +336,11 @@ impl CtxRef { memory.surrender_focus(id); } + if response.dragged() && !memory.has_focus(response.id) { + // e.g.: remove focus from a widget when you drag something else + memory.stop_text_input(); + } + response } @@ -311,30 +353,21 @@ impl CtxRef { pub fn debug_painter(&self) -> Painter { Self::layer_painter(self, LayerId::debug()) } - - /// Respond to secondary clicks (right-clicks) by showing the given menu. - pub(crate) fn show_context_menu( - &self, - response: &Response, - add_contents: impl FnOnce(&mut Ui), - ) { - self.context_menu_system() - .context_menu(response, add_contents); - } } // ---------------------------------------------------------------------------- -/// This is the first thing you need when working with egui. Create using [`CtxRef`]. +/// Your handle to egui. +/// +/// This is the first thing you need when working with egui. +/// Use [`CtxRef`] to create and refer to a [`Context`]. /// /// Contains the [`InputState`], [`Memory`], [`Output`], and more. /// -/// Your handle to Egui. -/// -/// Almost all methods are marked `&self`, `Context` has interior mutability (protected by mutexes). +/// Almost all methods are marked `&self`, [`Context`] has interior mutability (protected by mutexes). /// Multi-threaded access to a [`Context`] is behind the feature flag `multi_threaded`. /// Normally you'd always do all ui work on one thread, or perhaps use multiple contexts, -/// but if you really want to access the same Context from multiple threads, it *SHOULD* be fine, +/// but if you really want to access the same [`Context`] from multiple threads, it *SHOULD* be fine, /// but you are likely the first person to try it. #[derive(Default)] pub struct Context { @@ -343,7 +376,7 @@ pub struct Context { // This means everything else needs to be behind an Arc. // We can probably come up with a nicer design. // - /// None until first call to `begin_frame`. + /// `None` until the start of the first frame. fonts: Option>, memory: Arc>, animation_manager: Arc>, @@ -435,11 +468,12 @@ impl Context { .expect("No fonts available until first call to CtxRef::run()") } - /// The egui texture, containing font characters etc. + /// The egui font image, containing font characters etc. + /// /// Not valid until first call to [`CtxRef::run()`]. /// That's because since we don't know the proper `pixels_per_point` until then. - pub fn texture(&self) -> Arc { - self.fonts().texture() + pub fn font_image(&self) -> Arc { + self.fonts().font_image() } /// Tell `egui` which fonts to use. @@ -626,7 +660,7 @@ impl Context { /// Returns what has happened this frame [`crate::Output`] as well as what you need to paint. /// You can transform the returned shapes into triangles with a call to [`Context::tessellate`]. #[must_use] - fn end_frame(&self) -> (Output, Vec) { + pub fn end_frame(&self) -> (Output, Vec) { if self.input.wants_repaint() { self.request_repaint(); } @@ -664,7 +698,7 @@ impl Context { let clipped_meshes = tessellator::tessellate_shapes( shapes, tessellation_options, - self.fonts().texture().size(), + self.fonts().font_image().size(), ); *self.paint_stats.lock() = paint_stats.with_clipped_meshes(&clipped_meshes); clipped_meshes @@ -774,8 +808,15 @@ impl Context { /// Calling this with `value = false` will always yield a number less than one, quickly going towards zero. /// /// The function will call [`Self::request_repaint()`] when appropriate. + /// + /// The animation time is taken from [`Style::animation_time`]. pub fn animate_bool(&self, id: Id, value: bool) -> f32 { let animation_time = self.style().animation_time; + self.animate_bool_with_time(id, value, animation_time) + } + + /// Like [`Self::animate_bool`] but allows you to control the animation time. + pub fn animate_bool_with_time(&self, id: Id, value: bool, animation_time: f32) -> f32 { let animated_value = self.animation_manager .lock() @@ -808,7 +849,7 @@ impl Context { .show(ui, |ui| { let mut font_definitions = self.fonts().definitions().clone(); font_definitions.ui(ui); - self.fonts().texture().ui(ui); + self.fonts().font_image().ui(ui); self.set_fonts(font_definitions); }); diff --git a/egui/src/introspection.rs b/egui/src/introspection.rs index d1da680b..f6fe1273 100644 --- a/egui/src/introspection.rs +++ b/egui/src/introspection.rs @@ -1,7 +1,7 @@ //! uis for egui types. use crate::*; -impl Widget for &epaint::Texture { +impl Widget for &epaint::FontImage { fn ui(self, ui: &mut Ui) -> Response { use epaint::Mesh; diff --git a/egui/src/lib.rs b/egui/src/lib.rs index e35d5c2b..76ea7532 100644 --- a/egui/src/lib.rs +++ b/egui/src/lib.rs @@ -3,7 +3,7 @@ //! Try the live web demo: . Read more about egui at . //! //! `egui` is in heavy development, with each new version having breaking changes. -//! You need to have rust 1.54.0 or later to use `egui`. +//! You need to have rust 1.56.0 or later to use `egui`. //! //! To quickly get started with egui, you can take a look at [`eframe_template`](https://github.com/emilk/eframe_template) //! which uses [`eframe`](https://docs.rs/eframe). @@ -349,9 +349,9 @@ clippy::verbose_file_reads, clippy::zero_sized_map_values, future_incompatible, - missing_crate_level_docs, nonstandard_style, - rust_2018_idioms + rust_2018_idioms, + rustdoc::missing_crate_level_docs )] #![allow(clippy::float_cmp)] #![allow(clippy::manual_range_contains)] @@ -386,7 +386,7 @@ pub use emath::{lerp, pos2, remap, remap_clamp, vec2, Align, Align2, NumExt, Pos pub use epaint::{ color, mutex, text::{FontData, FontDefinitions, FontFamily, TextStyle}, - ClippedMesh, Color32, Rgba, Shape, Stroke, Texture, TextureId, + ClippedMesh, Color32, FontImage, Rgba, Shape, Stroke, TextureId, }; pub mod text { diff --git a/egui/src/memory.rs b/egui/src/memory.rs index b5350f5c..f8d615ed 100644 --- a/egui/src/memory.rs +++ b/egui/src/memory.rs @@ -327,13 +327,16 @@ impl Memory { self.interaction.focus.id } - pub(crate) fn lock_focus(&mut self, id: Id, lock_focus: bool) { + /// Prevent keyboard focus from moving away from this widget even if users presses the tab key. + /// You must first give focus to the widget before calling this. + pub fn lock_focus(&mut self, id: Id, lock_focus: bool) { if self.had_focus_last_frame(id) && self.has_focus(id) { self.interaction.focus.is_focus_locked = lock_focus; } } - pub(crate) fn has_lock_focus(&mut self, id: Id) -> bool { + /// Is the keyboard focus locked on this widget? If so the focus won't move even if the user presses the tab key. + pub fn has_lock_focus(&mut self, id: Id) -> bool { if self.had_focus_last_frame(id) && self.has_focus(id) { self.interaction.focus.is_focus_locked } else { diff --git a/egui/src/menu.rs b/egui/src/menu.rs index 18231460..986d695e 100644 --- a/egui/src/menu.rs +++ b/egui/src/menu.rs @@ -42,7 +42,7 @@ impl BarState { ctx.memory().data.insert_temp(bar_id, self); } - /// Show a menu at pointer if right-clicked response. + /// Show a menu at pointer if primary-clicked response. /// Should be called from [`Context`] on a [`Response`] pub fn bar_menu( &mut self, @@ -87,8 +87,11 @@ pub fn bar(ui: &mut Ui, add_contents: impl FnOnce(&mut Ui) -> R) -> InnerResp add_contents(ui) }) } + /// Construct a top level menu in a menu bar. This would be e.g. "File", "Edit" etc. /// +/// Responds to primary clicks. +/// /// Returns `None` if the menu is not open. pub fn menu_button( ui: &mut Ui, @@ -97,8 +100,11 @@ pub fn menu_button( ) -> InnerResponse> { stationary_menu_impl(ui, title, Box::new(add_contents)) } + /// Construct a nested sub menu in another menu. /// +/// Opens on hover. +/// /// Returns `None` if the menu is not open. pub(crate) fn submenu_button( ui: &mut Ui, @@ -150,7 +156,9 @@ pub(crate) fn menu_ui<'c, R>( inner_response } -/// build a top level menu with a button +/// Build a top level menu with a button. +/// +/// Responds to primary clicks. fn stationary_menu_impl<'c, R>( ui: &mut Ui, title: impl Into, @@ -275,7 +283,10 @@ impl MenuRoot { } (MenuResponse::Stay, None) } - /// interaction with a stationary menu, i.e. fixed in another Ui + + /// Interaction with a stationary menu, i.e. fixed in another Ui. + /// + /// Responds to primary clicks. fn stationary_interaction( response: &Response, root: &mut MenuRootManager, @@ -310,7 +321,8 @@ impl MenuRoot { } MenuResponse::Stay } - /// interaction with a context menu + + /// Interaction with a context menu (secondary clicks). fn context_interaction( response: &Response, root: &mut Option, @@ -328,10 +340,9 @@ impl MenuRoot { destroy = root.id == response.id; } if !in_old_menu { - let in_target = response.hovered(); - if in_target && pointer.secondary_down() { + if response.hovered() && pointer.secondary_down() { return MenuResponse::Create(pos, id); - } else if (in_target && pointer.primary_down()) || destroy { + } else if (response.hovered() && pointer.primary_down()) || destroy { return MenuResponse::Close; } } @@ -339,6 +350,7 @@ impl MenuRoot { } MenuResponse::Stay } + fn handle_menu_response(root: &mut MenuRootManager, menu_response: MenuResponse) { match menu_response { MenuResponse::Create(pos, id) => { @@ -348,11 +360,14 @@ impl MenuRoot { MenuResponse::Stay => {} } } + /// Respond to secondary (right) clicks. pub fn context_click_interaction(response: &Response, root: &mut MenuRootManager, id: Id) { let menu_response = Self::context_interaction(response, root, id); Self::handle_menu_response(root, menu_response); } + + // Responds to primary clicks. pub fn stationary_click_interaction(response: &Response, root: &mut MenuRootManager, id: Id) { let menu_response = Self::stationary_interaction(response, root, id); Self::handle_menu_response(root, menu_response); diff --git a/egui/src/painter.rs b/egui/src/painter.rs index f76838ce..d7717dcc 100644 --- a/egui/src/painter.rs +++ b/egui/src/painter.rs @@ -66,7 +66,7 @@ impl Painter { self.fade_to_color = fade_to_color; } - pub(crate) fn visible(&self) -> bool { + pub(crate) fn is_visible(&self) -> bool { self.fade_to_color != Some(Color32::TRANSPARENT) } diff --git a/egui/src/response.rs b/egui/src/response.rs index 177f66cd..5c0c54a2 100644 --- a/egui/src/response.rs +++ b/egui/src/response.rs @@ -437,13 +437,12 @@ impl Response { /// Move the scroll to this UI with the specified alignment. /// /// ``` - /// # use egui::Align; /// # egui::__run_test_ui(|ui| { /// egui::ScrollArea::vertical().show(ui, |ui| { /// for i in 0..1000 { - /// let response = ui.button(format!("Button {}", i)); + /// let response = ui.button("Scroll to me"); /// if response.clicked() { - /// response.scroll_to_me(Align::Center); + /// response.scroll_to_me(egui::Align::Center); /// } /// } /// }); @@ -490,8 +489,12 @@ impl Response { /// }); /// # }); /// ``` + /// + /// See also: [`Ui::menu_button`] and [`Ui::close_menu`]. pub fn context_menu(self, add_contents: impl FnOnce(&mut Ui)) -> Self { - self.ctx.show_context_menu(&self, add_contents); + self.ctx + .context_menu_system() + .context_menu(&self, add_contents); self } } diff --git a/egui/src/style.rs b/egui/src/style.rs index 137c426e..bb8159b4 100644 --- a/egui/src/style.rs +++ b/egui/src/style.rs @@ -154,10 +154,10 @@ impl Spacing { #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "serde", serde(default))] pub struct Interaction { - /// Mouse must be the close to the side of a window to resize + /// Mouse must be this close to the side of a window to resize pub resize_grab_radius_side: f32, - /// Mouse must be the close to the corner of a window to resize + /// Mouse must be this close to the corner of a window to resize pub resize_grab_radius_corner: f32, /// If `false`, tooltips will show up anytime you hover anything, even is mouse is still moving diff --git a/egui/src/ui.rs b/egui/src/ui.rs index bdccf422..956e12b8 100644 --- a/egui/src/ui.rs +++ b/egui/src/ui.rs @@ -119,6 +119,8 @@ impl Ui { } /// Style options for this `Ui` and its children. + /// + /// Note that this may be a different [`Style`] than that of [`Context::style`]. #[inline] pub fn style(&self) -> &std::sync::Arc