introduce typography system and motion module
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
use gpui::prelude::FluentBuilder;
|
||||
use gpui::{
|
||||
App, AppContext, Context, Entity, IntoElement, ParentElement, Render, SharedString, Styled,
|
||||
Window, px, relative,
|
||||
Window, px,
|
||||
};
|
||||
use gpui_base::Tooltip as BaseTooltip;
|
||||
use theme::{ActiveTheme, control_radius};
|
||||
use theme::{ActiveTheme, TextStyle, Typeset as _, control_radius};
|
||||
|
||||
pub struct Tooltip {
|
||||
text: SharedString,
|
||||
@@ -19,7 +19,7 @@ impl Tooltip {
|
||||
impl Render for Tooltip {
|
||||
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
||||
BaseTooltip::new("tooltip")
|
||||
.font_family(".SystemUIFont")
|
||||
.font_family(cx.theme().font_sans.clone())
|
||||
.m_3()
|
||||
.p_1p5()
|
||||
.border_1()
|
||||
@@ -27,9 +27,8 @@ impl Render for Tooltip {
|
||||
.bg(cx.theme().surface_overlay)
|
||||
.when(cx.theme().shadow, |this| this.shadow_sm())
|
||||
.rounded(px(control_radius()))
|
||||
.text_xs()
|
||||
.text_style(TextStyle::Caption)
|
||||
.text_color(cx.theme().text)
|
||||
.line_height(relative(1.25))
|
||||
.child(self.text.clone())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user