mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-25 22:14:32 +00:00
Add helper function: Get DPI scaled icon size (device-dependent)
This commit is contained in:
parent
3335a111e1
commit
e275c3ba52
@ -43,6 +43,7 @@
|
|||||||
#else
|
#else
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
|
#include <QStyle>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
@ -543,3 +544,12 @@ void Utils::Misc::msleep(unsigned long msecs)
|
|||||||
{
|
{
|
||||||
SleeperThread::msleep(msecs);
|
SleeperThread::msleep(msecs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef DISABLE_GUI
|
||||||
|
QSize Utils::Misc::smallIconSize()
|
||||||
|
{
|
||||||
|
// Get DPI scaled icon size (device-dependent), see QT source
|
||||||
|
int s = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);
|
||||||
|
return QSize(s, s);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
@ -54,6 +54,7 @@ namespace Utils
|
|||||||
void shutdownComputer(ShutdownAction action);
|
void shutdownComputer(ShutdownAction action);
|
||||||
// Get screen center
|
// Get screen center
|
||||||
QPoint screenCenter(QWidget *win);
|
QPoint screenCenter(QWidget *win);
|
||||||
|
QSize smallIconSize();
|
||||||
#endif
|
#endif
|
||||||
int pythonVersion();
|
int pythonVersion();
|
||||||
QString pythonExecutable();
|
QString pythonExecutable();
|
||||||
|
@ -67,7 +67,7 @@ FiltersBase::FiltersBase(QWidget *parent, TransferListWidget *transferList)
|
|||||||
setUniformItemSizes(true);
|
setUniformItemSizes(true);
|
||||||
setSpacing(0);
|
setSpacing(0);
|
||||||
|
|
||||||
setIconSize(QSize(16, 16));
|
setIconSize(Utils::Misc::smallIconSize());
|
||||||
|
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MAC)
|
||||||
setAttribute(Qt::WA_MacShowFocusRect, false);
|
setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user