Files
yacreader/common/themes/themable.h
luisangelsm edd5bbc69c Make Themable pass the current Theme through applyTheme
This reduces boilerplate code and remove the ThemeManager dependency at Thamable subclasses level.
2026-02-19 18:06:31 +01:00

25 lines
574 B
C++

#ifndef THEMABLE_H
#define THEMABLE_H
#include "theme_manager.h"
class Themable
{
protected:
void initTheme(QObject *owner)
{
QObject::connect(&ThemeManager::instance(),
&ThemeManager::themeChanged,
owner,
[this]() {
applyTheme(ThemeManager::instance().getCurrentTheme());
});
applyTheme(ThemeManager::instance().getCurrentTheme());
}
virtual void applyTheme(const Theme &theme) = 0;
};
#endif // THEMABLE_H