mirror of
https://github.com/YACReader/yacreader
synced 2026-03-01 10:22:58 -05:00
Add an abstract class to be implemented by any class that needs theming
This commit is contained in:
24
common/themes/themable.h
Normal file
24
common/themes/themable.h
Normal file
@ -0,0 +1,24 @@
|
||||
#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();
|
||||
});
|
||||
|
||||
applyTheme();
|
||||
}
|
||||
|
||||
virtual void applyTheme() = 0;
|
||||
};
|
||||
|
||||
#endif // THEMABLE_H
|
||||
Reference in New Issue
Block a user