1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
use {
    crate::{
        makepad_derive_widget::*,
        widget::*,
        makepad_draw::*,
        button::{Button}
    }
};

live_design!{
    LinkLabelBase = {{LinkLabel}} {}
}

#[derive(Live)]
pub struct LinkLabel {
    #[deref] button: Button
}

impl LiveHook for LinkLabel {
    fn before_live_design(cx: &mut Cx) {
        register_widget!(cx, LinkLabel)
    }
}

impl Widget for LinkLabel {
       fn handle_widget_event_with(
        &mut self,
        cx: &mut Cx,
        event: &Event,
        dispatch_action: &mut dyn FnMut(&mut Cx, WidgetActionItem)
    ) {
        self.button.handle_widget_event_with(cx,event,dispatch_action);
    }
    
    fn redraw(&mut self, cx: &mut Cx) {
        self.button.redraw(cx)
    }
    
    fn walk(&mut self, cx:&mut Cx) -> Walk {
        self.button.walk(cx)
    }
    
    fn draw_walk_widget(&mut self, cx: &mut Cx2d, walk: Walk) -> WidgetDraw {
        self.button.draw_walk_widget(cx, walk)
    }
    
    fn text(&self)->String{
        self.button.text()
    }
    
    fn set_text(&mut self, v:&str){
        self.button.set_text(v);
    }
}

#[derive(Clone, PartialEq, WidgetRef)]
pub struct LinkLabelRef(WidgetRef);

impl LinkLabelRef {
}