From edd758eb67e8d2d11a961d2d449cc4938aa7db35 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 16 Jun 2022 10:40:12 +0200 Subject: [PATCH] Cap context menu's width to cover at most 70% of the window --- crates/editor/src/element.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index c3d6614f23..5d906a9678 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -1264,7 +1264,7 @@ impl Element for EditorElement { SizeConstraint { min: Vector2F::zero(), max: vec2f( - f32::INFINITY, + cx.window_size.x() * 0.7, (12. * line_height).min((size.y() - line_height) / 2.), ), },