CtrlCore/Draw: UHD refactored

git-svn-id: svn://ultimatepp.org/upp/trunk@8835 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-08-22 12:43:35 +00:00
parent c3287d8df0
commit ca0c299378
5 changed files with 9 additions and 6 deletions

View file

@ -955,9 +955,6 @@ void Ctrl::ReSkin()
if(lock)
return;
lock++;
bool uhd = GetStdFontCy() > 22;
GUI_HiDPI_Write(GetStdFontCy() > 22);
SetUHDMode(uhd);
if(s_chdefault)
(*s_chdefault)();
if(skin)
@ -983,7 +980,6 @@ CH_INT(GUI_AKD_Conservative, 0);
CH_INT(GUI_DragDistance, 4);
CH_INT(GUI_DblClickTime, 500);
CH_INT(GUI_WheelScrollLines, 3);
CH_INT(GUI_HiDPI, 0);
String Ctrl::Name0() const {
GuiLock __;

View file

@ -1309,8 +1309,6 @@ int GUI_DragDistance();
int GUI_DblClickTime();
int GUI_WheelScrollLines();
int GUI_HiDPI();
void GUI_GlobalStyle_Write(int);
void GUI_DragFullWindow_Write(int);
void GUI_PopUpEffect_Write(int);

View file

@ -118,6 +118,7 @@ void Font::SyncStdFont()
{
Mutex::Lock __(sFontLock);
StdFontSize = Size(AStdFont.GetAveWidth(), AStdFont().Bold().GetCy());
SyncUHDMode();
}
void (*whenSetStdFont)();

View file

@ -202,6 +202,7 @@ Image RescaleBicubic(const Image& img, int cx, int cy, Gate2<int, int> progress
void SetUHDMode(bool b = true);
bool IsUHDMode();
void SyncUHDMode();
Image DPI(const Image& m);
Image DPI(const Image& img, int expected);

View file

@ -101,6 +101,13 @@ bool IsUHDMode()
return sUHDMode;
}
void SyncUHDMode()
{
bool uhd = GetStdFontCy() > 22;
if(uhd != IsUHDMode())
SetUHDMode(uhd);
}
Image DPI(const Image& img)
{
if(IsUHDMode()) {