Fixed: Restore scaled interface from icfg

--HG--
branch : experimental-ui-scaling
This commit is contained in:
Nimetu 2016-07-14 20:20:55 +03:00
parent 2cb71e654a
commit 6bfc777496

View file

@ -1787,8 +1787,12 @@ bool CInterfaceManager::loadConfig (const string &filename)
CWidgetManager::getInstance()->setScreenWH(_LastInGameScreenW, _LastInGameScreenH); CWidgetManager::getInstance()->setScreenWH(_LastInGameScreenW, _LastInGameScreenH);
// NB: we are typically InGame here (even though the _InGame flag is not yet set) // NB: we are typically InGame here (even though the _InGame flag is not yet set)
// Use the screen size of the config file. Don't update current UI, just _Modes // Use the screen size of the config file. Don't update current UI, just _Modes
CWidgetManager::getInstance()->moveAllWindowsToNewScreenSize(ClientCfg.Width, ClientCfg.Height, false); //
updateDesktops( ClientCfg.Width, ClientCfg.Height ); // ClientCfg has W/H set to screen size, but interface expects scaled size
sint32 scaledW = ClientCfg.Width / ClientCfg.InterfaceScale;
sint32 scaledH = ClientCfg.Height / ClientCfg.InterfaceScale;
CWidgetManager::getInstance()->moveAllWindowsToNewScreenSize(scaledW, scaledH, false);
updateDesktops(scaledW, scaledH);
} }
// *** apply the current mode // *** apply the current mode