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

Method render

src/components/multipart_form_data_editor.rs:245–575  ·  view source on GitHub ↗
(&mut self, _window: &mut Window, cx: &mut Context<Self>)

Source from the content-addressed store, hash-verified

243 };
244
245 let Ok(paths_opt) = platform_result else {
246 log::error!("File picker failed");
247 return;
248 };
249
250 let Some(paths) = paths_opt else {
251 return;
252 };
253
254 let Some(path) = paths.first().cloned() else {
255 return;
256 };
257
258 let _ = cx.update(|window, app| {
259 this.update(app, |editor, cx| {
260 editor.set_file_for_row(index, path, window, cx);
261 });
262 });
263 })
264 .detach();
265 }
266}
267
268impl Focusable for MultipartFormDataEditor {
269 fn focus_handle(&self, _cx: &App) -> FocusHandle {
270 self.focus_handle.clone()
271 }
272}
273
274impl Render for MultipartFormDataEditor {
275 fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
276 let theme = cx.theme();
277 let this = cx.entity().clone();
278
279 div()
280 .id("multipart-form-data-editor-container")
281 .track_focus(&self.focus_handle)
282 .flex()
283 .flex_col()
284 .w_full()
285 .flex_1()
286 .overflow_hidden()
287 .bg(theme.muted)
288 .child(
289 div()
290 .flex()
291 .flex_row()
292 .items_center()
293 .justify_between()
294 .h(px(36.0))
295 .px(px(16.0))
296 .bg(theme.secondary)
297 .border_b_1()
298 .border_color(theme.border)
299 .child(
300 div()
301 .text_color(theme.muted_foreground)
302 .text_size(px(11.0))

Callers

nothing calls this directly

Calls 14

childMethod · 0.80
idMethod · 0.80
textMethod · 0.80
clear_file_for_rowMethod · 0.80
pick_file_for_rowMethod · 0.80
on_clickMethod · 0.45
clear_allMethod · 0.45
add_rowMethod · 0.45
move_rowMethod · 0.45
newMethod · 0.45
toggle_rowMethod · 0.45
labelMethod · 0.45

Tested by

no test coverage detected