344 ImGui::TextDisabled(
"Workbench toolbar not wired");
350 ScopedWorkbenchToolbar toolbar_scope(
"##DungeonWorkbenchToolbar");
351 bool request_panel_mode =
false;
353 const float toolbar_width = std::max(ImGui::GetContentRegionAvail().x, 1.0f);
354 const bool compact_toolbar = toolbar_width < kCompactToolbarWidth;
355 const bool ultra_compact_toolbar = toolbar_width < kUltraCompactToolbarWidth;
357 ultra_compact_toolbar
367 const float spacing = ImGui::GetStyle().ItemSpacing.x;
372 const ImVec2 frame_pad = ImGui::GetStyle().FramePadding;
374 ImGuiStyleVar_FramePadding,
375 ImVec2(frame_pad.x, std::max(frame_pad.y, 4.0f)));
377 ImGuiStyleVar_ItemSpacing, ImVec2(std::max(4.0f, spacing * 0.72f),
378 ImGui::GetStyle().ItemSpacing.y));
380 constexpr ImGuiTableFlags kFlags = ImGuiTableFlags_NoBordersInBody |
381 ImGuiTableFlags_NoPadInnerX |
382 ImGuiTableFlags_NoPadOuterX;
383 if (ImGui::BeginTable(
"##DungeonWorkbenchToolbarTable", 3, kFlags)) {
389 const float right_cluster_w =
390 w_grid + w_bounds + w_coords + w_camera + (spacing * 2.16f);
391 const float right_w = right_cluster_w + 6.0f;
392 ImGui::TableSetupColumn(
"Left", ImGuiTableColumnFlags_WidthStretch);
393 ImGui::TableSetupColumn(
"Middle", ImGuiTableColumnFlags_WidthStretch);
394 ImGui::TableSetupColumn(
"Right", ImGuiTableColumnFlags_WidthFixed,
396 ImGui::TableNextRow();
399 ImGui::TableNextColumn();
402 "Hide room browser",
"Show room browser");
406 "Hide inspector",
"Show inspector");
410 "Switch to standalone panel workflow "
412 request_panel_mode =
true;
419 if (show_inline_room_nav) {
426 snprintf(title,
sizeof(title),
"[%03X] %s", rid, room_label.c_str());
427 ImGui::AlignTextToFramePadding();
428 const float title_width_cap =
429 ultra_compact_toolbar
434 const float title_width =
435 std::clamp(ImGui::GetContentRegionAvail().x, 80.0f, title_width_cap);
436 const std::string visible_title =
437 TruncateToolbarLabel(title, title_width);
438 ImGui::TextUnformatted(visible_title.c_str());
439 if (ImGui::IsItemHovered()) {
440 ImGui::SetTooltip(
"%s", title);
444 ImGui::TableNextColumn();
448 "Enable split view (compare)")) {
449 const CompareDefaultResult def = PickDefaultCompareRoom(
459 ImGui::AlignTextToFramePadding();
463 const float avail = ImGui::GetContentRegionAvail().x;
465 ultra_compact_toolbar || avail < kTightCompareStackThreshold;
478 "##CompareRoomId", &cmp, compact_toolbar ? 60.0f : 70.0f,
true);
482 if (ImGui::IsItemHovered()) {
483 ImGui::SetTooltip(
"Compare room ID");
488 "Swap active and compare rooms")) {
502 "Unsync compare view",
503 "Sync compare view to active")) {
509 "Disable split view")) {
516 ImGui::TableNextColumn();
518 if (compact_toolbar) {
519 const float popup_width =
521 const float start_x =
522 ImGui::GetCursorPosX() +
523 std::max(0.0f, ImGui::GetContentRegionAvail().x - popup_width);
524 ImGui::SetCursorPosX(start_x);
527 return request_panel_mode;
530 const float avail = ImGui::GetContentRegionAvail().x;
531 const bool stack_right_cluster =
532 ultra_compact_toolbar || avail < right_cluster_w;
533 if (!stack_right_cluster) {
534 const float total_w = right_cluster_w;
535 const float start_x =
536 ImGui::GetCursorPosX() +
537 std::max(0.0f, ImGui::GetContentRegionAvail().x - total_w);
538 ImGui::SetCursorPosX(start_x);
542 if (SquareIconButton(
"##GridToggle",
544 v ?
"Hide grid" :
"Show grid")) {
547 if (stack_right_cluster) {
555 v ?
"Hide object bounds" :
"Show object bounds")) {
558 if (stack_right_cluster) {
565 if (SquareIconButton(
567 v ?
"Hide hover coordinates" :
"Show hover coordinates")) {
570 if (stack_right_cluster) {
577 if (SquareIconButton(
579 v ?
"Hide camera quadrants" :
"Show camera quadrants")) {
588 return request_panel_mode;