mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-29 19:18:42 -07:00
Revive dark theme detection
The code was removed in 199d770e15
and now revived.
This commit is contained in:
parent
5e4a94e6b6
commit
0e0b8d1027
2 changed files with 11 additions and 0 deletions
|
@ -34,8 +34,10 @@
|
|||
#endif
|
||||
|
||||
#include <QApplication>
|
||||
#include <QColor>
|
||||
#include <QDesktopServices>
|
||||
#include <QIcon>
|
||||
#include <QPalette>
|
||||
#include <QPixmap>
|
||||
#include <QPixmapCache>
|
||||
#include <QPoint>
|
||||
|
@ -54,6 +56,13 @@
|
|||
#include "base/utils/fs.h"
|
||||
#include "base/utils/version.h"
|
||||
|
||||
bool Utils::Gui::isDarkTheme()
|
||||
{
|
||||
const QPalette palette = qApp->palette();
|
||||
const QColor &color = palette.color(QPalette::Active, QPalette::Base);
|
||||
return (color.lightness() < 127);
|
||||
}
|
||||
|
||||
QPixmap Utils::Gui::scaledPixmap(const QIcon &icon, const QWidget *widget, const int height)
|
||||
{
|
||||
Q_UNUSED(widget); // TODO: remove it
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue