ui: polishing for presentation
* enabled highDpi icons in QApplication for Searchbar Icons * realigned StartScreen contents * showing version number 0.1 * "Search" as placeholder text in SearchBar * same content margins for each dockwidget view * brighter variable color in Graph * press ESC to close StartScreen
This commit is contained in:
+11
-43
@@ -1,19 +1,16 @@
|
||||
#include <memory>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QBitmap>
|
||||
#include <QThread>
|
||||
#include <QSplashScreen>
|
||||
#include <QtWidgets/qmainwindow.h>
|
||||
|
||||
#include "utility/logging/ConsoleLogger.h"
|
||||
#include "utility/logging/FileLogger.h"
|
||||
#include "utility/logging/LogManager.h"
|
||||
|
||||
#include "Application.h"
|
||||
#include "includes.h" // defines 'void setup(int argc, char *argv[])'
|
||||
#include "qt/element/QtSplashScreen.h"
|
||||
#include "qt/utility/utilityQt.h"
|
||||
#include "qt/view/QtViewFactory.h"
|
||||
#include "utility/logging/ConsoleLogger.h"
|
||||
#include "utility/logging/FileLogger.h"
|
||||
#include "utility/logging/LogManager.h"
|
||||
|
||||
void init()
|
||||
{
|
||||
@@ -28,56 +25,27 @@ void init()
|
||||
utility::loadFontsFromDirectory("data/fonts", ".otf");
|
||||
}
|
||||
|
||||
class InitThread : public QThread
|
||||
{
|
||||
public:
|
||||
void run(void)
|
||||
{
|
||||
//min Time the Splash screen is displayed
|
||||
QThread::msleep(500);
|
||||
}
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
setup(argc, argv);
|
||||
QApplication qtApp(argc, argv);
|
||||
|
||||
QPixmap whitePixmap(500,500);
|
||||
qtApp.setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
|
||||
QPixmap whitePixmap(500, 500);
|
||||
whitePixmap.fill(Qt::white);
|
||||
|
||||
QPixmap p;
|
||||
p.load("data/gui/splash_white.png");
|
||||
QPixmap foreground = p.scaled(whitePixmap.size()*0.8);
|
||||
p.load("data/gui/splash_blue.png");
|
||||
QPixmap background = p.scaled(whitePixmap.size()*0.9);
|
||||
|
||||
QtSplashScreen* splash = new QtSplashScreen(whitePixmap, Qt::WindowStaysOnTopHint);
|
||||
qtApp.processEvents();
|
||||
splash->setForeground(foreground);
|
||||
splash->setBackground(background);
|
||||
|
||||
splash->show();
|
||||
splash->repaint();
|
||||
|
||||
qtApp.processEvents();
|
||||
if (splash) splash->message( "Starting GUI" );
|
||||
qtApp.processEvents();
|
||||
splash->setMessage("Loading UI");
|
||||
splash->setVersion("0.1");
|
||||
splash->exec(qtApp);
|
||||
|
||||
init();
|
||||
|
||||
// Eventloop for Splashscreen
|
||||
QEventLoop loop;
|
||||
InitThread* initThread = new InitThread();
|
||||
QObject::connect(initThread, SIGNAL(finished()), &loop, SLOT(quit()));
|
||||
QObject::connect(initThread, SIGNAL(terminated()), &loop, SLOT(quit()));
|
||||
initThread->start();
|
||||
loop.exec();
|
||||
|
||||
QtViewFactory viewFactory;
|
||||
std::shared_ptr<Application> app = Application::create(&viewFactory);
|
||||
|
||||
if(splash)
|
||||
if (splash)
|
||||
{
|
||||
delete splash;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user