From 805e44915cdcb9e96879ea472879a2827dfe4d40 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 24 Aug 2023 17:23:12 +0200 Subject: [PATCH] WIP --- crates/ai/src/refactoring_modal.rs | 7 +++++-- crates/theme/src/theme.rs | 2 -- styles/src/style_tree/assistant.ts | 13 +++++-------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/crates/ai/src/refactoring_modal.rs b/crates/ai/src/refactoring_modal.rs index 2203acc921c02ff6764fd84d7f1fda26c3179ee0..675e0fae99dc593f6d7dedf9b9090e0a7cabcf27 100644 --- a/crates/ai/src/refactoring_modal.rs +++ b/crates/ai/src/refactoring_modal.rs @@ -40,7 +40,12 @@ impl View for RefactoringModal { } fn render(&mut self, cx: &mut ViewContext) -> AnyElement { + let theme = theme::current(cx); ChildView::new(&self.prompt_editor, cx) + .aligned() + .left() + .contained() + .with_style(theme.assistant.modal.container) .mouse::(0) .on_click_out(MouseButton::Left, |_, _, cx| cx.emit(Event::Dismissed)) .on_click_out(MouseButton::Right, |_, _, cx| cx.emit(Event::Dismissed)) @@ -93,8 +98,6 @@ impl RefactoringModal { ChildView::new(&refactoring, cx) .contained() .with_padding_left(cx.gutter_width) - .aligned() - .left() .into_any() } }), diff --git a/crates/theme/src/theme.rs b/crates/theme/src/theme.rs index a42a8932416f3d6d6ef67fbfeba6a56e88d8d0ea..ebc959123933f9bb3f6e3ef8b7f6a9c1634f1c89 100644 --- a/crates/theme/src/theme.rs +++ b/crates/theme/src/theme.rs @@ -1131,8 +1131,6 @@ pub struct AssistantStyle { pub struct ModalAssistantStyle { #[serde(flatten)] pub container: ContainerStyle, - pub width: f32, - pub editor_max_lines: usize, pub editor: FieldEditor, } diff --git a/styles/src/style_tree/assistant.ts b/styles/src/style_tree/assistant.ts index a02d7eb40c39d76be2dbe175022f67b0c88c71a4..ac91d1118de351d5dfda0ec7b3062d053cca3c5e 100644 --- a/styles/src/style_tree/assistant.ts +++ b/styles/src/style_tree/assistant.ts @@ -60,14 +60,11 @@ export default function assistant(): any { padding: { left: 12 }, }, modal: { - background: background(theme.lowest), - border: border(theme.lowest), - shadow: theme.modal_shadow, - corner_radius: 12, - padding: { left: 12, right: 0, top: 12, bottom: 12 }, - margin: { right: 12 }, - width: 500, - editor_max_lines: 6, + border: border(theme.lowest, "on", { + top: true, + bottom: true, + overlay: true, + }), editor: { text: text(theme.lowest, "mono", "on", { size: "sm" }), placeholder_text: text(theme.lowest, "sans", "on", "disabled"),