mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-27 19:02:07 +00:00
WIP: start on Select
This commit is contained in:
parent
ef89ceae4d
commit
ff01b52819
3 changed files with 28 additions and 0 deletions
|
@ -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;
|
||||
|
|
3
gpui/src/views.rs
Normal file
3
gpui/src/views.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
mod select;
|
||||
|
||||
pub use select::*;
|
24
gpui/src/views/select.rs
Normal file
24
gpui/src/views/select.rs
Normal file
|
@ -0,0 +1,24 @@
|
|||
use crate::{elements::*, Entity, RenderContext, View};
|
||||
use std::ops::Range;
|
||||
|
||||
pub struct Select {
|
||||
selected_ix: Option<usize>,
|
||||
render_selected_element: Box<dyn FnMut()>,
|
||||
render_elements: Box<dyn FnMut(Range<usize>, &mut RenderContext<Self>)>,
|
||||
}
|
||||
|
||||
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<Self>) -> ElementBox {
|
||||
todo!()
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue