Replace resolution dropdown with a slider; Increase limit to 500%

This commit is contained in:
Pierce Thompson
2025-01-13 19:55:01 +01:00
committed by xytovl
parent 6f0065d50c
commit 096ea1d13c
+4 -10
View File
@@ -607,17 +607,11 @@ void scenes::lobby::gui_settings()
const auto current = config.resolution_scale;
const auto width = stream_view.recommendedImageRectWidth;
const auto height = stream_view.recommendedImageRectHeight;
if (ImGui::BeginCombo(_S("Resolution scale"), fmt::format(_F("{}% - {}x{} per eye"), int(current * 100), int(width * current), int(height * current)).c_str()))
auto intScale = int(current * 100);
if (ImGui::SliderInt(_S("Resolution scale"), &intScale, 50, 500, fmt::format(_F("%d%% - {}x{} per eye"), int(width * current), int(height * current)).c_str()))
{
for (int scale = 50; scale <= 200; scale += 10)
{
if (ImGui::Selectable(fmt::format(_F("{}% - {}x{} per eye"), scale, (width * scale) / 100, (height * scale) / 100).c_str(), scale == current, ImGuiSelectableFlags_SelectOnRelease) and scale != current)
{
config.resolution_scale = scale * 0.01;
config.save();
}
}
ImGui::EndCombo();
config.resolution_scale = intScale * 0.01;
config.save();
}
vibrate_on_hover();
if (width * config.resolution_scale > stream_view.maxImageRectWidth or height * config.resolution_scale > stream_view.maxImageRectHeight)