Resize dialog size on high DPI monitors

This commit is contained in:
Chocobo1 2017-12-03 15:32:58 +08:00
parent aaaa67050c
commit 27cf98a962
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
26 changed files with 125 additions and 80 deletions

View file

@ -39,7 +39,15 @@ namespace Utils
{
namespace Gui
{
void resize(QWidget *widget, const QSize &newSize = {});
qreal screenScalingFactor(const QWidget *widget);
template <typename T>
T scaledSize(const QWidget *widget, const T &size)
{
return (size * screenScalingFactor(widget));
}
QPixmap scaledPixmap(const QString &path, const QWidget *widget, const int height = 0);
QSize smallIconSize(const QWidget *widget = nullptr);
QSize mediumIconSize(const QWidget *widget = nullptr);