Fix some issues with scaling on smaller screens.
This commit is contained in:
parent
bc84bc1df6
commit
06e89e5442
@ -1,4 +1,5 @@
|
||||
#include <QProcess>
|
||||
#include <QScreen>
|
||||
#include "installerprompt.h"
|
||||
#include "./ui_installerprompt.h"
|
||||
|
||||
@ -8,13 +9,22 @@ InstallerPrompt::InstallerPrompt(QWidget *parent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
// Set the background image, and let it change with the release
|
||||
// Set the background image and scale it
|
||||
QPixmap bg("../img/background.png");
|
||||
bg = bg.scaled(this->size(), Qt::IgnoreAspectRatio);
|
||||
QScreen *screen = QGuiApplication::primaryScreen();
|
||||
QRect screenGeometry = screen->geometry();
|
||||
|
||||
int height = screenGeometry.height();
|
||||
int width = screenGeometry.width();
|
||||
bg = bg.scaled(width, height, Qt::KeepAspectRatio);
|
||||
|
||||
QPalette palette;
|
||||
palette.setBrush(QPalette::Window, bg);
|
||||
this->setPalette(palette);
|
||||
|
||||
// Resize the layout widget to the screen size.
|
||||
ui->gridLayoutWidget->resize(width, height);
|
||||
|
||||
// Set the button colors
|
||||
QString css = "background-color: rgba(0, 104, 200, 100); color: white; border-radius: 15px;";
|
||||
ui->tryLubuntu->setAttribute(Qt::WA_TranslucentBackground);
|
||||
|
@ -6,9 +6,21 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>680</width>
|
||||
<height>420</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>680</width>
|
||||
<height>420</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>1920</width>
|
||||
<height>1080</height>
|
||||
</rect>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Try or Install Lubuntu</string>
|
||||
|
@ -6,7 +6,6 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
InstallerPrompt w;
|
||||
w.setWindowState(Qt::WindowFullScreen);
|
||||
w.show();
|
||||
w.showFullScreen();
|
||||
return a.exec();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user