diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2022-11-02 12:06:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-02 12:06:08 +0100 |
commit | 094b57bb2303af12a50f9c269d2d9de26798c1b7 (patch) | |
tree | 17f9d1b159b7380a19cb202e0b0c3c5681808a6f /launcher/ui | |
parent | d12323396f50899d93fc05f3857823d372b99e97 (diff) | |
parent | 9ca4f19aeabf3cc4a105159c4b4796101a401126 (diff) | |
download | PrismLauncher-094b57bb2303af12a50f9c269d2d9de26798c1b7.tar.gz PrismLauncher-094b57bb2303af12a50f9c269d2d9de26798c1b7.tar.bz2 PrismLauncher-094b57bb2303af12a50f9c269d2d9de26798c1b7.zip |
Merge pull request #372 from santiagocezar/rory
Diffstat (limited to 'launcher/ui')
-rw-r--r-- | launcher/ui/MainWindow.cpp | 15 | ||||
-rw-r--r-- | launcher/ui/pages/global/LauncherPage.cpp | 21 | ||||
-rw-r--r-- | launcher/ui/pages/global/LauncherPage.ui | 38 |
3 files changed, 66 insertions, 8 deletions
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index eda234df..28eaa741 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -1560,15 +1560,13 @@ void MainWindow::setCatBackground(bool enabled) QDateTime now = QDateTime::currentDateTime(); QDateTime birthday(QDate(now.date().year(), 11, 30), QTime(0, 0)); QDateTime xmas(QDate(now.date().year(), 12, 25), QTime(0, 0)); - QString cat; + QString cat = APPLICATION->settings()->get("BackgroundCat").toString(); + if(non_stupid_abs(now.daysTo(xmas)) <= 4) { - cat = "catmas"; + cat += "-xmas"; } else if (non_stupid_abs(now.daysTo(birthday)) <= 12) { - cat = "cattiversary"; - } - else { - cat = "kitteh"; + cat += "-bday"; } view->setStyleSheet(QString(R"( InstanceView @@ -1576,10 +1574,11 @@ InstanceView background-image: url(:/backgrounds/%1); background-attachment: fixed; background-clip: padding; - background-position: top right; + background-position: bottom left; background-repeat: none; background-color:palette(base); -})").arg(cat)); +})") + .arg(cat)); } else { diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp index 4ae7509c..822c69b0 100644 --- a/launcher/ui/pages/global/LauncherPage.cpp +++ b/launcher/ui/pages/global/LauncherPage.cpp @@ -334,6 +334,18 @@ void LauncherPage::applySettings() APPLICATION->setApplicationTheme(newAppTheme, false); } + switch (ui->themeBackgroundCat->currentIndex()) { + case 0: // original cat + s->set("BackgroundCat", "kitteh"); + break; + case 1: // rory the cat + s->set("BackgroundCat", "rory"); + break; + case 2: // rory the cat flat edition + s->set("BackgroundCat", "rory-flat"); + break; + } + s->set("MenuBarInsteadOfToolBar", ui->preferMenuBarCheckBox->isChecked()); // Console settings @@ -425,6 +437,15 @@ void LauncherPage::loadSettings() ui->themeComboBox->setCurrentIndex(9); } + auto cat = s->get("BackgroundCat").toString(); + if (cat == "kitteh") { + ui->themeBackgroundCat->setCurrentIndex(0); + } else if (cat == "rory") { + ui->themeBackgroundCat->setCurrentIndex(1); + } else if (cat == "rory-flat") { + ui->themeBackgroundCat->setCurrentIndex(2); + } + { auto currentTheme = s->get("ApplicationTheme").toString(); auto themes = APPLICATION->getValidApplicationThemes(); diff --git a/launcher/ui/pages/global/LauncherPage.ui b/launcher/ui/pages/global/LauncherPage.ui index 76a25f2e..6de644ee 100644 --- a/launcher/ui/pages/global/LauncherPage.ui +++ b/launcher/ui/pages/global/LauncherPage.ui @@ -340,6 +340,44 @@ </property> </widget> </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_5"> + <property name="text"> + <string>C&at</string> + </property> + <property name="buddy"> + <cstring>themeBackgroundCat</cstring> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QComboBox" name="themeBackgroundCat"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="focusPolicy"> + <enum>Qt::StrongFocus</enum> + </property> + <item> + <property name="text"> + <string>Background Cat (from MultiMC)</string> + </property> + </item> + <item> + <property name="text"> + <string>Rory ID 11 (drawn by Ashtaka)</string> + </property> + </item> + <item> + <property name="text"> + <string>Rory ID 11 (flat edition, drawn by Ashtaka)</string> + </property> + </item> + </widget> + </item> </layout> </widget> </item> |