mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Resize dialog size on high DPI monitors
This commit is contained in:
parent
aaaa67050c
commit
27cf98a962
26 changed files with 125 additions and 80 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue