mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-09-22 00:02:23 +00:00
fix(settings): round the theme card the way the theme panel rounds it
The Appearance page and the theme panel draw the same object — a theme preview, its name, a border — and drew it differently. The page card was rounded_xl, the only 12px corner in the app, while the panel card that opens from it uses TRACK_RADIUS. Worse, the preview inside the page card kept its own 8px corners inside a 12px border, the concentric mismatch that rounding::inner_radius exists to prevent; the panel already insets its copy of that same preview. Both now use TRACK_RADIUS with the preview inset by the hairline, and theme_preview names the token instead of repeating its value.
This commit is contained in:
+8
-3
@@ -4526,7 +4526,7 @@ impl Tty7App {
|
||||
v_flex()
|
||||
.w_full()
|
||||
.bg(rgb(p.background_color()))
|
||||
.rounded(px(8.))
|
||||
.rounded(rounding::TRACK_RADIUS)
|
||||
.overflow_hidden()
|
||||
.px_3()
|
||||
.py_3()
|
||||
@@ -4633,7 +4633,12 @@ impl Tty7App {
|
||||
.rounded(px(3.))
|
||||
.bg(rgb(to_u32(active.ansi16[i])))
|
||||
}));
|
||||
let preview = self.theme_preview(&active);
|
||||
// Inset inside the card's border, the way the same preview is inset
|
||||
// inside the same card in the theme panel.
|
||||
let preview = self.theme_preview(&active).rounded(rounding::inner_radius(
|
||||
rounding::TRACK_RADIUS,
|
||||
rounding::HAIRLINE,
|
||||
));
|
||||
let open = self
|
||||
.active_settings()
|
||||
.is_some_and(|s| s.theme_panel_open && s.theme_panel_slot == slot);
|
||||
@@ -4653,7 +4658,7 @@ impl Tty7App {
|
||||
.items_center()
|
||||
.gap_4()
|
||||
.p_3()
|
||||
.rounded_xl()
|
||||
.rounded(rounding::TRACK_RADIUS)
|
||||
.border_1()
|
||||
.border_color(if open {
|
||||
foreground.opacity(0.35)
|
||||
|
||||
Reference in New Issue
Block a user