summaryrefslogtreecommitdiffstats
path: root/src/fbsplash.cpp
blob: ab852457d0b5432da7144ed9727dc8b36edd9d4b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <QProgressBar>
#include "fbsplash.h"

fbsplash::fbsplash() :
   QMainWindow() {

   qDebug() << "fbsplash init";

   createActions();

   _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();
}
//-----------------------------------------------------------------------------
void fbsplash::setupTheme() {
   // TODO configurable per cmdline
   // for now, black as base background color
   QPalette pal;
   pal.setColor(QPalette::Window, Qt::black);
   setPalette(pal);
}
//-----------------------------------------------------------------------------
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();
}