summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2011-06-16 18:51:26 +0200
committerJonathan Bauer2011-06-16 18:51:26 +0200
commit0265dd84fe32abed0186c63b46ad53157f57fe25 (patch)
tree99f4f580e43046d49c1350fdd72822142036a030
parentblack background... (diff)
downloadfbsplash-0265dd84fe32abed0186c63b46ad53157f57fe25.tar.gz
fbsplash-0265dd84fe32abed0186c63b46ad53157f57fe25.tar.xz
fbsplash-0265dd84fe32abed0186c63b46ad53157f57fe25.zip
testing positions and sizes of floating widgets to find the better layout alternative...
-rw-r--r--src/fbsplash.cpp41
-rw-r--r--src/fbsplash.h9
2 files changed, 41 insertions, 9 deletions
diff --git a/src/fbsplash.cpp b/src/fbsplash.cpp
index cf42f97..ab85245 100644
--- a/src/fbsplash.cpp
+++ b/src/fbsplash.cpp
@@ -6,15 +6,31 @@ fbsplash::fbsplash() :
qDebug() << "fbsplash init";
- createQuitAction();
- setupTheme();
+ createActions();
- QProgressBar* pb;
- setCentralWidget(pb);
+ _label = new QLabel("OpenSLX");
+ _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);
+ 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);
+
+ //setupTheme();
setAttribute(Qt::WA_QuitOnClose, true);
- setWindowFlags(Qt::FramelessWindowHint);
- showFullScreen();
+ //setWindowFlags(Qt::FramelessWindowHint);
+ //showFullScreen();
}
//-----------------------------------------------------------------------------
void fbsplash::setupTheme() {
@@ -25,9 +41,20 @@ void fbsplash::setupTheme() {
setPalette(pal);
}
//-----------------------------------------------------------------------------
-void fbsplash::createQuitAction() {
+void fbsplash::createActions() {
+ // Quit through CTRL + X
_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();
}
diff --git a/src/fbsplash.h b/src/fbsplash.h
index c0a1990..31bf591 100644
--- a/src/fbsplash.h
+++ b/src/fbsplash.h
@@ -25,10 +25,15 @@ public:
private:
void setupTheme();
// ** TESTING STUFF **
- void createQuitAction();
+ void printSize();
+ void createActions();
QAction* _quit;
- // ** TESTING STUFF **
+ QAction* _printSize;
+ QLabel* _label;
+ // ** TESTING STUFF **
+private slots:
+ void printSizeAction();
};
#endif // FBSPLASH_H