summaryrefslogtreecommitdiffstats
path: root/application/handlers/IconResourceHandler.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-09-27 22:31:52 +0200
committerPetr Mrázek <peterix@gmail.com>2015-09-27 22:31:52 +0200
commit33c3850b40aba095b056738448c235190aeb1aab (patch)
tree7f38782803ffeb20b10f6394840302fc35460cc9 /application/handlers/IconResourceHandler.h
parent271ad9e4fdb4f003abd33b59ca9cadfb5bab9823 (diff)
downloadMultiMC-33c3850b40aba095b056738448c235190aeb1aab.tar
MultiMC-33c3850b40aba095b056738448c235190aeb1aab.tar.gz
MultiMC-33c3850b40aba095b056738448c235190aeb1aab.tar.lz
MultiMC-33c3850b40aba095b056738448c235190aeb1aab.tar.xz
MultiMC-33c3850b40aba095b056738448c235190aeb1aab.zip
NOISSUE add missing files
Diffstat (limited to 'application/handlers/IconResourceHandler.h')
-rw-r--r--application/handlers/IconResourceHandler.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/application/handlers/IconResourceHandler.h b/application/handlers/IconResourceHandler.h
new file mode 100644
index 00000000..6219f856
--- /dev/null
+++ b/application/handlers/IconResourceHandler.h
@@ -0,0 +1,25 @@
+#pragma once
+
+#include <memory>
+#include <resources/ResourceHandler.h>
+
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT IconResourceHandler : public ResourceHandler
+{
+public:
+ explicit IconResourceHandler(const QString &key);
+
+ /// Sets the current theme and notifies all IconResourceHandlers of the change
+ static void setTheme(const QString &theme);
+
+private:
+ // we need to keep track of all IconResourceHandlers so that we can update them if the theme changes
+ void init(std::shared_ptr<ResourceHandler> &ptr) override;
+ static QList<std::weak_ptr<IconResourceHandler>> m_iconHandlers;
+
+ QString m_key;
+
+ // the workhorse, returns QVariantMap (filename => size) for m_key/m_theme
+ QVariant get() const;
+};