mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 06:10:06 -04:00
Put everything in Context behind the same Mutex (#1050)
* Move all interior mutability from Context to CtxRef and make it a handle * Rename `CtxRef` to `Context` * The old `Context` is now `ContextImpl` and is non-pub * Add benchmark Painter::rect Co-authored-by: Daniel Keller <dklr433@gmail.com>
This commit is contained in:
@@ -34,7 +34,7 @@ impl epi::App for EasyMarkEditor {
|
||||
"🖹 EasyMark editor"
|
||||
}
|
||||
|
||||
fn update(&mut self, ctx: &egui::CtxRef, _frame: &epi::Frame) {
|
||||
fn update(&mut self, ctx: &egui::Context, _frame: &epi::Frame) {
|
||||
egui::TopBottomPanel::bottom("easy_mark_bottom").show(ctx, |ui| {
|
||||
let layout = egui::Layout::top_down(egui::Align::Center).with_main_justify(true);
|
||||
ui.allocate_ui_with_layout(ui.available_size(), layout, |ui| {
|
||||
|
||||
@@ -18,7 +18,8 @@ pub fn easy_mark_it<'em>(ui: &mut Ui, items: impl Iterator<Item = easy_mark::Ite
|
||||
|
||||
ui.allocate_ui_with_layout(initial_size, layout, |ui| {
|
||||
ui.spacing_mut().item_spacing.x = 0.0;
|
||||
ui.set_row_height(ui.fonts()[TextStyle::Body].row_height());
|
||||
let row_height = (*ui.fonts())[TextStyle::Body].row_height();
|
||||
ui.set_row_height(row_height);
|
||||
|
||||
for item in items {
|
||||
item_ui(ui, item);
|
||||
|
||||
Reference in New Issue
Block a user