Made the scraper GUIs narrower on ultrawide monitors.

This commit is contained in:
Leon Styhre 2021-07-02 17:51:07 +02:00
parent 6e28300a5a
commit 6627899f88
2 changed files with 12 additions and 2 deletions

View file

@ -118,7 +118,12 @@ GuiGameScraper::GuiGameScraper(
doneFunc(result); close(); });
mSearch->setCancelCallback([&] { delete this; });
setSize(Renderer::getScreenWidth() * 0.95f, Renderer::getScreenHeight() * 0.747f);
// Limit the width of the GUI on ultrawide monitors. The 1.778 aspect ratio value is
// the 16:9 reference.
float aspectValue = 1.778f / Renderer::getScreenAspectRatio();
float width = Math::clamp(0.95f * aspectValue, 0.70f, 0.95f) * Renderer::getScreenWidth();
setSize(width, Renderer::getScreenHeight() * 0.747f);
setPosition((Renderer::getScreenWidth() - mSize.x()) / 2, (Renderer::getScreenHeight() -
mSize.y()) / 2);

View file

@ -95,7 +95,12 @@ GuiScraperMulti::GuiScraperMulti(
mButtonGrid = makeButtonGrid(mWindow, buttons);
mGrid.setEntry(mButtonGrid, Vector2i(0, 4), true, false);
setSize(Renderer::getScreenWidth() * 0.95f, Renderer::getScreenHeight() * 0.849f);
// Limit the width of the GUI on ultrawide monitors. The 1.778 aspect ratio value is
// the 16:9 reference.
float aspectValue = 1.778f / Renderer::getScreenAspectRatio();
float width = Math::clamp(0.95f * aspectValue, 0.70f, 0.95f) * Renderer::getScreenWidth();
setSize(width, Renderer::getScreenHeight() * 0.849f);
setPosition((Renderer::getScreenWidth() - mSize.x()) / 2, (Renderer::getScreenHeight() -
mSize.y()) / 2);