mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-12-23 18:02:46 -06:00
Move progress bar style into constexpr strings
This commit is contained in:
parent
63783db1b3
commit
4bce57b149
1 changed files with 41 additions and 37 deletions
|
@ -28,6 +28,43 @@
|
|||
#include <QMovie>
|
||||
#endif
|
||||
|
||||
constexpr const char* PROGRESSBAR_STYLE_PREPARE = R"(
|
||||
QProgressBar {}
|
||||
QProgressBar::chunk {})";
|
||||
|
||||
constexpr const char* PROGRESSBAR_STYLE_RAW = R"(
|
||||
QProgressBar {
|
||||
background-color: black;
|
||||
border: 2px solid white;
|
||||
border-radius: 4px;
|
||||
padding: 2px;
|
||||
}
|
||||
QProgressBar::chunk {
|
||||
background-color: #0ab9e6;
|
||||
})";
|
||||
|
||||
constexpr const char* PROGRESSBAR_STYLE_BINARY = R"(
|
||||
QProgressBar {
|
||||
background-color: black;
|
||||
border: 2px solid white;
|
||||
border-radius: 4px;
|
||||
padding: 2px;
|
||||
}
|
||||
QProgressBar::chunk {
|
||||
background-color: #ff3c28;
|
||||
})";
|
||||
|
||||
constexpr const char* PROGRESSBAR_STYLE_COMPLETE = R"(
|
||||
QProgressBar {
|
||||
background-color: black;
|
||||
border: 2px solid white;
|
||||
border-radius: 4px;
|
||||
padding: 2px;
|
||||
}
|
||||
QProgressBar::chunk {
|
||||
background-color: #ff3c28;
|
||||
})";
|
||||
|
||||
LoadingScreen::LoadingScreen(QWidget* parent)
|
||||
: QWidget(parent), ui(std::make_unique<Ui::LoadingScreen>()),
|
||||
previous_stage(VideoCore::LoadCallbackStage::Complete) {
|
||||
|
@ -44,43 +81,10 @@ LoadingScreen::LoadingScreen(QWidget* parent)
|
|||
{VideoCore::LoadCallbackStage::Complete, tr("Launching...")},
|
||||
};
|
||||
progressbar_style = {
|
||||
{VideoCore::LoadCallbackStage::Prepare,
|
||||
R"(
|
||||
QProgressBar {}
|
||||
QProgressBar::chunk {})"},
|
||||
{VideoCore::LoadCallbackStage::Raw,
|
||||
R"(
|
||||
QProgressBar {
|
||||
background-color: black;
|
||||
border: 2px solid white;
|
||||
border-radius: 4px;
|
||||
padding: 2px;
|
||||
}
|
||||
QProgressBar::chunk {
|
||||
background-color: #0ab9e6;
|
||||
})"},
|
||||
{VideoCore::LoadCallbackStage::Binary,
|
||||
R"(
|
||||
QProgressBar {
|
||||
background-color: black;
|
||||
border: 2px solid white;
|
||||
border-radius: 4px;
|
||||
padding: 2px;
|
||||
}
|
||||
QProgressBar::chunk {
|
||||
background-color: #ff3c28;
|
||||
})"},
|
||||
{VideoCore::LoadCallbackStage::Complete,
|
||||
R"(
|
||||
QProgressBar {
|
||||
background-color: black;
|
||||
border: 2px solid white;
|
||||
border-radius: 4px;
|
||||
padding: 2px;
|
||||
}
|
||||
QProgressBar::chunk {
|
||||
background-color: #ff3c28;
|
||||
})"},
|
||||
{VideoCore::LoadCallbackStage::Prepare, PROGRESSBAR_STYLE_PREPARE},
|
||||
{VideoCore::LoadCallbackStage::Raw, PROGRESSBAR_STYLE_RAW},
|
||||
{VideoCore::LoadCallbackStage::Binary, PROGRESSBAR_STYLE_BINARY},
|
||||
{VideoCore::LoadCallbackStage::Complete, PROGRESSBAR_STYLE_COMPLETE},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue