1use gpui::{
 2    App, Application, Bounds, Context, Window, WindowBounds, WindowOptions, div, prelude::*, px,
 3    size,
 4};
 5
 6struct Scrollable {}
 7
 8impl Render for Scrollable {
 9    fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
10        div()
11            .size_full()
12            .id("vertical")
13            .p_4()
14            .overflow_scroll()
15            .bg(gpui::white())
16            .child("Example for test 2 way scroll in nested layout")
17            .child(
18                div()
19                    .h(px(5000.))
20                    .border_1()
21                    .border_color(gpui::blue())
22                    .bg(gpui::blue().opacity(0.05))
23                    .p_4()
24                    .child(
25                        div()
26                            .mb_5()
27                            .w_full()
28                            .id("horizontal")
29                            .overflow_scroll()
30                            .child(
31                                div()
32                                    .w(px(2000.))
33                                    .h(px(150.))
34                                    .bg(gpui::green().opacity(0.1))
35                                    .hover(|this| this.bg(gpui::green().opacity(0.2)))
36                                    .border_1()
37                                    .border_color(gpui::green())
38                                    .p_4()
39                                    .child("Scroll Horizontal"),
40                            ),
41                    )
42                    .child("Scroll Vertical"),
43            )
44    }
45}
46
47fn main() {
48    Application::new().run(|cx: &mut App| {
49        let bounds = Bounds::centered(None, size(px(500.), px(500.0)), cx);
50        cx.open_window(
51            WindowOptions {
52                window_bounds: Some(WindowBounds::Windowed(bounds)),
53                ..Default::default()
54            },
55            |_, cx| cx.new(|_| Scrollable {}),
56        )
57        .unwrap();
58        cx.activate(true);
59    });
60}