diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 8eee16f..7ba8758 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -24,6 +24,8 @@ #include "x11util.h" #include "global.h" +static void createSimpleBackground(); + static void messageHandler(QtMsgType type, const QMessageLogContext&, const QString& msg) { std::cerr << type << ": " << msg.toUtf8().constData() << '\n'; @@ -56,8 +58,8 @@ int main(int argc, char *argv[]) if (ret == 0) { if (Global::autoLoginGuest()) { qWarning() << "Guest login ok"; - return a.exec(); - // TODO: Background? + createSimpleBackground(); + return a.exec(); } else { qWarning() << "Guest login failed"; // TODO: Set error message, display somewhere @@ -142,3 +144,11 @@ int main(int argc, char *argv[]) return a.exec(); } +static void createSimpleBackground() +{ + QImage img = Global::getConfigGradient(); + if (img.isNull()) + return; + img = img.scaled(QApplication::desktop()->size(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + AddPixmapToBackground(img.constBits(), img.width(), img.height(), 24, img.bytesPerLine(), img.byteCount()); +} |