Improve styling of the go to line modal

This commit is contained in:
Nathan Sobo 2021-11-24 16:16:29 -07:00
parent 1e49b56626
commit a07fe3aa58

View file

@ -1,8 +1,8 @@
use buffer::{Bias, Point, Selection}; use buffer::{Bias, Point, Selection};
use editor::{Autoscroll, Editor, EditorSettings}; use editor::{Autoscroll, Editor, EditorSettings};
use gpui::{ use gpui::{
action, elements::*, geometry::vector::Vector2F, keymap::Binding, Entity, MutableAppContext, action, elements::*, geometry::vector::Vector2F, keymap::Binding, Axis, Entity,
RenderContext, View, ViewContext, ViewHandle, MutableAppContext, RenderContext, View, ViewContext, ViewHandle,
}; };
use postage::watch; use postage::watch;
use workspace::{Settings, Workspace}; use workspace::{Settings, Workspace};
@ -50,7 +50,7 @@ impl GoToLine {
let settings = settings.borrow(); let settings = settings.borrow();
EditorSettings { EditorSettings {
tab_size: settings.tab_size, tab_size: settings.tab_size,
style: settings.theme.editor.clone(), style: settings.theme.selector.input_editor.as_editor(),
} }
} }
}, },
@ -159,12 +159,19 @@ impl View for GoToLine {
} }
fn render(&mut self, _: &mut RenderContext<Self>) -> ElementBox { fn render(&mut self, _: &mut RenderContext<Self>) -> ElementBox {
let theme = &self.settings.borrow().theme.selector;
Align::new( Align::new(
ConstrainedBox::new( ConstrainedBox::new(
Container::new(ChildView::new(self.line_editor.id()).boxed()).boxed(), Flex::new(Axis::Vertical)
.with_child(
Container::new(ChildView::new(self.line_editor.id()).boxed())
.with_style(theme.container)
.boxed(),
)
.boxed(),
) )
.with_max_width(500.0) .with_max_width(500.0)
.with_max_height(420.0)
.boxed(), .boxed(),
) )
.top() .top()