summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Rowe <jroweboy@gmail.com>2019-01-21 02:20:21 +0100
committerJames Rowe <jroweboy@gmail.com>2019-01-21 02:20:21 +0100
commit4bce57b1495aec153041da0cb5bd5be8f518aea8 (patch)
treeecdc17de8850bf289e1d5add4f4632ebcc15ff1a
parentHide progress bar on Prepare step (diff)
downloadyuzu-4bce57b1495aec153041da0cb5bd5be8f518aea8.tar
yuzu-4bce57b1495aec153041da0cb5bd5be8f518aea8.tar.gz
yuzu-4bce57b1495aec153041da0cb5bd5be8f518aea8.tar.bz2
yuzu-4bce57b1495aec153041da0cb5bd5be8f518aea8.tar.lz
yuzu-4bce57b1495aec153041da0cb5bd5be8f518aea8.tar.xz
yuzu-4bce57b1495aec153041da0cb5bd5be8f518aea8.tar.zst
yuzu-4bce57b1495aec153041da0cb5bd5be8f518aea8.zip
-rw-r--r--src/yuzu/loading_screen.cpp60
1 files changed, 32 insertions, 28 deletions
diff --git a/src/yuzu/loading_screen.cpp b/src/yuzu/loading_screen.cpp
index 530f5173c..608ab6f02 100644
--- a/src/yuzu/loading_screen.cpp
+++ b/src/yuzu/loading_screen.cpp
@@ -28,28 +28,11 @@
#include <QMovie>
#endif
-LoadingScreen::LoadingScreen(QWidget* parent)
- : QWidget(parent), ui(std::make_unique<Ui::LoadingScreen>()),
- previous_stage(VideoCore::LoadCallbackStage::Complete) {
- ui->setupUi(this);
-
- connect(this, &LoadingScreen::LoadProgress, this, &LoadingScreen::OnLoadProgress,
- Qt::QueuedConnection);
- qRegisterMetaType<VideoCore::LoadCallbackStage>();
-
- stage_translations = {
- {VideoCore::LoadCallbackStage::Prepare, tr("Loading...")},
- {VideoCore::LoadCallbackStage::Raw, tr("Preparing Shaders %1 / %2")},
- {VideoCore::LoadCallbackStage::Binary, tr("Loading Shaders %1 / %2")},
- {VideoCore::LoadCallbackStage::Complete, tr("Launching...")},
- };
- progressbar_style = {
- {VideoCore::LoadCallbackStage::Prepare,
- R"(
+constexpr const char* PROGRESSBAR_STYLE_PREPARE = R"(
QProgressBar {}
-QProgressBar::chunk {})"},
- {VideoCore::LoadCallbackStage::Raw,
- R"(
+QProgressBar::chunk {})";
+
+constexpr const char* PROGRESSBAR_STYLE_RAW = R"(
QProgressBar {
background-color: black;
border: 2px solid white;
@@ -58,9 +41,9 @@ QProgressBar {
}
QProgressBar::chunk {
background-color: #0ab9e6;
-})"},
- {VideoCore::LoadCallbackStage::Binary,
- R"(
+})";
+
+constexpr const char* PROGRESSBAR_STYLE_BINARY = R"(
QProgressBar {
background-color: black;
border: 2px solid white;
@@ -69,9 +52,9 @@ QProgressBar {
}
QProgressBar::chunk {
background-color: #ff3c28;
-})"},
- {VideoCore::LoadCallbackStage::Complete,
- R"(
+})";
+
+constexpr const char* PROGRESSBAR_STYLE_COMPLETE = R"(
QProgressBar {
background-color: black;
border: 2px solid white;
@@ -80,7 +63,28 @@ QProgressBar {
}
QProgressBar::chunk {
background-color: #ff3c28;
-})"},
+})";
+
+LoadingScreen::LoadingScreen(QWidget* parent)
+ : QWidget(parent), ui(std::make_unique<Ui::LoadingScreen>()),
+ previous_stage(VideoCore::LoadCallbackStage::Complete) {
+ ui->setupUi(this);
+
+ connect(this, &LoadingScreen::LoadProgress, this, &LoadingScreen::OnLoadProgress,
+ Qt::QueuedConnection);
+ qRegisterMetaType<VideoCore::LoadCallbackStage>();
+
+ stage_translations = {
+ {VideoCore::LoadCallbackStage::Prepare, tr("Loading...")},
+ {VideoCore::LoadCallbackStage::Raw, tr("Preparing Shaders %1 / %2")},
+ {VideoCore::LoadCallbackStage::Binary, tr("Loading Shaders %1 / %2")},
+ {VideoCore::LoadCallbackStage::Complete, tr("Launching...")},
+ };
+ progressbar_style = {
+ {VideoCore::LoadCallbackStage::Prepare, PROGRESSBAR_STYLE_PREPARE},
+ {VideoCore::LoadCallbackStage::Raw, PROGRESSBAR_STYLE_RAW},
+ {VideoCore::LoadCallbackStage::Binary, PROGRESSBAR_STYLE_BINARY},
+ {VideoCore::LoadCallbackStage::Complete, PROGRESSBAR_STYLE_COMPLETE},
};
}