diff options
Diffstat (limited to 'src')
| -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 @@ | |||
| 28 | #include <QMovie> | 28 | #include <QMovie> |
| 29 | #endif | 29 | #endif |
| 30 | 30 | ||
| 31 | LoadingScreen::LoadingScreen(QWidget* parent) | 31 | constexpr 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"( | ||
| 49 | QProgressBar {} | 32 | QProgressBar {} |
| 50 | QProgressBar::chunk {})"}, | 33 | QProgressBar::chunk {})"; |
| 51 | {VideoCore::LoadCallbackStage::Raw, | 34 | |
| 52 | R"( | 35 | constexpr const char* PROGRESSBAR_STYLE_RAW = R"( |
| 53 | QProgressBar { | 36 | QProgressBar { |
| 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 | } |
| 59 | QProgressBar::chunk { | 42 | QProgressBar::chunk { |
| 60 | background-color: #0ab9e6; | 43 | background-color: #0ab9e6; |
| 61 | })"}, | 44 | })"; |
| 62 | {VideoCore::LoadCallbackStage::Binary, | 45 | |
| 63 | R"( | 46 | constexpr const char* PROGRESSBAR_STYLE_BINARY = R"( |
| 64 | QProgressBar { | 47 | QProgressBar { |
| 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 | } |
| 70 | QProgressBar::chunk { | 53 | QProgressBar::chunk { |
| 71 | background-color: #ff3c28; | 54 | background-color: #ff3c28; |
| 72 | })"}, | 55 | })"; |
| 73 | {VideoCore::LoadCallbackStage::Complete, | 56 | |
| 74 | R"( | 57 | constexpr const char* PROGRESSBAR_STYLE_COMPLETE = R"( |
| 75 | QProgressBar { | 58 | QProgressBar { |
| 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 | } |
| 81 | QProgressBar::chunk { | 64 | QProgressBar::chunk { |
| 82 | background-color: #ff3c28; | 65 | background-color: #ff3c28; |
| 83 | })"}, | 66 | })"; |
| 67 | |||
| 68 | LoadingScreen::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 | ||