Skip to content
Snippets Groups Projects
Commit 8316896a authored by MrGVSV's avatar MrGVSV
Browse files

Fix up code snippets

parent dcaccc33
No related branches found
No related tags found
No related merge requests found
...@@ -260,15 +260,14 @@ Firstly, the constructor: ...@@ -260,15 +260,14 @@ Firstly, the constructor:
impl Widget for MyButton { impl Widget for MyButton {
type Props = MyButtonProps; type Props = MyButtonProps;
fn constructor(id: Index, children: Children, mut props: Self::Props) -> dyn Widget<Props=Self::Props> where Self: Sized { fn constructor(mut props: Self::Props) -> dyn Widget<Props=Self::Props> where Self: Sized {
if props.disabled { if props.disabled {
// If disabled, also disable focusability // If disabled, also disable focusability
props.focusable = false; props.focusable = false;
} }
Self { Self {
my_id: id, my_id: Index::default(),
my_children: children,
my_props: props my_props: props
} }
} }
...@@ -452,8 +451,6 @@ However, we need this: ...@@ -452,8 +451,6 @@ However, we need this:
#[derivative(Default, Debug, PartialEq, Clone)] #[derivative(Default, Debug, PartialEq, Clone)]
struct MyWidget { struct MyWidget {
pub id: kayak_core::Index, pub id: kayak_core::Index,
#[derivative(Debug = "ignore", PartialEq = "ignore")]
pub children: Children,
pub props: MyWidgetProps, pub props: MyWidgetProps,
} }
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment