diff options
author | Jonathan Bauer | 2011-06-17 16:02:53 +0200 |
---|---|---|
committer | Jonathan Bauer | 2011-06-17 16:02:53 +0200 |
commit | 50efdffaa4f096fd4fda812e46765c5c018bb1b4 (patch) | |
tree | b51b98be127abcbef36445d00b0e6f4296cad4f6 /src | |
parent | testing positions and sizes of floating widgets to find the better layout alt... (diff) | |
download | fbsplash-50efdffaa4f096fd4fda812e46765c5c018bb1b4.tar.gz fbsplash-50efdffaa4f096fd4fda812e46765c5c018bb1b4.tar.xz fbsplash-50efdffaa4f096fd4fda812e46765c5c018bb1b4.zip |
the geometric way to layout label/progress bar, TODO proper central widget...
Diffstat (limited to 'src')
-rw-r--r-- | src/fbsplash.cpp | 32 | ||||
-rw-r--r-- | src/fbsplash.h | 15 |
2 files changed, 29 insertions, 18 deletions
diff --git a/src/fbsplash.cpp b/src/fbsplash.cpp index ab85245..0e84c5c 100644 --- a/src/fbsplash.cpp +++ b/src/fbsplash.cpp @@ -1,36 +1,40 @@ #include <QProgressBar> #include "fbsplash.h" + fbsplash::fbsplash() : - QMainWindow() { + QMainWindow(){ qDebug() << "fbsplash init"; + //ui->setup(this); + createActions(); + setupTheme(); - _label = new QLabel("OpenSLX"); + _label = new QLabel("<font size=10 color='green'>OpenSLX</font>"); _label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); - QPalette pal; - pal.setColor(QPalette::Base, Qt::black); - _label->setPalette(pal); - setCentralWidget(_label); - //QDockWidget *dock = new QDockWidget(this); - //dock->setAllowedAreas(Qt::BottomDockWidgetArea); + + qDebug() << "center x: " << center.x(); + qDebug() << "center y: " << center.y(); + QProgressBar* pb = new QProgressBar(this); //pb->setFormat("Progress: %p%"); pb->setWindowFlags(Qt::FramelessWindowHint); pb->setRange(0, 100); - pb->setValue(50); - pb->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); - //addDockWidget(Qt::BottomDockWidgetArea, dock); + pb->setValue(10); - //setupTheme(); + 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); + + setCentralWidget(_label); setAttribute(Qt::WA_QuitOnClose, true); - //setWindowFlags(Qt::FramelessWindowHint); - //showFullScreen(); + setWindowFlags(Qt::FramelessWindowHint); + showFullScreen(); } //----------------------------------------------------------------------------- void fbsplash::setupTheme() { diff --git a/src/fbsplash.h b/src/fbsplash.h index 31bf591..145b92a 100644 --- a/src/fbsplash.h +++ b/src/fbsplash.h @@ -16,22 +16,29 @@ #include <QtGui> -class fbsplash: public QMainWindow { +//#include "ui_fbsplash.h" +//namespace Ui { class fbsplash; } + +class fbsplash: public QMainWindow{ Q_OBJECT public: fbsplash(); private: + void createActions(); void setupTheme(); - // ** TESTING STUFF ** + + // ** TESTING ** + void printSize(); - void createActions(); QAction* _quit; QAction* _printSize; QLabel* _label; + //Ui::fbsplash *ui; + + // ** TESTING ** - // ** TESTING STUFF ** private slots: void printSizeAction(); }; |