Merge pull request #17737 from Chocobo1/logview

Use proper color for highlighted text in log widget
This commit is contained in:
Chocobo1 2022-09-23 13:31:04 +08:00 committed by GitHub
commit 2a3a4bff70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 52 additions and 17 deletions

View file

@ -35,8 +35,10 @@
#endif
#include <QApplication>
#include <QColor>
#include <QDesktopServices>
#include <QIcon>
#include <QPalette>
#include <QPixmap>
#include <QPixmapCache>
#include <QPoint>
@ -55,6 +57,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