aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-07-31 08:53:57 -0400
committerKen Moore <moorekou@gmail.com>2015-07-31 08:53:57 -0400
commita3b6e316bfb2006545417d839147caba22fb064c (patch)
tree050ec08940169966108230b6621cb27c5a2553c2
parentFix up the issues with some apps which re-configure the Xsession/screens to m... (diff)
downloadlumina-a3b6e316bfb2006545417d839147caba22fb064c.tar.gz
lumina-a3b6e316bfb2006545417d839147caba22fb064c.tar.bz2
lumina-a3b6e316bfb2006545417d839147caba22fb064c.zip
Change the QSplashScreen for the lumina-open OSD to a simple QLabel (makes it faster to load/show - preventing the issues with QSplashScreen and particular GPU drivers).
-rw-r--r--lumina-open/main.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/lumina-open/main.cpp b/lumina-open/main.cpp
index 81c0f9c4..9ac2181a 100644
--- a/lumina-open/main.cpp
+++ b/lumina-open/main.cpp
@@ -16,11 +16,11 @@
#include <QDebug>
#include <QTranslator>
#include <QMessageBox>
-#include <QSplashScreen>
+#include <QLabel>
#include <QDateTime>
#include <QPixmap>
#include <QColor>
-#include <QFont>
+#include <QDesktopWidget>
#include "LFileDialog.h"
@@ -58,16 +58,19 @@ void showOSD(int argc, char **argv, QString message){
//Display the OSD
QPixmap pix(":/icons/OSD.png");
- QSplashScreen splash(pix, Qt::SplashScreen | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint);
+ QLabel splash(0, Qt::Window | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint);
splash.setWindowTitle("");
- QFont myfont;
- myfont.setBold(true);
- myfont.setPixelSize(13);
- splash.setFont(myfont);
+ splash.setStyleSheet("QLabel{background: black; color: white; font-weight: bold; font-size: 13pt; margin: 1ex;}");
+ splash.setAlignment(Qt::AlignCenter);
+
+
qDebug() << "Display OSD";
+ splash.setText(message);
+ //Make sure it is centered on the current screen
+ QPoint center = App.desktop()->screenGeometry(QCursor::pos()).center();
+ splash.move(center.x()-(splash.sizeHint().width()/2), center.y()-(splash.sizeHint().height()/2));
splash.show();
//qDebug() << " - show message";
- splash.showMessage(message, Qt::AlignCenter, Qt::white);
//qDebug() << " - loop";
QDateTime end = QDateTime::currentDateTime().addMSecs(800);
while(QDateTime::currentDateTime() < end){ App.processEvents(); }
bgstack15