core: use typography roles for text styling

This commit is contained in:
2026-11-12 19:09:51 +07:00
parent 9528dcc54e
commit e2ec1fa7c2
6 changed files with 25 additions and 36 deletions
+4 -11
View File
@@ -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(