Mainline GPUI2 UI work (#3099)

This PR mainlines the current state of new GPUI2-based UI from the
`gpui2-ui` branch.

Included in this is a performance improvement to make use of the
`TextLayoutCache` when calling `layout` for `Text` elements.

Release Notes:

- N/A

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
Marshall Bowers 2023-10-06 13:18:56 -04:00 committed by GitHub
parent c46137e40d
commit 456baaa112
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 371 additions and 19 deletions

View file

@ -29,6 +29,26 @@ impl SystemColor {
}
}
#[derive(Clone, Copy)]
pub struct ThemeColor {
pub border: Hsla,
pub border_variant: Hsla,
/// The background color of an elevated surface, like a modal, tooltip or toast.
pub elevated_surface: Hsla,
}
impl ThemeColor {
pub fn new(cx: &WindowContext) -> Self {
let theme = theme(cx);
Self {
border: theme.lowest.base.default.border,
border_variant: theme.lowest.variant.default.border,
elevated_surface: theme.middle.base.default.background,
}
}
}
#[derive(Default, PartialEq, EnumIter, Clone, Copy)]
pub enum HighlightColor {
#[default]