Merge pull request #1196 from zed-industries/context-menu-max-width

Cap context menu's width to cover at most 70% of the window
This commit is contained in:
Antonio Scandurra 2022-06-16 10:51:04 +02:00 committed by GitHub
commit fcd99c865e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.),
),
},