Added background to welcome page

This commit is contained in:
Mikayla Maki 2023-02-28 22:33:12 -08:00
parent 5210be95fe
commit 62aeb6b8b3

View file

@ -1,6 +1,7 @@
use gpui::{
color::Color,
elements::{Empty, Flex, Label, MouseEventHandler, ParentElement, Svg},
elements::{Canvas, Empty, Flex, Label, MouseEventHandler, ParentElement, Stack, Svg},
geometry::rect::RectF,
Element, ElementBox, Entity, MutableAppContext, RenderContext, Subscription, View, ViewContext,
};
use settings::{settings_file::SettingsFile, Settings, SettingsFileContent};
@ -39,6 +40,24 @@ impl View for WelcomePage {
enum Metrics {}
enum Diagnostics {}
let background = theme.editor.background;
Stack::new()
.with_child(
Canvas::new(move |bounds, visible_bounds, cx| {
let visible_bounds = bounds.intersection(visible_bounds).unwrap_or_default();
cx.paint_layer(Some(visible_bounds), |cx| {
cx.scene.push_quad(gpui::Quad {
bounds: RectF::new(bounds.origin(), bounds.size()),
background: Some(background),
..Default::default()
})
})
})
.boxed(),
)
.with_child(
Flex::column()
.with_children([
Flex::row()
@ -93,6 +112,8 @@ impl View for WelcomePage {
.boxed(),
])
.aligned()
.boxed(),
)
.boxed()
}
}