summaryrefslogtreecommitdiffstats
path: root/application/themes/CustomTheme.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-11-06 05:48:52 +0100
committerPetr Mrázek <peterix@gmail.com>2016-11-06 05:48:52 +0100
commit37cc59c04d0573a42d67242135495c0a0729f965 (patch)
tree35cd453c9d35022dd31f5c2769740b5b80d4ba9c /application/themes/CustomTheme.cpp
parentbc753859b5ab5d1402940024c0478548165b57f8 (diff)
downloadMultiMC-37cc59c04d0573a42d67242135495c0a0729f965.tar
MultiMC-37cc59c04d0573a42d67242135495c0a0729f965.tar.gz
MultiMC-37cc59c04d0573a42d67242135495c0a0729f965.tar.lz
MultiMC-37cc59c04d0573a42d67242135495c0a0729f965.tar.xz
MultiMC-37cc59c04d0573a42d67242135495c0a0729f965.zip
GH-378 add a resource search path to custom themes
This allows adding images and other bits and pieces to themes.
Diffstat (limited to 'application/themes/CustomTheme.cpp')
-rw-r--r--application/themes/CustomTheme.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/application/themes/CustomTheme.cpp b/application/themes/CustomTheme.cpp
index a3141573..70d55211 100644
--- a/application/themes/CustomTheme.cpp
+++ b/application/themes/CustomTheme.cpp
@@ -128,10 +128,11 @@ CustomTheme::CustomTheme(ITheme* baseTheme, QString folder)
{
m_id = folder;
QString path = FS::PathCombine("themes", m_id);
+ QString pathResources = FS::PathCombine("themes", m_id, "resources");
qDebug() << "Loading theme" << m_id;
- if(!FS::ensureFolderPathExists(path))
+ if(!FS::ensureFolderPathExists(path) || !FS::ensureFolderPathExists(pathResources))
{
qWarning() << "couldn't create folder for theme!";
m_palette = baseTheme->colorScheme();
@@ -191,6 +192,12 @@ CustomTheme::CustomTheme(ITheme* baseTheme, QString folder)
}
}
+QStringList CustomTheme::searchPaths()
+{
+ return { FS::PathCombine("themes", m_id, "resources") };
+}
+
+
QString CustomTheme::id()
{
return m_id;