summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 @@
28#include <QMovie> 28#include <QMovie>
29#endif 29#endif
30 30
31LoadingScreen::LoadingScreen(QWidget* parent) 31constexpr const char* PROGRESSBAR_STYLE_PREPARE = R"(
32 : QWidget(parent), ui(std::make_unique<Ui::LoadingScreen>()),
33 previous_stage(VideoCore::LoadCallbackStage::Complete) {
34 ui->setupUi(this);
35
36 connect(this, &LoadingScreen::LoadProgress, this, &LoadingScreen::OnLoadProgress,
37 Qt::QueuedConnection);
38 qRegisterMetaType<VideoCore::LoadCallbackStage>();
39
40 stage_translations = {
41 {VideoCore::LoadCallbackStage::Prepare, tr("Loading...")},
42 {VideoCore::LoadCallbackStage::Raw, tr("Preparing Shaders %1 / %2")},
43 {VideoCore::LoadCallbackStage::Binary, tr("Loading Shaders %1 / %2")},
44 {VideoCore::LoadCallbackStage::Complete, tr("Launching...")},
45 };
46 progressbar_style = {
47 {VideoCore::LoadCallbackStage::Prepare,
48 R"(
49QProgressBar {} 32QProgressBar {}
50QProgressBar::chunk {})"}, 33QProgressBar::chunk {})";
51 {VideoCore::LoadCallbackStage::Raw, 34
52 R"( 35constexpr const char* PROGRESSBAR_STYLE_RAW = R"(
53QProgressBar { 36QProgressBar {
54 background-color: black; 37 background-color: black;
55 border: 2px solid white; 38 border: 2px solid white;
@@ -58,9 +41,9 @@ QProgressBar {
58} 41}
59QProgressBar::chunk { 42QProgressBar::chunk {
60 background-color: #0ab9e6; 43 background-color: #0ab9e6;
61})"}, 44})";
62 {VideoCore::LoadCallbackStage::Binary, 45
63 R"( 46constexpr const char* PROGRESSBAR_STYLE_BINARY = R"(
64QProgressBar { 47QProgressBar {
65 background-color: black; 48 background-color: black;
66 border: 2px solid white; 49 border: 2px solid white;
@@ -69,9 +52,9 @@ QProgressBar {
69} 52}
70QProgressBar::chunk { 53QProgressBar::chunk {
71 background-color: #ff3c28; 54 background-color: #ff3c28;
72})"}, 55})";
73 {VideoCore::LoadCallbackStage::Complete, 56
74 R"( 57constexpr const char* PROGRESSBAR_STYLE_COMPLETE = R"(
75QProgressBar { 58QProgressBar {
76 background-color: black; 59 background-color: black;
77 border: 2px solid white; 60 border: 2px solid white;
@@ -80,7 +63,28 @@ QProgressBar {
80} 63}
81QProgressBar::chunk { 64QProgressBar::chunk {
82 background-color: #ff3c28; 65 background-color: #ff3c28;
83})"}, 66})";
67
68LoadingScreen::LoadingScreen(QWidget* parent)
69 : QWidget(parent), ui(std::make_unique<Ui::LoadingScreen>()),
70 previous_stage(VideoCore::LoadCallbackStage::Complete) {
71 ui->setupUi(this);
72
73 connect(this, &LoadingScreen::LoadProgress, this, &LoadingScreen::OnLoadProgress,
74 Qt::QueuedConnection);
75 qRegisterMetaType<VideoCore::LoadCallbackStage>();
76
77 stage_translations = {
78 {VideoCore::LoadCallbackStage::Prepare, tr("Loading...")},
79 {VideoCore::LoadCallbackStage::Raw, tr("Preparing Shaders %1 / %2")},
80 {VideoCore::LoadCallbackStage::Binary, tr("Loading Shaders %1 / %2")},
81 {VideoCore::LoadCallbackStage::Complete, tr("Launching...")},
82 };
83 progressbar_style = {
84 {VideoCore::LoadCallbackStage::Prepare, PROGRESSBAR_STYLE_PREPARE},
85 {VideoCore::LoadCallbackStage::Raw, PROGRESSBAR_STYLE_RAW},
86 {VideoCore::LoadCallbackStage::Binary, PROGRESSBAR_STYLE_BINARY},
87 {VideoCore::LoadCallbackStage::Complete, PROGRESSBAR_STYLE_COMPLETE},
84 }; 88 };
85} 89}
86 90