From 51266e9172cfd960445eae23a23f318d5481631d Mon Sep 17 00:00:00 2001 From: Lucas Meurer Date: Mon, 2 Sep 2024 13:11:32 +0200 Subject: [PATCH] Example improvements --- crates/egui_demo_lib/src/demo/demo_app_windows.rs | 3 ++- crates/egui_demo_lib/src/demo/interactive_container.rs | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/egui_demo_lib/src/demo/demo_app_windows.rs b/crates/egui_demo_lib/src/demo/demo_app_windows.rs index 6797844f6e9..d55cc6aff3f 100644 --- a/crates/egui_demo_lib/src/demo/demo_app_windows.rs +++ b/crates/egui_demo_lib/src/demo/demo_app_windows.rs @@ -259,7 +259,8 @@ impl DemoWindows { fn desktop_ui(&mut self, ctx: &Context) { egui::SidePanel::right("egui_demo_panel") .resizable(false) - .default_width(150.0) + .default_width(160.0) + .min_width(160.0) .show(ctx, |ui| { ui.add_space(4.0); ui.vertical_centered(|ui| { diff --git a/crates/egui_demo_lib/src/demo/interactive_container.rs b/crates/egui_demo_lib/src/demo/interactive_container.rs index 4de0ff70c76..083d4eb0c1a 100644 --- a/crates/egui_demo_lib/src/demo/interactive_container.rs +++ b/crates/egui_demo_lib/src/demo/interactive_container.rs @@ -17,6 +17,7 @@ impl crate::Demo for InteractiveContainerDemo { egui::Window::new(self.name()) .open(open) .resizable(false) + .default_width(250.0) .show(ctx, |ui| { use crate::View as _; self.ui(ui); @@ -30,7 +31,12 @@ impl crate::View for InteractiveContainerDemo { ui.add(crate::egui_github_link_file!()); }); - ui.label("This demo showcases how to use Ui::read_response to create interactive container widgets that may contain other widgets."); + ui.horizontal_wrapped(|ui| { + ui.spacing_mut().item_spacing.x = 0.0; + ui.label("This demo showcases how to use "); + ui.code("Ui::read_response"); + ui.label(" to create interactive container widgets that may contain other widgets."); + }); let response = ui .scope_builder(