From e0a8e8f36a45b2db6a12308a4932b62cde68d733 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 8 Nov 2021 23:24:48 +0100 Subject: [PATCH] Add multipass option and checkbox --- egui/src/memory.rs | 5 +++++ egui_demo_lib/src/backend_panel.rs | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/egui/src/memory.rs b/egui/src/memory.rs index f8d615ed..8aa9a48a 100644 --- a/egui/src/memory.rs +++ b/egui/src/memory.rs @@ -100,6 +100,11 @@ pub struct Options { /// but is a signal to any backend that we want the [`crate::Output::events`] read out loud. /// Screen readers is an experimental feature of egui, and not supported on all platforms. pub screen_reader: bool, + + /// Enable experimental two-pass layout. + /// + /// See https://github.com/emilk/egui/issues/843 + pub multi_pass: bool, } // ---------------------------------------------------------------------------- diff --git a/egui_demo_lib/src/backend_panel.rs b/egui_demo_lib/src/backend_panel.rs index 170d7081..7049db61 100644 --- a/egui_demo_lib/src/backend_panel.rs +++ b/egui_demo_lib/src/backend_panel.rs @@ -132,6 +132,13 @@ impl BackendPanel { ui.ctx().memory().options.screen_reader = screen_reader; } + { + let mut multi_pass = ui.ctx().memory().options.multi_pass; + ui.checkbox(&mut multi_pass, "☯ Multipass (experimental)") + .on_hover_text("Experimental two-pass layout"); + ui.ctx().memory().options.multi_pass = multi_pass; + } + if !frame.is_web() { ui.separator(); if ui.button("Quit").clicked() {