modal: Use bold text for Modal title. (#715)

<img width="995" alt="image"
src="https://github.com/user-attachments/assets/3e9ba919-eb91-4e8d-ba89-3a85e263e550"
/>
This commit is contained in:
Jason Lee 2025-03-12 11:57:59 +08:00 committed by GitHub
parent 6da7de5299
commit 87b8958059
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

@ -187,6 +187,7 @@ impl RenderOnce for Drawer {
.px_4()
.py_2()
.w_full()
.font_semibold()
.child(self.title.unwrap_or(div().into_any_element()))
.child(
Button::new("close")

View file

@ -11,7 +11,7 @@ use rust_i18n::t;
use crate::{
animation::cubic_bezier,
button::{Button, ButtonVariant, ButtonVariants as _},
h_flex, v_flex, ActiveTheme as _, ContextModal, IconName, Sizable as _,
h_flex, v_flex, ActiveTheme as _, ContextModal, IconName, Sizable as _, StyledExt,
};
actions!(modal, [Escape, Enter]);
@ -411,7 +411,9 @@ impl RenderOnce for Modal {
.w(self.width)
.when_some(self.max_width, |this, w| this.max_w(w))
.when_some(self.title, |this, title| {
this.child(div().line_height(relative(1.)).child(title))
this.child(
div().font_semibold().line_height(relative(1.)).child(title),
)
})
.when(self.show_close, |this| {
this.child(