(&mut self, _window: &mut Window, cx: &mut Context<Self>)
| 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 | |
| 268 | impl Focusable for MultipartFormDataEditor { |
| 269 | fn focus_handle(&self, _cx: &App) -> FocusHandle { |
| 270 | self.focus_handle.clone() |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | impl 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)) |
nothing calls this directly
no test coverage detected