Feature: Variable GUI scale.

GUI scale is now variable from 100% to 500%, and no longer restricted to
powers-of-2.
This commit is contained in:
Peter Nelson
2021-04-20 11:49:20 +01:00
committed by PeterN
parent 13d271217f
commit 9666e46739
22 changed files with 175 additions and 205 deletions

View File

@@ -167,15 +167,13 @@ public:
}
/**
* Get a suggested default GUI zoom taking screen DPI into account.
* Get a suggested default GUI scale taking screen DPI into account.
*/
virtual ZoomLevel GetSuggestedUIZoom()
virtual int GetSuggestedUIScale()
{
float dpi_scale = this->GetDPIScale();
if (dpi_scale >= 3.0f) return ZOOM_LVL_NORMAL;
if (dpi_scale >= 1.5f) return ZOOM_LVL_OUT_2X;
return ZOOM_LVL_OUT_4X;
return Clamp(dpi_scale * 100, MIN_INTERFACE_SCALE, MAX_INTERFACE_SCALE);
}
virtual const char *GetInfoString() const