SaveTool: improve the settings menu layout.

This commit is contained in:
Guillaume Jacquemin 2021-08-18 16:59:16 +02:00
parent 52f5e8eb0a
commit d52b381426

View file

@ -66,7 +66,7 @@ void SaveTool::drawMainMenu() {
"FPS cap, no V-sync" "FPS cap, no V-sync"
}; };
ImGui::SetNextItemWidth(150.0f); ImGui::SetNextItemWidth(ImGui::GetContentRegionAvailWidth());
if(ImGui::BeginCombo("##FrameLimit", framelimit_labels[selection])) { if(ImGui::BeginCombo("##FrameLimit", framelimit_labels[selection])) {
if(ImGui::Selectable(framelimit_labels[0], _framelimit == Framelimit::Vsync)) { if(ImGui::Selectable(framelimit_labels[0], _framelimit == Framelimit::Vsync)) {
selection = 0; selection = 0;
@ -92,6 +92,7 @@ void SaveTool::drawMainMenu() {
static constexpr UnsignedInt min_fps = 15; static constexpr UnsignedInt min_fps = 15;
static constexpr UnsignedInt max_fps = 150; static constexpr UnsignedInt max_fps = 150;
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvailWidth());
if(ImGui::SliderScalar("##FpsSlider", ImGuiDataType_U32, &_fpsCap, &min_fps, &max_fps, "%u FPS", ImGuiSliderFlags_AlwaysClamp)) { if(ImGui::SliderScalar("##FpsSlider", ImGuiDataType_U32, &_fpsCap, &min_fps, &max_fps, "%u FPS", ImGuiSliderFlags_AlwaysClamp)) {
setMinimalLoopPeriod(1000 / _fpsCap); setMinimalLoopPeriod(1000 / _fpsCap);
} }