diff --git a/examples/custom_window_frame/src/main.rs b/examples/custom_window_frame/src/main.rs index e4110d01c..d6a35416b 100644 --- a/examples/custom_window_frame/src/main.rs +++ b/examples/custom_window_frame/src/main.rs @@ -84,15 +84,6 @@ fn custom_window_frame( Stroke::new(1.0, text_color), ); - // Add the close button: - let close_response = ui.put( - Rect::from_min_size(rect.left_top(), Vec2::splat(height)), - Button::new(RichText::new("❌").size(height - 4.0)).frame(false), - ); - if close_response.clicked() { - frame.close(); - } - // Interact with the title bar (drag to move window): let title_bar_rect = { let mut rect = rect; @@ -105,6 +96,15 @@ fn custom_window_frame( frame.drag_window(); } + // Add the close button: + let close_response = ui.put( + Rect::from_min_size(rect.left_top(), Vec2::splat(height)), + Button::new(RichText::new("❌").size(height - 4.0)).frame(false), + ); + if close_response.clicked() { + frame.close(); + } + // Add the contents: let content_rect = { let mut rect = rect;