Add Corner to geometry and make names of corner methods consistent (#22119)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2024-12-16 22:57:15 -07:00 committed by GitHub
parent 3052fc2565
commit fc5a810408
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 325 additions and 254 deletions

View file

@ -73,17 +73,17 @@ fn render_color_ribbon(color: Hsla) -> impl Element {
let height = bounds.size.height;
let horizontal_offset = height;
let vertical_offset = px(height.0 / 2.0);
let mut path = Path::new(bounds.lower_left());
let mut path = Path::new(bounds.bottom_left());
path.curve_to(
bounds.origin + point(horizontal_offset, vertical_offset),
bounds.origin + point(px(0.0), vertical_offset),
);
path.line_to(bounds.upper_right() + point(-horizontal_offset, vertical_offset));
path.line_to(bounds.top_right() + point(-horizontal_offset, vertical_offset));
path.curve_to(
bounds.lower_right(),
bounds.upper_right() + point(px(0.0), vertical_offset),
bounds.bottom_right(),
bounds.top_right() + point(px(0.0), vertical_offset),
);
path.line_to(bounds.lower_left());
path.line_to(bounds.bottom_left());
cx.paint_path(path, color);
},
)

View file

@ -615,7 +615,7 @@ impl TitleBar {
.style(ButtonStyle::Subtle)
.tooltip(move |cx| Tooltip::text("Toggle User Menu", cx)),
)
.anchor(gpui::AnchorCorner::TopRight)
.anchor(gpui::Corner::TopRight)
} else {
PopoverMenu::new("user-menu")
.menu(|cx| {