Use custom color wrapper type everywhere in gpui & zed

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld
2021-08-03 12:48:58 -07:00
co-authored by Nathan Sobo
parent fa01273466
commit ef0ffbe819
20 changed files with 319 additions and 233 deletions
+8 -8
View File
@@ -9,7 +9,7 @@ use crate::{
};
use futures::lock::Mutex;
use gpui::{
color::ColorF,
color::Color,
elements::{
Align, ChildView, ConstrainedBox, Container, Expanded, Flex, Label, LabelStyle,
ParentElement, UniformList, UniformListState,
@@ -199,7 +199,7 @@ impl ThemeSelector {
settings.ui_font_family,
settings.ui_font_size,
)
.with_default_color(settings.theme.editor.default_text.0)
.with_default_color(settings.theme.editor.default_text)
.boxed(),
)
.with_margin_top(6.0)
@@ -241,9 +241,9 @@ impl ThemeSelector {
settings.ui_font_size,
)
.with_style(&LabelStyle {
default_color: theme.modal_match_text.0,
highlight_color: theme.modal_match_text_highlight.0,
highlight_font_properties: *Properties::new().weight(Weight::BOLD),
color: theme.modal_match_text,
highlight_color: Some(theme.modal_match_text_highlight),
highlight_font_properties: Some(*Properties::new().weight(Weight::BOLD)),
..Default::default()
})
.with_highlights(theme_match.positions.clone())
@@ -251,9 +251,9 @@ impl ThemeSelector {
)
.with_uniform_padding(6.0)
.with_background_color(if index == self.selected_index {
theme.modal_match_background_active.0
theme.modal_match_background_active
} else {
theme.modal_match_background.0
theme.modal_match_background
});
if index == self.selected_index || index < self.matches.len() - 1 {
@@ -288,7 +288,7 @@ impl View for ThemeSelector {
.with_uniform_padding(6.0)
.with_corner_radius(6.0)
.with_background_color(settings.theme.ui.modal_background)
.with_shadow(vec2f(0., 4.), 12., ColorF::new(0.0, 0.0, 0.0, 0.5).to_u8())
.with_shadow(vec2f(0., 4.), 12., Color::new(0, 0, 0, 128))
.boxed(),
)
.with_max_width(600.0)