Adjust layout and wording

This commit is contained in:
Danilo Leal 2025-01-22 19:48:06 -03:00
parent 50d3ef52db
commit e462609a47
2 changed files with 37 additions and 13 deletions

View file

@ -226,10 +226,8 @@ impl Render for TitleBar {
.color(Color::Muted), .color(Color::Muted),
) )
.child( .child(
Label::new( Label::new("Edit Prediction")
"Zed AI's Edit Prediction", .size(LabelSize::Small),
)
.size(LabelSize::Small),
), ),
), ),
) )

View file

@ -46,6 +46,11 @@ impl ZedPredictTos {
cx.notify(); cx.notify();
} }
fn view_blog(&mut self, _: &ClickEvent, cx: &mut ViewContext<Self>) {
cx.open_url("https://zed.dev/blog/"); // TODO Add the link when live
cx.notify();
}
fn accept_terms(&mut self, _: &ClickEvent, cx: &mut ViewContext<Self>) { fn accept_terms(&mut self, _: &ClickEvent, cx: &mut ViewContext<Self>) {
let task = self let task = self
.user_store .user_store
@ -130,7 +135,7 @@ impl Render for ZedPredictTos {
.child( .child(
v_flex() v_flex()
.child( .child(
Label::new("Introducing Zed AI") Label::new("Introducing Zed AI's")
.size(LabelSize::Small) .size(LabelSize::Small)
.color(Color::Muted), .color(Color::Muted),
) )
@ -155,7 +160,7 @@ impl Render for ZedPredictTos {
.child("tab") .child("tab")
.with_animation( .with_animation(
ElementId::Integer(n), ElementId::Integer(n),
Animation::new(Duration::from_millis(2400)).repeat(), Animation::new(Duration::from_secs(2)).repeat(),
move |tab, delta| { move |tab, delta| {
let delta = (delta - 0.15 * n as f32) / 0.7; let delta = (delta - 0.15 * n as f32) / 0.7;
let delta = 1.0 - (0.5 - delta).abs() * 2.; let delta = 1.0 - (0.5 - delta).abs() * 2.;
@ -190,7 +195,7 @@ impl Render for ZedPredictTos {
.child( .child(
v_flex() v_flex()
.mt_2() .mt_2()
.gap_1() .gap_2()
.w_full() .w_full()
.child( .child(
Button::new("accept-tos", "Tab to Accept and Enable") Button::new("accept-tos", "Tab to Accept and Enable")
@ -199,12 +204,33 @@ impl Render for ZedPredictTos {
.on_click(cx.listener(Self::accept_terms)), .on_click(cx.listener(Self::accept_terms)),
) )
.child( .child(
Button::new("view-tos", "Terms of Service") h_flex()
.full_width() .w_full()
.icon(IconName::ArrowUpRight) .gap_1()
.icon_size(IconSize::Indicator) .child(
.icon_color(Color::Muted) div()
.on_click(cx.listener(Self::view_terms)), .w_full()
.child(
Button::new("view-tos", "Terms of Service")
.full_width()
.icon(IconName::ArrowUpRight)
.icon_size(IconSize::Indicator)
.icon_color(Color::Muted)
.on_click(cx.listener(Self::view_terms)),
),
)
.child(
div()
.w_full()
.child(
Button::new("blog-post", "Read the Blog Post")
.full_width()
.icon(IconName::ArrowUpRight)
.icon_size(IconSize::Indicator)
.icon_color(Color::Muted)
.on_click(cx.listener(Self::view_blog)),
),
),
) )
) )
} }