KoBox splash screen

Everything is finally taking place for v1.4/1.5
This commit is contained in:
Nicolas Mailloux 2021-04-30 23:55:38 -04:00
parent 29349614f0
commit 3404337e29
5 changed files with 48 additions and 11 deletions

View file

@ -22,6 +22,9 @@ namespace global {
inline bool skipOpenDialog;
inline bool startBatteryWatchdog;
}
namespace kobox {
inline bool showKoboxSplash;
}
namespace mainwindow {
namespace tabSwitcher {
inline bool repaint;

View file

@ -116,6 +116,15 @@ void koboxAppsDialog::on_launchBtn_clicked()
string_writeconfig("/external_root/tmp/X_dpi", dpiSetting);
// Wheeee!
global::kobox::showKoboxSplash = true;
// Re-use USBMS splash window for KoBox splash, since it's pretty much the same layout
usbmsSplashWindow = new usbms_splash();
usbmsSplashWindow->setAttribute(Qt::WA_DeleteOnClose);
usbmsSplashWindow->setGeometry(QRect(QPoint(0,0), screen()->geometry ().size()));
usbmsSplashWindow->show();
QApplication::processEvents();
string_writeconfig("/opt/ibxd", "x_start_gui\n");
}
}

View file

@ -4,6 +4,8 @@
#include <QDialog>
#include <QModelIndex>
#include "usbms_splash.h"
namespace Ui {
class koboxAppsDialog;
}
@ -30,6 +32,7 @@ private slots:
private:
Ui::koboxAppsDialog *ui;
usbms_splash *usbmsSplashWindow;
};
#endif // KOBOXAPPSDIALOG_H

View file

@ -14,8 +14,7 @@
#include <QProcess>
#include <QTimer>
#include <QIcon>
#include <cstdio>
#include <QScreen>
using namespace std;
@ -355,7 +354,8 @@ void settings::on_usbmsBtn_clicked()
usbmsWindow = new usbms_splash();
usbmsWindow->setAttribute(Qt::WA_DeleteOnClose);
usbmsWindow->showFullScreen();
usbmsWindow->setGeometry(QRect(QPoint(0,0), screen()->geometry ().size()));
usbmsWindow->show();
QTimer *usbms_t = new QTimer(this);
usbms_t->setInterval(1000);

View file

@ -4,6 +4,8 @@
#include <QPixmap>
#include <QScreen>
#include "functions.h"
usbms_splash::usbms_splash(QWidget *parent) :
QWidget(parent),
ui(new Ui::usbms_splash)
@ -15,16 +17,36 @@ usbms_splash::usbms_splash(QWidget *parent) :
float sH = QGuiApplication::screens()[0]->size().height();
// Defining what the default icon size will be
float stdIconWidth = sW / 1.15;
float stdIconHeight = sH / 1.15;
if(global::kobox::showKoboxSplash == true) {
float stdIconWidth = sW / 1.30;
float stdIconHeight = sH / 1.30;
this->setStyleSheet("background-color:black;");
ui->label->setStyleSheet("QLabel { background-color : black; color : white; }");
ui->label_3->setStyleSheet("QLabel { background-color : black; color : white; font-size: 9pt}");
// Stylesheet
QFile stylesheetFile(":/resources/eink.qss");
stylesheetFile.open(QFile::ReadOnly);
this->setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close();
QPixmap pixmap(":/resources/usbms.png");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
ui->label_2->setPixmap(scaledPixmap);
ui->label->setText("Launching KoBox subsystem");
ui->label_3->setText("Please wait, this could take a while.");
ui->label_3->setStyleSheet("font-size: 9pt");
QPixmap pixmap(":/resources/kobox-icon.png");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
ui->label_2->setPixmap(scaledPixmap);
}
else {
float stdIconWidth = sW / 1.15;
float stdIconHeight = sH / 1.15;
this->setStyleSheet("background-color:black;");
ui->label->setStyleSheet("QLabel { background-color : black; color : white; }");
ui->label_3->setStyleSheet("QLabel { background-color : black; color : white; font-size: 9pt}");
QPixmap pixmap(":/resources/usbms.png");
QPixmap scaledPixmap = pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio);
ui->label_2->setPixmap(scaledPixmap);
}
}
usbms_splash::~usbms_splash()