MCPcopy Create free account
hub / github.com/bajrangCoder/setu / render

Method render

src/components/panel_tab.rs:40–74  ·  view source on GitHub ↗
(self, _window: &mut Window, cx: &mut App)

Source from the content-addressed store, hash-verified

38 mut self,
39 callback: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static,
40 ) -> Self {
41 self.on_click = Some(Box::new(callback));
42 self
43 }
44}
45
46impl RenderOnce for PanelTab {
47 fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement {
48 let theme = cx.theme();
49 let is_active = self.is_active;
50 let activation_progress = self.activation_progress;
51
52 div()
53 .id(self.label)
54 .flex()
55 .items_center()
56 .gap(px(6.0))
57 .h(px(28.0))
58 .px(px(10.0))
59 .mx(px(2.0))
60 .rounded(px(4.0))
61 .cursor_pointer()
62 .text_size(px(11.0))
63 .font_weight(if is_active {
64 gpui::FontWeight::MEDIUM
65 } else {
66 gpui::FontWeight::NORMAL
67 })
68 .when(is_active, |style| {
69 style
70 .bg(motion::mix(
71 theme.secondary,
72 theme.muted,
73 activation_progress,
74 ))
75 .text_color(motion::mix(
76 theme.muted_foreground,
77 theme.foreground,

Callers

nothing calls this directly

Calls 3

childMethod · 0.80
idMethod · 0.80
on_clickMethod · 0.45

Tested by

no test coverage detected