Constrain context menu to the width of the widest item

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2022-05-25 14:24:53 +02:00
parent f403d87eff
commit 3b2f1644fb
8 changed files with 200 additions and 93 deletions

View file

@ -524,6 +524,15 @@ impl SizeConstraint {
}
}
impl Default for SizeConstraint {
fn default() -> Self {
SizeConstraint {
min: Vector2F::zero(),
max: Vector2F::splat(f32::INFINITY),
}
}
}
impl ToJson for SizeConstraint {
fn to_json(&self) -> serde_json::Value {
json!({