(ctx: &mut ScriptContext<'_, API>, view: &EditorView)
| 299 | set_text_box(ctx, "command_palette_filter_box", &view.command_palette_filter); |
| 300 | for idx in 0..8 { |
| 301 | let row = view.command_palette_rows.get(idx); |
| 302 | set_ui_display(ctx, &format!("command_palette_row_{idx}"), view.command_palette_open && row.is_some()); |
| 303 | set_label( |
| 304 | ctx, |
| 305 | &format!("command_palette_row_{idx}_label"), |
| 306 | row.map(String::as_str).unwrap_or("-"), |
| 307 | ); |
| 308 | } |
| 309 | let active_tool = if view.viewport_tool.is_empty() { "select" } else { &view.viewport_tool }; |
| 310 | for tool in ["select", "move", "rotate", "scale"] { |
| 311 | set_button_fill( |
| 312 | ctx, |
| 313 | &format!("viewport_tool_{tool}_button"), |
| 314 | if active_tool == tool { theme::ACCENT } else { theme::BG_WIDGET }, |
| 315 | ); |
| 316 | } |
| 317 | set_button_fill( |
| 318 | ctx, |
| 319 | "viewport_snap_button", |
| 320 | if view.viewport_snap { theme::ACCENT } else { theme::BG_WIDGET }, |
| 321 | ); |
| 322 | set_label( |
| 323 | ctx, |
| 324 | "viewport_space_label", |
| 325 | if view.viewport_local { "Local" } else { "Global" }, |
| 326 | ); |
| 327 | let glb_mode = view.activity_mode == "glb"; |
| 328 | set_button_fill( |
| 329 | ctx, |
| 330 | "activity_scene_button", |
| 331 | if glb_mode { theme::BG_WIDGET } else { theme::ACCENT }, |
| 332 | ); |
| 333 | set_button_fill( |
| 334 | ctx, |
| 335 | "activity_glb_button", |
| 336 | if glb_mode { theme::ACCENT } else { theme::BG_WIDGET }, |
| 337 | ); |
| 338 | set_image_tint( |
| 339 | ctx, |
| 340 | "activity_scene_icon", |
| 341 | if glb_mode { theme::TEXT_DIM } else { theme::TEXT }, |
| 342 | ); |
| 343 | set_image_tint( |
| 344 | ctx, |
| 345 | "activity_glb_icon", |
| 346 | if glb_mode { theme::TEXT } else { theme::TEXT_DIM }, |
| 347 | ); |
| 348 | set_button_fill( |
| 349 | ctx, |
| 350 | "mode_ui_button", |
| 351 | if view.viewport_mode == "UI" { |
| 352 | theme::ACCENT |
| 353 | } else { |
| 354 | theme::BG_WIDGET |
| 355 | }, |
| 356 | ); |
| 357 | set_button_fill( |
| 358 | ctx, |
no test coverage detected