Merge 0.8.3 upstream

This commit is contained in:
Yuriy Puchkov
2020-10-02 10:13:04 +03:00
37 changed files with 1293 additions and 1550 deletions

View File

@@ -24,11 +24,8 @@ inline qreal getColorLuma(const QColor& c)
bool ColorUtils::colorIsDark(const QColor& c)
{
bool isWhite = false;
if (getColorLuma(c) <= 0.60) {
isWhite = true;
}
return isWhite;
// when luma <= 0.5, we considor it as a dark color
return getColorLuma(c) <= 0.5;
}
QColor ColorUtils::contrastColor(const QColor& c)

View File

@@ -90,7 +90,10 @@ QPixmap ScreenGrabber::grabEntireDesktop(bool& ok)
QRect geometry;
for (QScreen* const screen : QGuiApplication::screens()) {
geometry = geometry.united(screen->geometry());
QRect scrRect = screen->geometry();
scrRect.moveTo(scrRect.x() / screen->devicePixelRatio(),
scrRect.y() / screen->devicePixelRatio());
geometry = geometry.united(scrRect);
}
QPixmap p(QApplication::primaryScreen()->grabWindow(