From 3a8aee3ab0a4752eee488bd2a123b9bece757ab3 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 16 Jun 2011 16:47:10 +0200 Subject: black background... --- src/fbsplash.cpp | 21 +++++++++++---------- src/fbsplash.h | 36 ++++++++++++++++++------------------ src/main.cpp | 6 +++--- 3 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/fbsplash.cpp b/src/fbsplash.cpp index c2f52bb..7df12ab 100644 --- a/src/fbsplash.cpp +++ b/src/fbsplash.cpp @@ -1,28 +1,29 @@ #include "fbsplash.h" -fbsplash::fbsplash(){ - - qDebug() << "*fbsplash init*"; - +fbsplash::fbsplash() : + QMainWindow() { + + qDebug() << "fbsplash init"; + createQuitAction(); setupTheme(); - + setAttribute(Qt::WA_QuitOnClose, true); setWindowFlags(Qt::FramelessWindowHint); showFullScreen(); } //----------------------------------------------------------------------------- -void fbsplash::setupTheme(){ +void fbsplash::setupTheme() { // TODO configurable per cmdline // for now, black as base background color QPalette pal; - pal.setColor(QPalette::Base, Qt::black); - this->setPalette(pal); + pal.setColor(QPalette::Window, Qt::black); + setPalette(pal); } //----------------------------------------------------------------------------- -void fbsplash::createQuitAction(){ +void fbsplash::createQuitAction() { _quit = new QAction(tr("&quit"), this); _quit->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_X)); this->addAction(_quit); connect(_quit, SIGNAL(triggered()), this, SLOT(close())); -} \ No newline at end of file +} diff --git a/src/fbsplash.h b/src/fbsplash.h index f081906..c0a1990 100644 --- a/src/fbsplash.h +++ b/src/fbsplash.h @@ -1,34 +1,34 @@ - /* - * Copyright (c) 2010,2011 - OpenSLX Project - * - * This program/file is free software distributed under the GPL version 2. - * See http://openslx.org/COPYING - * - * If you have any feedback please consult http://openslx.org/feedback and - * send your feedback to feedback@openslx.org - * - * General information about OpenSLX can be found under http://openslx.org - * - */ +/* + * Copyright (c) 2010,2011 - OpenSLX Project + * + * This program/file is free software distributed under the GPL version 2. + * See http://openslx.org/COPYING + * + * If you have any feedback please consult http://openslx.org/feedback and + * send your feedback to feedback@openslx.org + * + * General information about OpenSLX can be found under http://openslx.org + * + */ #ifndef FBSPLASH_H #define FBSPLASH_H #include -class fbsplash: public QMainWindow{ - Q_OBJECT - +class fbsplash: public QMainWindow { +Q_OBJECT + public: fbsplash(); - + private: void setupTheme(); // ** TESTING STUFF ** void createQuitAction(); QAction* _quit; // ** TESTING STUFF ** - + }; -#endif // FBSPLASH_H \ No newline at end of file +#endif // FBSPLASH_H diff --git a/src/main.cpp b/src/main.cpp index 16c2daf..32d2688 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,12 +2,12 @@ #include "fbsplash.h" int main(int argc, char *argv[]) { - + QApplication app(argc, argv, QApplication::GuiServer); app.setOrganizationName("OpenSLX"); app.setApplicationName("fbsplash"); - + fbsplash bs; bs.show(); app.exec(); -} \ No newline at end of file +} -- cgit v1.2.3-55-g7522