Bugfix display Capture menu

And addedactive label to enable restore default
This commit is contained in:
Bruno Herbelin
2023-12-26 23:49:47 +01:00
parent fde6be3f97
commit 7606baa20b

View File

@@ -292,11 +292,12 @@ void OutputPreviewWindow::Render()
ImGui::MenuItem( MENU_RECORDCONT, SHORTCUT_RECORDCONT, false, false);
ImGui::PopStyleColor(1);
}
// Options menu
ImGui::Separator();
ImGui::MenuItem("Settings", nullptr, false, false);
// offer to open config panel from here for more options
ImGui::SameLine(ImGui::GetContentRegionAvailWidth() + 1.2f * IMGUI_RIGHT_ALIGN);
ImGui::SameLine(ImGui::GetContentRegionAvailWidth() + 1.3f * IMGUI_RIGHT_ALIGN);
if (ImGuiToolkit::IconButton(13, 5, "Advanced settings"))
UserInterface::manager().navigator.showConfig();
@@ -313,34 +314,46 @@ void OutputPreviewWindow::Render()
Settings::application.record.path = SystemToolkit::home_path();
snprintf( name_path[0], 1024, "%s", Settings::application.record.path.c_str());
int selected_path = 0;
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
ImGui::Combo("Path", &selected_path, name_path, 4);
ImGui::SetNextItemWidth(1.4f * IMGUI_RIGHT_ALIGN);
if (ImGui::Combo("##Path", &selected_path, name_path, 4) ) {
if (selected_path > 2)
recordFolderDialog->open();
else if (selected_path > 1)
Settings::application.record.path = SystemToolkit::path_filename( Mixer::manager().session()->filename() );
else if (selected_path > 0)
Settings::application.record.path = SystemToolkit::home_path();
}
ImGui::SameLine(0, IMGUI_SAME_LINE);
if (ImGuiToolkit::TextButton("Path"))
Settings::application.record.path = SystemToolkit::home_path();
// offer to open folder location
ImVec2 draw_pos = ImGui::GetCursorPos();
ImGui::SetCursorPos(draw_pos + ImVec2(ImGui::GetContentRegionAvailWidth() - 1.2 * ImGui::GetTextLineHeightWithSpacing(), -ImGui::GetFrameHeight()) );
if (ImGuiToolkit::IconButton( ICON_FA_FOLDER_OPEN, Settings::application.record.path.c_str()))
ImGui::SetCursorPos(draw_pos + ImVec2(ImGui::GetContentRegionAvailWidth() - 1.4 * ImGui::GetTextLineHeightWithSpacing(), -ImGui::GetFrameHeight()) );
if (ImGuiToolkit::IconButton(3, 5, "Show in finder"))
SystemToolkit::open(Settings::application.record.path);
ImGui::SetCursorPos(draw_pos);
// Naming menu selection
static const char* naming_style[2] = { ICON_FA_SORT_NUMERIC_DOWN " Sequential", ICON_FA_CALENDAR " Date prefix" };
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
ImGui::Combo("Filename", &Settings::application.record.naming_mode, naming_style, IM_ARRAYSIZE(naming_style));
ImGui::SetNextItemWidth(1.4f * IMGUI_RIGHT_ALIGN);
ImGui::Combo("##Filename", &Settings::application.record.naming_mode, naming_style, IM_ARRAYSIZE(naming_style));
ImGui::SameLine(0, IMGUI_SAME_LINE);
if (ImGuiToolkit::TextButton("Filename"))
Settings::application.record.naming_mode = 1;
ImGui::SetNextItemWidth(1.4f * IMGUI_RIGHT_ALIGN);
ImGuiToolkit::SliderTiming ("##Duration", &Settings::application.record.timeout, 1000, RECORD_MAX_TIMEOUT, 1000, "Until stopped");
ImGui::SameLine(0, IMGUI_SAME_LINE);
if (ImGuiToolkit::TextButton("Duration"))
Settings::application.record.timeout = RECORD_MAX_TIMEOUT;
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
ImGuiToolkit::SliderTiming ("Duration", &Settings::application.record.timeout, 1000, RECORD_MAX_TIMEOUT, 1000, "Until stopped");
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
ImGui::SliderInt("Trigger", &Settings::application.record.delay, 0, 5,
ImGui::SetNextItemWidth(1.4f * IMGUI_RIGHT_ALIGN);
ImGui::SliderInt("##Trigger", &Settings::application.record.delay, 0, 5,
Settings::application.record.delay < 1 ? "Immediate" : "After %d s");
ImGui::SameLine(0, IMGUI_SAME_LINE);
if (ImGuiToolkit::TextButton("Trigger"))
Settings::application.record.delay = 0;
ImGui::EndMenu();
}