Add a note on how to check the telemetry

This commit is contained in:
Mikayla Maki
2023-03-08 18:47:52 -08:00
parent a65dd0fd98
commit 943ea61452
5 changed files with 47 additions and 8 deletions
+1
View File
@@ -869,6 +869,7 @@ pub struct WelcomeStyle {
pub page_width: f32,
pub logo: IconStyle,
pub logo_subheading: ContainedText,
pub usage_note: ContainedText,
pub checkbox: CheckboxStyle,
pub checkbox_container: ContainerStyle,
pub button: Interactive<ContainedText>,
+17 -5
View File
@@ -4,7 +4,7 @@ use gpui::{
ConstrainedBox, Container, ContainerStyle, Empty, Flex, KeystrokeLabel, Label,
MouseEventHandler, ParentElement, Svg,
},
Action, Element, EventContext, RenderContext, View,
Action, Element, ElementBox, EventContext, RenderContext, View,
};
use serde::Deserialize;
@@ -26,6 +26,21 @@ pub fn checkbox<T: 'static, V: View>(
checked: bool,
cx: &mut RenderContext<V>,
change: fn(checked: bool, cx: &mut EventContext) -> (),
) -> MouseEventHandler<T> {
let label = Label::new(label, style.label.text.clone())
.contained()
.with_style(style.label.container)
.boxed();
checkbox_with_label(label, style, checked, cx, change)
}
pub fn checkbox_with_label<T: 'static, V: View>(
label: ElementBox,
style: &CheckboxStyle,
checked: bool,
cx: &mut RenderContext<V>,
change: fn(checked: bool, cx: &mut EventContext) -> (),
) -> MouseEventHandler<T> {
MouseEventHandler::<T>::new(0, cx, |state, _| {
let indicator = if checked {
@@ -55,10 +70,7 @@ pub fn checkbox<T: 'static, V: View>(
}
})
.boxed(),
Label::new(label, style.label.text.clone())
.contained()
.with_style(style.label.container)
.boxed(),
label,
])
.align_children_center()
.boxed()