This commit is contained in:
Antonio Scandurra 2023-08-24 17:23:12 +02:00
parent cbf7160054
commit 805e44915c
3 changed files with 10 additions and 12 deletions

View file

@ -40,7 +40,12 @@ impl View for RefactoringModal {
} }
fn render(&mut self, cx: &mut ViewContext<Self>) -> AnyElement<Self> { fn render(&mut self, cx: &mut ViewContext<Self>) -> AnyElement<Self> {
let theme = theme::current(cx);
ChildView::new(&self.prompt_editor, cx) ChildView::new(&self.prompt_editor, cx)
.aligned()
.left()
.contained()
.with_style(theme.assistant.modal.container)
.mouse::<Self>(0) .mouse::<Self>(0)
.on_click_out(MouseButton::Left, |_, _, cx| cx.emit(Event::Dismissed)) .on_click_out(MouseButton::Left, |_, _, cx| cx.emit(Event::Dismissed))
.on_click_out(MouseButton::Right, |_, _, 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) ChildView::new(&refactoring, cx)
.contained() .contained()
.with_padding_left(cx.gutter_width) .with_padding_left(cx.gutter_width)
.aligned()
.left()
.into_any() .into_any()
} }
}), }),

View file

@ -1131,8 +1131,6 @@ pub struct AssistantStyle {
pub struct ModalAssistantStyle { pub struct ModalAssistantStyle {
#[serde(flatten)] #[serde(flatten)]
pub container: ContainerStyle, pub container: ContainerStyle,
pub width: f32,
pub editor_max_lines: usize,
pub editor: FieldEditor, pub editor: FieldEditor,
} }

View file

@ -60,14 +60,11 @@ export default function assistant(): any {
padding: { left: 12 }, padding: { left: 12 },
}, },
modal: { modal: {
background: background(theme.lowest), border: border(theme.lowest, "on", {
border: border(theme.lowest), top: true,
shadow: theme.modal_shadow, bottom: true,
corner_radius: 12, overlay: true,
padding: { left: 12, right: 0, top: 12, bottom: 12 }, }),
margin: { right: 12 },
width: 500,
editor_max_lines: 6,
editor: { editor: {
text: text(theme.lowest, "mono", "on", { size: "sm" }), text: text(theme.lowest, "mono", "on", { size: "sm" }),
placeholder_text: text(theme.lowest, "sans", "on", "disabled"), placeholder_text: text(theme.lowest, "sans", "on", "disabled"),