Hide progress bar on Prepare step
This commit is contained in:
parent
e8bd6b1fcc
commit
63783db1b3
|
@ -46,12 +46,8 @@ LoadingScreen::LoadingScreen(QWidget* parent)
|
||||||
progressbar_style = {
|
progressbar_style = {
|
||||||
{VideoCore::LoadCallbackStage::Prepare,
|
{VideoCore::LoadCallbackStage::Prepare,
|
||||||
R"(
|
R"(
|
||||||
QProgressBar {
|
QProgressBar {}
|
||||||
background-color: black;
|
QProgressBar::chunk {})"},
|
||||||
}
|
|
||||||
QProgressBar::chunk {
|
|
||||||
background-color: white;
|
|
||||||
})"},
|
|
||||||
{VideoCore::LoadCallbackStage::Raw,
|
{VideoCore::LoadCallbackStage::Raw,
|
||||||
R"(
|
R"(
|
||||||
QProgressBar {
|
QProgressBar {
|
||||||
|
@ -114,7 +110,7 @@ void LoadingScreen::Prepare(Loader::AppLoader& loader) {
|
||||||
ui->logo->setPixmap(map);
|
ui->logo->setPixmap(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
OnLoadProgress(VideoCore::LoadCallbackStage::Prepare, 0, 100);
|
OnLoadProgress(VideoCore::LoadCallbackStage::Prepare, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadingScreen::OnLoadProgress(VideoCore::LoadCallbackStage stage, std::size_t value,
|
void LoadingScreen::OnLoadProgress(VideoCore::LoadCallbackStage stage, std::size_t value,
|
||||||
|
@ -124,6 +120,11 @@ void LoadingScreen::OnLoadProgress(VideoCore::LoadCallbackStage stage, std::size
|
||||||
// reset the timer if the stage changes
|
// reset the timer if the stage changes
|
||||||
if (stage != previous_stage) {
|
if (stage != previous_stage) {
|
||||||
ui->progress_bar->setStyleSheet(progressbar_style[stage]);
|
ui->progress_bar->setStyleSheet(progressbar_style[stage]);
|
||||||
|
if (stage == VideoCore::LoadCallbackStage::Prepare) {
|
||||||
|
ui->progress_bar->hide();
|
||||||
|
} else {
|
||||||
|
ui->progress_bar->show();
|
||||||
|
}
|
||||||
previous_stage = stage;
|
previous_stage = stage;
|
||||||
// reset back to fast shader compiling since the stage changed
|
// reset back to fast shader compiling since the stage changed
|
||||||
slow_shader_compile_start = false;
|
slow_shader_compile_start = false;
|
||||||
|
|
Loading…
Reference in New Issue