Add basic color scheme handling

Fix #59
This commit is contained in:
Rasmus Karlsson
2017-07-02 14:28:37 +02:00
parent c5c2718dc0
commit ddf886eaf1
13 changed files with 83 additions and 39 deletions
+39
View File
@@ -0,0 +1,39 @@
#include "widgets/basewidget.hpp"
#include "colorscheme.hpp"
#include <QDebug>
#include <boost/signals2.hpp>
namespace chatterino {
namespace widgets {
BaseWidget::BaseWidget(ColorScheme &_colorScheme, QWidget *parent)
: QWidget(parent)
, colorScheme(_colorScheme)
{
this->init();
}
BaseWidget::BaseWidget(BaseWidget *parent)
: QWidget(parent)
, colorScheme(parent->colorScheme)
{
this->init();
}
void BaseWidget::init()
{
this->colorScheme.updated.connect([this]() {
this->refreshTheme();
this->update();
});
}
void BaseWidget::refreshTheme()
{
// Do any color scheme updates here
}
} // namespace widgets
} // namespace chatterino