2022-10-29 18:27:20 +01:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
/*
|
2022-11-03 03:54:57 +00:00
|
|
|
* Prism Launcher - Minecraft Launcher
|
2022-10-29 18:27:20 +01:00
|
|
|
* Copyright (C) 2022 Tayou <tayou@gmx.net>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, version 3.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2022-11-01 14:41:08 +00:00
|
|
|
#pragma once
|
2022-10-29 18:27:20 +01:00
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
#include "ui/MainWindow.h"
|
2022-11-03 04:05:07 +00:00
|
|
|
#include "ui/themes/ITheme.h"
|
2022-10-29 18:27:20 +01:00
|
|
|
|
2022-11-03 04:05:07 +00:00
|
|
|
inline auto themeDebugLog()
|
|
|
|
{
|
|
|
|
return qDebug() << "[Theme]";
|
2022-11-01 14:41:08 +00:00
|
|
|
}
|
2022-11-03 04:05:07 +00:00
|
|
|
inline auto themeWarningLog()
|
|
|
|
{
|
|
|
|
return qWarning() << "[Theme]";
|
2022-11-01 14:41:08 +00:00
|
|
|
}
|
2022-10-29 18:27:20 +01:00
|
|
|
|
|
|
|
class ThemeManager {
|
2022-11-03 04:05:07 +00:00
|
|
|
public:
|
2022-10-29 18:27:20 +01:00
|
|
|
ThemeManager(MainWindow* mainWindow);
|
2022-11-01 14:41:08 +00:00
|
|
|
|
|
|
|
QList<ITheme*> getValidApplicationThemes();
|
2022-10-29 18:27:20 +01:00
|
|
|
void setIconTheme(const QString& name);
|
|
|
|
void applyCurrentlySelectedTheme();
|
2022-10-22 18:43:04 +01:00
|
|
|
void setApplicationTheme(const QString& name);
|
2022-10-29 18:27:20 +01:00
|
|
|
|
2023-01-04 13:30:25 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Returns the cat based on selected cat and with events (Birthday, XMas, etc.)
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="catName">Optional, if you need a specific cat.</param>
|
|
|
|
/// <returns></returns>
|
2023-01-09 15:58:27 +00:00
|
|
|
static QString getCatImage(QString catName = "");
|
|
|
|
|
2022-11-03 04:05:07 +00:00
|
|
|
private:
|
2022-10-29 18:27:20 +01:00
|
|
|
std::map<QString, std::unique_ptr<ITheme>> m_themes;
|
|
|
|
MainWindow* m_mainWindow;
|
|
|
|
|
2023-01-09 15:58:27 +00:00
|
|
|
void initializeThemes();
|
|
|
|
QString addTheme(std::unique_ptr<ITheme> theme);
|
|
|
|
ITheme* getTheme(QString themeId);
|
2022-10-29 18:27:20 +01:00
|
|
|
};
|