matrixion/src/ui/ThemeManager.cpp

24 lines
438 B
C++
Raw Normal View History

2021-03-05 02:35:15 +03:00
// SPDX-FileCopyrightText: 2021 Nheko Contributors
//
// SPDX-License-Identifier: GPL-3.0-or-later
2017-04-06 02:06:42 +03:00
#include <QFontDatabase>
#include "ThemeManager.h"
2017-10-23 00:19:35 +03:00
ThemeManager::ThemeManager() { setTheme(new Theme); }
2017-04-06 02:06:42 +03:00
2017-08-20 13:47:22 +03:00
void
ThemeManager::setTheme(Theme *theme)
2017-04-06 02:06:42 +03:00
{
2017-09-10 12:59:21 +03:00
theme_ = theme;
theme_->setParent(this);
2017-04-06 02:06:42 +03:00
}
2017-08-20 13:47:22 +03:00
QColor
ThemeManager::themeColor(const QString &key) const
2017-04-06 02:06:42 +03:00
{
2017-09-10 12:59:21 +03:00
Q_ASSERT(theme_);
return theme_->getColor(key);
2017-04-06 02:06:42 +03:00
}