window drawing bugfix
This commit is contained in:
1 parent
6f3556009a
commit
19006fac6c
5 files changed
+36
-27
No files matched your search
+15
-3
@@ -28,12 +28,15 @@
|
||||
|
||||
#include "Back.h"
|
||||
|
||||
#include "Dpi/DpiForms.h"
|
||||
#include "Global.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QPainter>
|
||||
#include <QScreen>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace Cevo {
|
||||
|
||||
Background::Background(QWidget *parent) : QWidget(parent)
|
||||
@@ -54,9 +57,9 @@ void Background::showEvent(QShowEvent *event)
|
||||
|
||||
void Background::updateInterface()
|
||||
{
|
||||
const QRect screenRect = Dpi::Screen::primaryMonitor().boundsRect();
|
||||
if (fullScreen) {
|
||||
if (QScreen *primaryScreen = screen())
|
||||
setGeometry(primaryScreen->geometry());
|
||||
setGeometry(screenRect);
|
||||
showFullScreen();
|
||||
if (!m_img) {
|
||||
const QString fileName = getGraphicsDir() + QLatin1Char('/') + QStringLiteral("Background") + PngExt;
|
||||
@@ -66,12 +69,21 @@ void Background::updateInterface()
|
||||
update();
|
||||
}
|
||||
}
|
||||
if (m_anchor) {
|
||||
// Below the logo, with its bottom near the bottom of the screen.
|
||||
const QPoint shift((screenRect.width() - std::min(screenRect.width(), 800)) * 3 / 8,
|
||||
(screenRect.height() - std::min(screenRect.height(), 600)) / 3);
|
||||
m_anchor->move(shift.x(), screenRect.height() - m_anchor->height() - shift.y());
|
||||
}
|
||||
} else {
|
||||
// Dropped the original's wsNormal/wsFullScreen/wsNormal toggle - an
|
||||
// LCL-specific refresh workaround, not needed with Qt.
|
||||
showNormal();
|
||||
if (m_anchor) {
|
||||
setGeometry(m_anchor->x() - 8, m_anchor->y() - 8, m_anchor->width() + 16, m_anchor->height() + 16);
|
||||
// A black frame around the anchor, centred on the screen.
|
||||
const QSize frameSize = m_anchor->size() + QSize(16, 16);
|
||||
setGeometry(QRect(screenRect.center() - QPoint(frameSize.width() / 2, frameSize.height() / 2), frameSize));
|
||||
m_anchor->move(8, 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user