parent
edc608e98a
commit
e05ca8280e
@ -0,0 +1,27 @@
|
||||
#include "backgroundscreen.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QGuiApplication>
|
||||
#include <QScreen>
|
||||
|
||||
BackgroundScreen::BackgroundScreen(QWidget *parent)
|
||||
: QWidget(parent) {
|
||||
// Set the background image and scale it
|
||||
QPixmap bg(":/background");
|
||||
if (bg.isNull()) {
|
||||
// the user will see the warning message that the InstallerPrompt object pops up, no need to bombard them with one message per screen
|
||||
return;
|
||||
}
|
||||
|
||||
QScreen *screen = QGuiApplication::primaryScreen();
|
||||
QRect screenGeometry = screen->geometry();
|
||||
bg = bg.scaled(screenGeometry.size(), Qt::IgnoreAspectRatio);
|
||||
|
||||
QPalette palette;
|
||||
palette.setBrush(QPalette::Window, bg);
|
||||
this->setPalette(palette);
|
||||
}
|
||||
|
||||
BackgroundScreen::~BackgroundScreen()
|
||||
{
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
#ifndef BACKGROUNDSCREEN_H
|
||||
#define BACKGROUNDSCREEN_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class BackgroundScreen : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BackgroundScreen(QWidget *parent = nullptr);
|
||||
virtual ~BackgroundScreen();
|
||||
};
|
||||
|
||||
#endif // BACKGROUNDSCREEN_H
|
Loading…
Reference in new issue