feat: unify theme system (#7)

Reviewed-on: #7
This commit was merged in pull request #7.
This commit is contained in:
2026-11-16 12:58:32 +00:00
parent 745a01d7af
commit aed3601c89
47 changed files with 888 additions and 1875 deletions
+8 -10
View File
@@ -8,7 +8,7 @@ use gpui::{
Styled as _, Window, canvas, deferred, div, ease_out_quint, relative,
};
use gpui_native_icons::IconRole;
use gpui_native_theme::{ActiveTheme as _, TextRole, Typeset as _};
use gpui_native_theme::{ActiveTheme as _, DIALOG_MIN_WIDTH, TextRole, Typeset as _};
use crate::button::{Button, ButtonVariant};
use crate::common::{DIALOG_LAYER, Sizable, StyledExt as _, v_flex};
@@ -160,11 +160,7 @@ impl RenderOnce for Dialog {
let theme = cx.theme();
(
theme.colors.overlay,
if theme.borders.overlays {
theme.colors.border
} else {
theme.colors.surface
},
theme.colors.border,
theme.colors.foreground,
theme.colors.surface,
theme.radius.overlay,
@@ -207,11 +203,13 @@ impl RenderOnce for Dialog {
.role(role)
.aria_label(label)
.when_some(self.min_width, |panel, width| panel.min_w(width))
.when(self.min_width.is_none(), |panel| panel.min_w_80())
.when(self.min_width.is_none(), |panel| {
panel.min_w(DIALOG_MIN_WIDTH)
})
.max_w(relative(0.9))
.when_some(height, |panel, height| panel.h(height))
.p_4()
.gap_3()
.gap_4()
.bg(surface)
.text_color(foreground)
.rounded(radius)
@@ -247,7 +245,7 @@ impl RenderOnce for Dialog {
Button::new("dialog-close")
.icon(IconRole::Close)
.variant(ButtonVariant::Ghost)
.small()
.xsmall()
.debug_selector(|| "dialog-close".to_string())
.accessibility_label("Close")
.on_click({
@@ -278,7 +276,7 @@ impl RenderOnce for Dialog {
})
})
.when_some(actions, |panel, actions| {
panel.child(div().flex().justify_end().gap_2().children(actions))
panel.child(div().flex().justify_end().gap_3().children(actions))
})
.child(
canvas(|_, _, _| {}, {