gpui: Remove use of use gpui::* in examples (#22311)

This PR removes the use of `use gpui::*` in the GPUI examples, as this
is not how consumers should be importing GPUI.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-12-20 18:09:30 -05:00 committed by GitHub
parent 7c6feeb3a8
commit a8afc63a91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 77 additions and 32 deletions

View file

@ -1,15 +1,16 @@
use gpui::*;
use prelude::FluentBuilder;
use gpui::{
black, canvas, div, green, point, prelude::*, px, rgb, size, transparent_black, white, App,
AppContext, Bounds, CursorStyle, Decorations, Hsla, MouseButton, Pixels, Point, ResizeEdge,
Size, ViewContext, WindowBackgroundAppearance, WindowBounds, WindowDecorations, WindowOptions,
};
struct WindowShadow {}
/*
Things to do:
1. We need a way of calculating which edge or corner the mouse is on,
and then dispatch on that
2. We need to improve the shadow rendering significantly
3. We need to implement the techniques in here in Zed
*/
// Things to do:
// 1. We need a way of calculating which edge or corner the mouse is on,
// and then dispatch on that
// 2. We need to improve the shadow rendering significantly
// 3. We need to implement the techniques in here in Zed
impl Render for WindowShadow {
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
@ -128,7 +129,7 @@ impl Render for WindowShadow {
div()
.flex()
.bg(white())
.size(Length::Definite(Pixels(300.0).into()))
.size(px(300.0))
.justify_center()
.items_center()
.shadow_lg()