(&mut self)
| 353 | } |
| 354 | |
| 355 | fn body(&mut self, ui: &mut egui::Ui, build_glow_t: Option<f32>) { |
| 356 | self.refresh_build_target(); |
| 357 | self.ensure_layer_visible(); |
| 358 | let rect = ui.available_rect_before_wrap(); |
| 359 | ui.expand_to_include_rect(rect); |
| 360 | |
| 361 | let show_spine = !self.settings_open && self.visible_layers().is_some(); |
| 362 | let spine_width = if show_spine { spine::width() } else { 0.0 }; |
| 363 | let max_width = metrics::TOOL_WINDOW_MAX |
| 364 | .min((rect.width() - spine_width - metrics::EDITOR_MIN).max(0.0)); |
| 365 | let max_width = max_width.max(metrics::TOOL_WINDOW_MIN.min(rect.width())); |
| 366 | self.layout.tool_window_width = self |
| 367 | .layout |
| 368 | .tool_window_width |
| 369 | .clamp(metrics::TOOL_WINDOW_MIN.min(max_width), max_width); |
| 370 | |
| 371 | let tool_rect = egui::Rect::from_min_size( |
| 372 | rect.left_top(), |
| 373 | egui::vec2(self.layout.tool_window_width, rect.height()), |
| 374 | ); |
| 375 | let spine_rect = egui::Rect::from_min_size( |
| 376 | egui::pos2(tool_rect.right(), rect.top()), |
| 377 | egui::vec2(spine_width, rect.height()), |
| 378 | ); |
| 379 | let editor_rect = egui::Rect::from_min_max( |
| 380 | egui::pos2(spine_rect.right(), rect.top()), |
| 381 | rect.right_bottom(), |
| 382 | ); |
| 383 | |
| 384 | ui.scope_builder( |
| 385 | egui::UiBuilder::new() |
| 386 | .id_salt("tool_window") |
| 387 | .max_rect(tool_rect), |
| 388 | |ui| { |
| 389 | self.tool_window(ui); |
| 390 | }, |
| 391 | ); |
| 392 | if show_spine { |
| 393 | ui.scope_builder( |
| 394 | egui::UiBuilder::new() |
| 395 | .id_salt("stack_spine") |
| 396 | .max_rect(spine_rect), |
| 397 | |ui| { |
| 398 | self.spine_panel(ui, build_glow_t); |
| 399 | }, |
| 400 | ); |
| 401 | } |
no test coverage detected