Merge branch 'main' into element-types

This commit is contained in:
Mikayla 2023-11-14 15:49:10 -08:00
commit 7f72df6dcf
No known key found for this signature in database
27 changed files with 3714 additions and 1471 deletions

View file

@ -129,7 +129,7 @@ impl Icon {
#[derive(Component)]
pub struct IconElement {
icon: Icon,
path: SharedString,
color: TextColor,
size: IconSize,
}
@ -137,7 +137,15 @@ pub struct IconElement {
impl IconElement {
pub fn new(icon: Icon) -> Self {
Self {
icon,
path: icon.path().into(),
color: TextColor::default(),
size: IconSize::default(),
}
}
pub fn from_path(path: impl Into<SharedString>) -> Self {
Self {
path: path.into(),
color: TextColor::default(),
size: IconSize::default(),
}
@ -162,7 +170,7 @@ impl IconElement {
svg()
.size(svg_size)
.flex_none()
.path(self.icon.path())
.path(self.path)
.text_color(self.color.color(cx))
}
}

View file

@ -1,5 +1,6 @@
use gpui::{Div, ParentComponent, Render, SharedString, Styled, ViewContext};
use theme2::ActiveTheme;
use gpui::{Div, Render};
use settings2::Settings;
use theme2::{ActiveTheme, ThemeSettings};
use crate::prelude::*;
use crate::{h_stack, v_stack, KeyBinding, Label, LabelSize, StyledExt, TextColor};
@ -34,9 +35,10 @@ impl Render for TextTooltip {
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
let ui_font = ThemeSettings::get_global(cx).ui_font.family.clone();
v_stack()
.elevation_2(cx)
.font("Zed Sans")
.font(ui_font)
.text_ui_sm()
.text_color(cx.theme().colors().text)
.py_1()

View file

@ -206,13 +206,14 @@ impl Render for Workspace {
.child(self.editor_1.clone())],
SplitDirection::Horizontal,
);
let ui_font = ThemeSettings::get_global(cx).ui_font.family.clone();
div()
.relative()
.size_full()
.flex()
.flex_col()
.font("Zed Sans")
.font(ui_font)
.gap_0()
.justify_start()
.items_start()