2018-08-08 15:35:54 +02:00
|
|
|
#include "widgets/helper/EffectLabel.hpp"
|
2018-06-28 20:03:04 +02:00
|
|
|
#include "singletons/Theme.hpp"
|
2018-06-26 14:39:22 +02:00
|
|
|
#include "widgets/splits/SplitHeader.hpp"
|
2017-01-15 16:38:30 +01:00
|
|
|
|
|
|
|
#include <QBrush>
|
|
|
|
#include <QPainter>
|
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace chatterino {
|
2017-01-18 21:30:23 +01:00
|
|
|
|
2018-08-08 15:35:54 +02:00
|
|
|
EffectLabel::EffectLabel(BaseWidget *parent, int spacing)
|
|
|
|
: Button(parent)
|
2018-07-06 19:23:47 +02:00
|
|
|
, label_(this)
|
2017-01-15 16:38:30 +01:00
|
|
|
{
|
2018-07-06 19:23:47 +02:00
|
|
|
setLayout(&this->hbox_);
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2018-07-06 19:23:47 +02:00
|
|
|
this->label_.setAlignment(Qt::AlignCenter);
|
2017-01-20 06:10:28 +01:00
|
|
|
|
2018-07-06 19:23:47 +02:00
|
|
|
this->hbox_.setMargin(0);
|
|
|
|
this->hbox_.addSpacing(spacing);
|
|
|
|
this->hbox_.addWidget(&this->label_);
|
|
|
|
this->hbox_.addSpacing(spacing);
|
2017-01-15 16:38:30 +01:00
|
|
|
}
|
|
|
|
|
2018-08-08 15:35:54 +02:00
|
|
|
EffectLabel2::EffectLabel2(BaseWidget *parent, int padding)
|
|
|
|
: Button(parent)
|
2018-06-19 18:55:45 +02:00
|
|
|
, label_(this)
|
|
|
|
{
|
|
|
|
auto *hbox = new QHBoxLayout(this);
|
|
|
|
this->setLayout(hbox);
|
|
|
|
|
|
|
|
// this->label_.setAlignment(Qt::AlignCenter);
|
|
|
|
this->label_.setCentered(true);
|
|
|
|
|
|
|
|
hbox->setMargin(0);
|
|
|
|
// hbox.addSpacing(spacing);
|
|
|
|
hbox->addWidget(&this->label_);
|
|
|
|
// hbox.addSpacing(spacing);
|
|
|
|
}
|
|
|
|
|
2018-08-08 15:35:54 +02:00
|
|
|
Label &EffectLabel2::getLabel()
|
2018-06-19 18:55:45 +02:00
|
|
|
{
|
|
|
|
return this->label_;
|
|
|
|
}
|
|
|
|
|
2017-06-07 10:09:24 +02:00
|
|
|
} // namespace chatterino
|