Refactor high-dpi stuff

This commit is contained in:
craig.p.drummond
2014-06-04 18:45:30 +00:00
committed by craig.p.drummond
parent 406e1afde1
commit 8af2ea14f2
15 changed files with 34 additions and 35 deletions

View File

@@ -849,7 +849,7 @@ int Utils::layoutSpacing(QWidget *w)
{
int spacing=(w ? w->style() : qApp->style())->layoutSpacing(QSizePolicy::DefaultType, QSizePolicy::DefaultType, Qt::Vertical);
if (spacing<0) {
spacing=isHighDpi() ? 8 : 4;
spacing=scaleForDpi(4);
}
return spacing;
}
@@ -863,6 +863,11 @@ bool Utils::isHighDpi()
return fontHeight>22;
}
int Utils::scaleForDpi(int v)
{
return isHighDpi() ? v*2 : v;
}
Utils::Desktop Utils::currentDe()
{
#if !defined Q_OS_WIN32 && !defined Q_OS_MAC