Merge branch 'main' into element-types
This commit is contained in:
commit
7f72df6dcf
27 changed files with 3714 additions and 1471 deletions
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue