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:
@@ -1269,7 +1269,7 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel
|
||||
/** Screen the window is on changed. */
|
||||
- (void)windowDidChangeBackingProperties:(NSNotification *)notification
|
||||
{
|
||||
bool did_adjust = AdjustGUIZoom();
|
||||
bool did_adjust = AdjustGUIZoom(true);
|
||||
|
||||
/* Reallocate screen buffer if necessary. */
|
||||
driver->AllocateBackingStore();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -675,7 +675,7 @@ LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
|
||||
case WM_DPICHANGED: {
|
||||
auto did_adjust = AdjustGUIZoom();
|
||||
auto did_adjust = AdjustGUIZoom(true);
|
||||
|
||||
/* Resize the window to match the new DPI setting. */
|
||||
RECT *prcNewWindow = (RECT *)lParam;
|
||||
|
||||
Reference in New Issue
Block a user