summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2011-06-19 18:39:32 +0200
committerJonathan Bauer2011-06-19 18:39:32 +0200
commit37df5b12024b8cdd738084f71814ab107a9181a7 (patch)
tree301a797b642c569c40f9d68b70d084fa71220057
parentLayout using QT's external UI definition file (diff)
downloadfbsplash-37df5b12024b8cdd738084f71814ab107a9181a7.tar.gz
fbsplash-37df5b12024b8cdd738084f71814ab107a9181a7.tar.xz
fbsplash-37df5b12024b8cdd738084f71814ab107a9181a7.zip
new UI, old code cleanup
-rw-r--r--.gitignore4
-rw-r--r--src/fbsplash.cpp43
-rw-r--r--src/fbsplash.h10
-rw-r--r--src/main.cpp10
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("<font size=10 color='green'>OpenSLX</font>");
- _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();
}