Skip to content

Commit

Permalink
Viewer: add help tooltips to most settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
kosua20 committed Aug 28, 2023
1 parent 589ebd9 commit e627c94
Show file tree
Hide file tree
Showing 2 changed files with 179 additions and 16 deletions.
23 changes: 21 additions & 2 deletions src/helpers/Recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ void Recorder::record(const std::shared_ptr<Framebuffer> & frame){
bool Recorder::drawGUI(float scale){
bool shouldStart = false;


if(ImGui::BeginPopupModal("Export", nullptr, ImGuiWindowFlags_AlwaysAutoResize)){
ImGui::PushItemWidth(scale * 100);
const float scaledColumn = scale * EXPORT_COLUMN_SIZE;
Expand All @@ -257,23 +256,38 @@ bool Recorder::drawGUI(float scale){
}
ImGui::EndCombo();
}
if(ImGui::IsItemHovered()){
ImGui::SetTooltip("Select the export format, either a video codec or an image sequence format");
}

// Extra options.
ImGui::SameLine(scaledColumn);
ImGui::InputInt("Framerate", &_config.framerate);
if(ImGui::IsItemHovered()){
ImGui::SetTooltip("Number of frames per second");
}

if(ImGui::InputInt2("Export size", &_size[0])){
_size[0] += _size[0] % 2;
_size[1] += _size[1] % 2;
}
if(ImGui::IsItemHovered()){
ImGui::SetTooltip("Resolution of the sequence");
}

ImGui::SameLine(scaledColumn);

ImGui::InputFloat("Postroll", &_config.postroll, 0.1f, 1.0f, "%.1fs");
if(ImGui::IsItemHovered()){
ImGui::SetTooltip("Extend the playback duration");
}

bool lineStarted = false;
if(_config.format == Export::Format::PNG || _config.format == Export::Format::PRORES){
ImGui::Checkbox("Transparent bg.", &_config.alphaBackground);
if(ImGui::IsItemHovered()){
ImGui::SetTooltip("Use a transparent background");
}
lineStarted = true;
}

Expand All @@ -282,14 +296,19 @@ bool Recorder::drawGUI(float scale){
ImGui::SameLine(scaledColumn);
}
ImGui::InputInt("Rate (Mbps)", &_config.bitrate);
if(ImGui::IsItemHovered()){
ImGui::SetTooltip("Set the video export quality");
}
}
if((_config.format == Export::Format::PNG || _config.format == Export::Format::PRORES) && _config.alphaBackground){
ImGui::Checkbox("Fix premultiply", &_config.fixPremultiply);
if(ImGui::IsItemHovered()){
ImGui::SetTooltip("Compensate for alpha premultiplication");
}
}

ImGui::PopItemWidth();


// Pick directory/file.
const ImVec2 buttonSize(scaledColumn - scale * 20.0f, 0.0f);
if(ImGui::Button("Cancel##videpopup", buttonSize)){
Expand Down
Loading

0 comments on commit e627c94

Please sign in to comment.