diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp
index 00bb296fe..e4a699da6 100644
--- a/launcher/ui/MainWindow.cpp
+++ b/launcher/ui/MainWindow.cpp
@@ -1160,6 +1160,11 @@ void MainWindow::on_actionViewWidgetThemeFolder_triggered()
DesktopServices::openDirectory(APPLICATION->themeManager()->getApplicationThemesFolder().path());
}
+void MainWindow::on_actionViewCatPackFolder_triggered()
+{
+ DesktopServices::openDirectory(APPLICATION->themeManager()->getCatPacksFolder().path());
+}
+
void MainWindow::refreshInstances()
{
APPLICATION->instances()->loadList();
diff --git a/launcher/ui/MainWindow.h b/launcher/ui/MainWindow.h
index 8756c0784..ffc7154a3 100644
--- a/launcher/ui/MainWindow.h
+++ b/launcher/ui/MainWindow.h
@@ -118,6 +118,7 @@ private slots:
void on_actionViewIconThemeFolder_triggered();
void on_actionViewWidgetThemeFolder_triggered();
+ void on_actionViewCatPackFolder_triggered();
void on_actionViewSelectedInstFolder_triggered();
diff --git a/launcher/ui/MainWindow.ui b/launcher/ui/MainWindow.ui
index a3f6dff7c..ad0a0808a 100644
--- a/launcher/ui/MainWindow.ui
+++ b/launcher/ui/MainWindow.ui
@@ -131,7 +131,7 @@
0
0
800
- 20
+ 30
diff --git a/launcher/ui/themes/ThemeManager.cpp b/launcher/ui/themes/ThemeManager.cpp
index 46fe0b25d..bce13b459 100644
--- a/launcher/ui/themes/ThemeManager.cpp
+++ b/launcher/ui/themes/ThemeManager.cpp
@@ -205,6 +205,11 @@ QDir ThemeManager::getApplicationThemesFolder()
return m_applicationThemeFolder;
}
+QDir ThemeManager::getCatPacksFolder()
+{
+ return m_catPacksFolder;
+}
+
void ThemeManager::setIconTheme(const QString& name)
{
if (m_icons.find(name) == m_icons.end()) {
@@ -270,9 +275,9 @@ void ThemeManager::initializeCatPacks()
for (auto [id, name] : defaultCats) {
addCatPack(std::unique_ptr(new BasicCatPack(id, name)));
}
- QDir catpacksDir("catpacks");
- QString catpacksFolder = catpacksDir.absoluteFilePath("");
- themeDebugLog() << "CatPacks Folder Path:" << catpacksFolder;
+ if (!m_catPacksFolder.mkpath("."))
+ themeWarningLog() << "Couldn't create theme folder";
+ themeDebugLog() << "CatPacks Folder Path:" << m_catPacksFolder.absolutePath();
QStringList supportedImageFormats;
for (auto format : QImageReader::supportedImageFormats()) {
@@ -289,9 +294,9 @@ void ThemeManager::initializeCatPacks()
}
};
- loadFiles(catpacksDir);
+ loadFiles(m_catPacksFolder);
- QDirIterator directoryIterator(catpacksFolder, QDir::Dirs | QDir::NoDotAndDotDot);
+ QDirIterator directoryIterator(m_catPacksFolder.path(), QDir::Dirs | QDir::NoDotAndDotDot);
while (directoryIterator.hasNext()) {
QDir dir(directoryIterator.next());
QFileInfo manifest(dir.absoluteFilePath("catpack.json"));
diff --git a/launcher/ui/themes/ThemeManager.h b/launcher/ui/themes/ThemeManager.h
index 1eb83ce1e..b5c66677b 100644
--- a/launcher/ui/themes/ThemeManager.h
+++ b/launcher/ui/themes/ThemeManager.h
@@ -44,6 +44,7 @@ class ThemeManager {
bool isValidApplicationTheme(const QString& id);
QDir getIconThemesFolder();
QDir getApplicationThemesFolder();
+ QDir getCatPacksFolder();
void applyCurrentlySelectedTheme(bool initial = false);
void setIconTheme(const QString& name);
void setApplicationTheme(const QString& name, bool initial = false);
@@ -59,6 +60,7 @@ class ThemeManager {
std::map m_icons;
QDir m_iconThemeFolder{ "iconthemes" };
QDir m_applicationThemeFolder{ "themes" };
+ QDir m_catPacksFolder{ "catpacks" };
std::map> m_catPacks;
void initializeThemes();
diff --git a/launcher/ui/widgets/ThemeCustomizationWidget.cpp b/launcher/ui/widgets/ThemeCustomizationWidget.cpp
index b9294908d..c999ac92c 100644
--- a/launcher/ui/widgets/ThemeCustomizationWidget.cpp
+++ b/launcher/ui/widgets/ThemeCustomizationWidget.cpp
@@ -35,6 +35,7 @@ ThemeCustomizationWidget::ThemeCustomizationWidget(QWidget* parent) : QWidget(pa
connect(ui->iconsFolder, &QPushButton::clicked, this, [] { DesktopServices::openDirectory(APPLICATION->themeManager()->getIconThemesFolder().path()); });
connect(ui->widgetStyleFolder, &QPushButton::clicked, this, [] { DesktopServices::openDirectory(APPLICATION->themeManager()->getApplicationThemesFolder().path()); });
+ connect(ui->catPackFolder, &QPushButton::clicked, this, [] { DesktopServices::openDirectory(APPLICATION->themeManager()->getCatPacksFolder().path()); });
}
ThemeCustomizationWidget::~ThemeCustomizationWidget()
diff --git a/launcher/ui/widgets/ThemeCustomizationWidget.ui b/launcher/ui/widgets/ThemeCustomizationWidget.ui
index 266b1dd62..4503181c2 100644
--- a/launcher/ui/widgets/ThemeCustomizationWidget.ui
+++ b/launcher/ui/widgets/ThemeCustomizationWidget.ui
@@ -63,7 +63,8 @@
-
+
+ ..
true
@@ -106,7 +107,8 @@
-
+
+ ..
true
@@ -147,15 +149,15 @@
-
-
+
- The cat appears in the background and is not shown by default. It is only made visible when pressing the Cat button in the Toolbar.
+ View cat packs folder.
-
+
..