From f0a45f5055495e6bdd3490e416be14b92e6992dd Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 12 Oct 2020 08:37:56 +0200 Subject: [PATCH] [refactor] Simplify Context with new `struct Options` --- egui/src/context.rs | 50 ++++++++++++++++++++++------------- egui/src/paint/tessellator.rs | 2 +- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/egui/src/context.rs b/egui/src/context.rs index cd36d31c..2463fa1c 100644 --- a/egui/src/context.rs +++ b/egui/src/context.rs @@ -18,19 +18,28 @@ struct PaintStats { num_triangles: usize, } -// TODO: too many mutexes. Maybe put it all behind one Mutex instead. -/// Contains the input, style and output of all GUI commands. -/// `Ui`:s keep an Arc pointer to this. +#[derive(Clone, Debug, Default)] +struct Options { + /// The default style for new `Ui`:s. + style: Arc