From ff01b52819170ed15fe18ede4ed195c9a67b9c71 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Mon, 30 Aug 2021 20:15:16 +0200 Subject: [PATCH] WIP: start on Select --- gpui/src/lib.rs | 1 + gpui/src/views.rs | 3 +++ gpui/src/views/select.rs | 24 ++++++++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 gpui/src/views.rs create mode 100644 gpui/src/views/select.rs diff --git a/gpui/src/lib.rs b/gpui/src/lib.rs index 10877e33a00542b248a8ef84ae4b50f016005bf4..6cb1c6f39d7d5caee1b94516461a371335924231 100644 --- a/gpui/src/lib.rs +++ b/gpui/src/lib.rs @@ -7,6 +7,7 @@ mod test; pub use assets::*; pub mod elements; pub mod font_cache; +pub mod views; pub use font_cache::FontCache; mod clipboard; pub use clipboard::ClipboardItem; diff --git a/gpui/src/views.rs b/gpui/src/views.rs new file mode 100644 index 0000000000000000000000000000000000000000..470d1d019052dc6db768192f6d2800c734676d75 --- /dev/null +++ b/gpui/src/views.rs @@ -0,0 +1,3 @@ +mod select; + +pub use select::*; diff --git a/gpui/src/views/select.rs b/gpui/src/views/select.rs new file mode 100644 index 0000000000000000000000000000000000000000..a97aa201c8038b4698c3154fda44729a674b7fd7 --- /dev/null +++ b/gpui/src/views/select.rs @@ -0,0 +1,24 @@ +use crate::{elements::*, Entity, RenderContext, View}; +use std::ops::Range; + +pub struct Select { + selected_ix: Option, + render_selected_element: Box, + render_elements: Box, &mut RenderContext)>, +} + +pub enum Event {} + +impl Entity for Select { + type Event = Event; +} + +impl View for Select { + fn ui_name() -> &'static str { + "Select" + } + + fn render(&mut self, cx: &mut RenderContext) -> ElementBox { + todo!() + } +}