summaryrefslogtreecommitdiffstats
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorSimon Rettberg2017-08-11 17:53:29 +0200
committerSimon Rettberg2017-08-11 17:53:29 +0200
commit1a32f34505fd7960304e15e5ca539be877d06c24 (patch)
tree2e825bb8e77033193777207343c6ffa7a52075b7 /src/mainwindow.cpp
parentMove code to src/, tweak CMakeLists.txt (diff)
downloadslxgreeter-1a32f34505fd7960304e15e5ca539be877d06c24.tar.gz
slxgreeter-1a32f34505fd7960304e15e5ca539be877d06c24.tar.xz
slxgreeter-1a32f34505fd7960304e15e5ca539be877d06c24.zip
Strip unneeded stuff, simplify pam dialog handling, add safety timeout of 10 seconds
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index a8dbd21..56f927f 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -117,7 +117,10 @@ void MainWindow::setBackground()
palette.setColor(QPalette::Background, Qt::black);
}
else {
- QBrush brush(backgroundImage.scaled(rect.width(), rect.height()));
+ backgroundImage = backgroundImage.scaled(rect.width(), rect.height(), Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
+ int xoff = (backgroundImage.width() - rect.width()) / 2;
+ int yoff = (backgroundImage.height() - rect.height()) / 2;
+ QBrush brush(backgroundImage.copy(xoff, yoff, backgroundImage.width(), backgroundImage.height()));
palette.setBrush(this->backgroundRole(), brush);
}
this->setPalette(palette);