Checkpoint

This commit is contained in:
Marshall Bowers
2023-10-12 12:18:35 -04:00
parent 207d843aee
commit 262f5886a4
44 changed files with 237 additions and 148 deletions
+2 -2
View File
@@ -26,7 +26,7 @@ impl<S: 'static + Send + Sync> Avatar<S> {
self
}
fn render(&mut self, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
let theme = theme(cx);
let mut img = img();
@@ -64,7 +64,7 @@ mod stories {
}
}
fn render(&mut self, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
Story::container(cx)
.child(Story::title_for::<_, Avatar<S>>(cx))
.child(Story::label(cx, "Default"))
+21 -8
View File
@@ -1,7 +1,7 @@
use std::marker::PhantomData;
use std::sync::Arc;
use gpui3::{DefiniteLength, Hsla, Interactive, MouseButton, WindowContext};
use gpui3::{DefiniteLength, Hsla, WindowContext};
use crate::prelude::*;
use crate::{h_stack, theme, Icon, IconColor, IconElement, Label, LabelColor, LabelSize};
@@ -160,7 +160,7 @@ impl<S: 'static + Send + Sync + Clone> Button<S> {
self.icon.map(|i| IconElement::new(i).color(icon_color))
}
fn render(&mut self, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
let theme = theme(cx);
let icon_color = self.icon_color();
let system_color = SystemColor::new();
@@ -195,11 +195,20 @@ impl<S: 'static + Send + Sync + Clone> Button<S> {
el = el.w(width).justify_center();
}
if let Some(click_handler) = self.handlers.click.clone() {
// el = el.on_click(MouseButton::Left, move |state, event, cx| {
// click_handler(state, cx);
// });
}
// el.when_some(self.handlers.click.clone(), |el, click_handler| {
// el.id(0)
// .on_click(MouseButton::Left, move |state, event, cx| {
// click_handler(state, cx);
// })
// });
// if let Some(click_handler) = self.handlers.click.clone() {
// el = el
// .id(0)
// .on_click(MouseButton::Left, move |state, event, cx| {
// click_handler(state, cx);
// });
// }
el
}
@@ -229,7 +238,11 @@ mod stories {
}
}
fn render(&mut self, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
fn render(
&mut self,
_view: &mut S,
cx: &mut ViewContext<S>,
) -> impl Element<ViewState = S> {
let states = InteractionState::iter();
Story::container(cx)
+2 -2
View File
@@ -24,7 +24,7 @@ impl<S: 'static + Send + Sync + Clone> Details<S> {
self
}
fn render(&mut self, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
let theme = theme(cx);
div()
@@ -60,7 +60,7 @@ mod stories {
}
}
fn render(&mut self, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
Story::container(cx)
.child(Story::title_for::<_, Details<S>>(cx))
.child(Story::label(cx, "Default"))
+2 -2
View File
@@ -170,7 +170,7 @@ impl<S: 'static + Send + Sync> IconElement<S> {
self
}
fn render(&mut self, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
let theme = theme(cx);
let fill = self.color.color(theme);
@@ -206,7 +206,7 @@ mod stories {
}
}
fn render(&mut self, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
let icons = Icon::iter();
Story::container(cx)
+2 -2
View File
@@ -45,7 +45,7 @@ impl<S: 'static + Send + Sync> Input<S> {
self
}
fn render(&mut self, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
let theme = theme(cx);
let text_el;
@@ -128,7 +128,7 @@ mod stories {
}
}
fn render(&mut self, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
Story::container(cx)
.child(Story::title_for::<_, Input<S>>(cx))
.child(Story::label(cx, "Default"))
+2 -2
View File
@@ -90,7 +90,7 @@ impl<S: 'static + Send + Sync + Clone> Label<S> {
self
}
fn render(&mut self, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
let theme = theme(cx);
let highlight_color = theme.lowest.accent.default.foreground;
@@ -185,7 +185,7 @@ mod stories {
}
}
fn render(&mut self, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
Story::container(cx)
.child(Story::title_for::<_, Label<S>>(cx))
.child(Story::label(cx, "Default"))
+1 -1
View File
@@ -15,7 +15,7 @@ impl<S: 'static + Send + Sync> ToolDivider<S> {
}
}
fn render(&mut self, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
let theme = theme(cx);
div().w_px().h_3().fill(theme.lowest.base.default.border)