diff options
author | Simon Rettberg | 2017-08-11 17:53:29 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-08-11 17:53:29 +0200 |
commit | 1a32f34505fd7960304e15e5ca539be877d06c24 (patch) | |
tree | 2e825bb8e77033193777207343c6ffa7a52075b7 /src/mainwindow.cpp | |
parent | Move code to src/, tweak CMakeLists.txt (diff) | |
download | slxgreeter-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.cpp | 5 |
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); |