core: use typography roles for text styling
This commit is contained in:
@@ -2,13 +2,13 @@ use gpui::prelude::FluentBuilder as _;
|
||||
use std::rc::Rc;
|
||||
|
||||
use gpui::{
|
||||
Animation, AnimationExt as _, AnyElement, App, DefiniteLength, ElementId, FontWeight,
|
||||
Animation, AnimationExt as _, AnyElement, App, DefiniteLength, ElementId,
|
||||
InteractiveElement as _, IntoElement, KeyDownEvent, MouseButton, ParentElement as _,
|
||||
RenderOnce, Role, ScrollHandle, SharedString, StatefulInteractiveElement as _, Styled as _,
|
||||
Window, canvas, div, ease_out_quint, relative,
|
||||
};
|
||||
use gpui_native_icons::IconRole;
|
||||
use gpui_native_theme::ActiveTheme as _;
|
||||
use gpui_native_theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
|
||||
use crate::button::{Button, ButtonVariant};
|
||||
use crate::common::{Sizable, v_flex};
|
||||
@@ -139,7 +139,7 @@ impl RenderOnce for Dialog {
|
||||
return root;
|
||||
}
|
||||
|
||||
let (scrim_color, border, foreground, surface, radius, shadows, title_size, enter_duration) = {
|
||||
let (scrim_color, border, foreground, surface, radius, shadows, enter_duration) = {
|
||||
let theme = cx.theme();
|
||||
(
|
||||
theme.colors.overlay,
|
||||
@@ -152,7 +152,6 @@ impl RenderOnce for Dialog {
|
||||
theme.colors.surface,
|
||||
theme.radius.overlay,
|
||||
theme.elevations.dialog.shadows(),
|
||||
theme.sizes.medium.text_size,
|
||||
theme.motion.overlay,
|
||||
)
|
||||
};
|
||||
@@ -224,13 +223,7 @@ impl RenderOnce for Dialog {
|
||||
.justify_end()
|
||||
.gap_2()
|
||||
.when_some(self.title.clone(), |row, title| {
|
||||
row.child(
|
||||
div()
|
||||
.flex_1()
|
||||
.text_size(title_size)
|
||||
.font_weight(FontWeight::SEMIBOLD)
|
||||
.child(title),
|
||||
)
|
||||
row.child(div().flex_1().typeset(TextRole::Title3, cx).child(title))
|
||||
})
|
||||
.when(show_close, |row| {
|
||||
row.child(
|
||||
|
||||
Reference in New Issue
Block a user