| 799 | .rounded(px(6.0)) |
| 800 | .bg(motion::hover_blend( |
| 801 | &row_id, |
| 802 | gpui::transparent_black(), |
| 803 | theme.list_hover, |
| 804 | )) |
| 805 | .on_hover(motion::hover_listener(row_id.clone())) |
| 806 | .on_click(move |_, window, cx| { |
| 807 | if let Some(ref handler) = callbacks_for_toggle.on_toggle_node_expand { |
| 808 | handler(collection_id, node_id, window, cx); |
| 809 | } |
| 810 | }) |
| 811 | .child(Self::render_chevron(has_children && is_expanded, theme)) |
| 812 | .child( |
| 813 | div() |
| 814 | .w(px(16.0)) |
| 815 | .h(px(16.0)) |
| 816 | .flex() |
| 817 | .items_center() |
| 818 | .justify_center() |
| 819 | .flex_shrink_0() |
| 820 | .child( |
| 821 | Icon::new(if has_children && is_expanded { |
| 822 | IconName::FolderOpen |
| 823 | } else { |
| 824 | IconName::Folder |
| 825 | }) |
| 826 | .size(px(14.0)) |
| 827 | .text_color(theme.muted_foreground.opacity(0.85)), |
| 828 | ), |
| 829 | ) |
| 830 | .child( |
| 831 | div() |
| 832 | .flex_1() |
| 833 | .min_w(px(0.0)) |
| 834 | .overflow_hidden() |
| 835 | .text_color(theme.foreground) |
| 836 | .text_size(px(11.5)) |
| 837 | .text_ellipsis() |
| 838 | .child(name.to_string()), |
| 839 | ) |
| 840 | .child(Self::render_action_button( |
| 841 | theme, |
| 842 | group_id, |
| 843 | action_id, |
| 844 | "Folder actions", |
| 845 | px(8.0), |
| 846 | move |menu, _window, _cx| { |
| 847 | Self::build_folder_popup_menu( |
| 848 | menu, |
| 849 | &callbacks_for_action, |
| 850 | collection_id, |
| 851 | action_node_id, |
| 852 | action_name.clone(), |
| 853 | ) |
| 854 | }, |
| 855 | )) |
| 856 | .into_any_element(); |