|
|
|
|
@ -31,6 +31,8 @@ BackgroundHelper::BackgroundHelper(QObject *parent)
|
|
|
|
|
, m_statusBarHeight(25 / qApp->devicePixelRatio())
|
|
|
|
|
, m_type(0)
|
|
|
|
|
{
|
|
|
|
|
onPrimaryScreenChanged();
|
|
|
|
|
connect(qApp, &QApplication::primaryScreenChanged, this, &BackgroundHelper::onPrimaryScreenChanged);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BackgroundHelper::setColor(QColor c)
|
|
|
|
|
@ -80,6 +82,14 @@ void BackgroundHelper::setBackgound(const QString &fileName)
|
|
|
|
|
QPixmapCache::clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BackgroundHelper::onPrimaryScreenChanged()
|
|
|
|
|
{
|
|
|
|
|
disconnect(qApp->primaryScreen());
|
|
|
|
|
|
|
|
|
|
connect(qApp->primaryScreen(), &QScreen::geometryChanged, this, &BackgroundHelper::onChanged);
|
|
|
|
|
connect(qApp->primaryScreen(), &QScreen::virtualGeometryChanged, this, &BackgroundHelper::onChanged);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BackgroundHelper::onChanged()
|
|
|
|
|
{
|
|
|
|
|
switch (m_type) {
|
|
|
|
|
|