mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
Resize dialog size on high DPI monitors
This commit is contained in:
@@ -35,6 +35,14 @@
|
||||
#include <QWidget>
|
||||
#include <QWindow>
|
||||
|
||||
void Utils::Gui::resize(QWidget *widget, const QSize &newSize)
|
||||
{
|
||||
if (newSize.isValid())
|
||||
widget->resize(newSize);
|
||||
else // depends on screen DPI
|
||||
widget->resize(widget->size() * screenScalingFactor(widget));
|
||||
}
|
||||
|
||||
qreal Utils::Gui::screenScalingFactor(const QWidget *widget)
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
|
||||
Reference in New Issue
Block a user