From 37df5b12024b8cdd738084f71814ab107a9181a7 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Sun, 19 Jun 2011 18:39:32 +0200 Subject: new UI, old code cleanup --- .gitignore | 4 ++-- src/fbsplash.cpp | 43 +++---------------------------------------- src/fbsplash.h | 10 +++------- src/main.cpp | 10 ++++++++-- 4 files changed, 16 insertions(+), 51 deletions(-) diff --git a/.gitignore b/.gitignore index dc84959..524b093 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -build/ - +build +core diff --git a/src/fbsplash.cpp b/src/fbsplash.cpp index 6815c61..314a597 100644 --- a/src/fbsplash.cpp +++ b/src/fbsplash.cpp @@ -11,32 +11,8 @@ fbsplash::fbsplash(QWidget *parent) : ui->setupUi(this); createActions(); + //setupTheme(); - /* - setupTheme(); - - - // basic progress bar for now - QProgressBar* pb = new QProgressBar(this); - //pb->setFormat("Progress: %p%"); - pb->setWindowFlags(Qt::FramelessWindowHint); - pb->setRange(0, 100); - pb->setValue(10); - - // move the pb to the center, TODO proper margin - QRect desktopRect = QApplication::desktop()->availableGeometry(this); - QPoint center = desktopRect.center(); - pb->move(center.x() - pb->width()*0.5 , center.y() - pb->height()*0.5 + 50); - - // Label in the middle of the screen - _label = new QLabel("OpenSLX"); - _label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); - setCentralWidget(_label); - - setAttribute(Qt::WA_QuitOnClose, true); - setWindowFlags(Qt::FramelessWindowHint); - showFullScreen(); - */ } fbsplash::~fbsplash(){ delete ui; @@ -44,10 +20,7 @@ fbsplash::~fbsplash(){ //----------------------------------------------------------------------------- void fbsplash::setupTheme() { // TODO configurable per cmdline - // for now, black as base background color - QPalette pal; - pal.setColor(QPalette::Window, Qt::black); - setPalette(pal); + // TODO set per css } //----------------------------------------------------------------------------- void fbsplash::createActions() { @@ -55,15 +28,5 @@ void fbsplash::createActions() { _quit = new QAction(tr("&quit"), this); _quit->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_X)); this->addAction(_quit); - connect(_quit, SIGNAL(triggered()), this, SLOT(close())); - // Test action - _printSize = new QAction(tr("&test"), this); - _printSize->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_W)); - this->addAction(_printSize); - connect(_printSize, SIGNAL(triggered()), this, SLOT(printSizeAction())); -} -//----------------------------------------------------------------------------- -void fbsplash::printSizeAction(){ - qDebug() << "MW Height: " << _label->size().height(); - qDebug() << "MW Width: " << _label->size().width(); + connect(_quit, SIGNAL(triggered()), parent(), SLOT(close())); } diff --git a/src/fbsplash.h b/src/fbsplash.h index efbaeb1..896916d 100644 --- a/src/fbsplash.h +++ b/src/fbsplash.h @@ -31,21 +31,17 @@ public: virtual ~fbsplash(); private: + // functions void createActions(); void setupTheme(); - // ** TESTING ** - - void printSize(); + // members QAction* _quit; - QAction* _printSize; - QLabel* _label; Ui::fbsplash *ui; // ** TESTING ** + // ** TESTING ** -private slots: - void printSizeAction(); }; #endif // FBSPLASH_H diff --git a/src/main.cpp b/src/main.cpp index 32d2688..442c3ea 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,7 +7,13 @@ int main(int argc, char *argv[]) { app.setOrganizationName("OpenSLX"); app.setApplicationName("fbsplash"); - fbsplash bs; - bs.show(); + QMainWindow mw; + fbsplash bs(&mw); + + mw.setCentralWidget(&bs); + mw.setAttribute(Qt::WA_QuitOnClose, true); + mw.setWindowFlags(Qt::FramelessWindowHint); + mw.showFullScreen(); + app.exec(); } -- cgit v1.2.3-55-g7522