UX tweak + formatting + added cat to wizard
Signed-off-by: Tayou <tayou@gmx.net>
This commit is contained in:
@ -1652,16 +1652,6 @@ void MainWindow::onCatToggled(bool state)
|
||||
APPLICATION->settings()->set("TheCat", state);
|
||||
}
|
||||
|
||||
namespace {
|
||||
template <typename T>
|
||||
T non_stupid_abs(T in)
|
||||
{
|
||||
if (in < 0)
|
||||
return -in;
|
||||
return in;
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::setCatBackground(bool enabled)
|
||||
{
|
||||
if (enabled)
|
||||
@ -1671,11 +1661,11 @@ void MainWindow::setCatBackground(bool enabled)
|
||||
QDateTime xmas(QDate(now.date().year(), 12, 25), QTime(0, 0));
|
||||
QDateTime halloween(QDate(now.date().year(), 10, 31), QTime(0, 0));
|
||||
QString cat = APPLICATION->settings()->get("BackgroundCat").toString();
|
||||
if (non_stupid_abs(now.daysTo(xmas)) <= 4) {
|
||||
if (std::abs(now.daysTo(xmas)) <= 4) {
|
||||
cat += "-xmas";
|
||||
} else if (non_stupid_abs(now.daysTo(halloween)) <= 4) {
|
||||
} else if (std::abs(now.daysTo(halloween)) <= 4) {
|
||||
cat += "-spooky";
|
||||
} else if (non_stupid_abs(now.daysTo(birthday)) <= 12) {
|
||||
} else if (std::abs(now.daysTo(birthday)) <= 12) {
|
||||
cat += "-bday";
|
||||
}
|
||||
view->setStyleSheet(QString(R"(
|
||||
|
Reference in New Issue
Block a user