Add support for dashed borders to GPUI (#27139)
Features: * Scales dash spacing with border width. * Laying out dashes around rounded corners. * Varying border widths with rounded corners - now uses an ellipse for the inner edge of the border. * When there are no rounded corners, each straight border is laid out separately, so that the dashes to meet at the corners. * All sides of each dash are antialiased.   Release Notes: - N/A --------- Co-authored-by: Michael Sloan <michael@zed.dev> Co-authored-by: Ben <ben@zed.dev>
This commit is contained in:
parent
2fe2028e20
commit
cd1e56d6c7
14 changed files with 869 additions and 159 deletions
|
@ -803,9 +803,9 @@ mod element {
|
|||
use std::{cell::RefCell, iter, rc::Rc, sync::Arc};
|
||||
|
||||
use gpui::{
|
||||
px, relative, size, Along, AnyElement, App, Axis, Bounds, Element, GlobalElementId,
|
||||
IntoElement, MouseDownEvent, MouseMoveEvent, MouseUpEvent, ParentElement, Pixels, Point,
|
||||
Size, Style, WeakEntity, Window,
|
||||
px, relative, size, Along, AnyElement, App, Axis, BorderStyle, Bounds, Element,
|
||||
GlobalElementId, IntoElement, MouseDownEvent, MouseMoveEvent, MouseUpEvent, ParentElement,
|
||||
Pixels, Point, Size, Style, WeakEntity, Window,
|
||||
};
|
||||
use gpui::{CursorStyle, Hitbox};
|
||||
use parking_lot::Mutex;
|
||||
|
@ -1165,6 +1165,7 @@ mod element {
|
|||
gpui::transparent_black(),
|
||||
border,
|
||||
cx.theme().colors().border_selected,
|
||||
BorderStyle::Solid,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue