diff options
-rw-r--r-- | src/yuzu/loading_screen.cpp | 60 |
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}, }; } |