2019-07-23 22:18:36 +02:00
|
|
|
#include "widgets/helper/EffectLabel.hpp"
|
|
|
|
|
|
|
|
#include <QBrush>
|
|
|
|
#include <QPainter>
|
|
|
|
|
2019-10-07 15:46:08 +02:00
|
|
|
namespace chatterino {
|
2019-07-23 22:18:36 +02:00
|
|
|
|
|
|
|
EffectLabel::EffectLabel(BaseWidget *parent, int spacing)
|
|
|
|
: Button(parent)
|
|
|
|
, label_(this)
|
|
|
|
{
|
|
|
|
setLayout(&this->hbox_);
|
|
|
|
|
|
|
|
this->label_.setAlignment(Qt::AlignCenter);
|
|
|
|
|
2022-11-10 20:11:40 +01:00
|
|
|
this->hbox_.setContentsMargins(0, 0, 0, 0);
|
2019-07-23 22:18:36 +02:00
|
|
|
this->hbox_.addSpacing(spacing);
|
|
|
|
this->hbox_.addWidget(&this->label_);
|
|
|
|
this->hbox_.addSpacing(spacing);
|
|
|
|
}
|
|
|
|
|
|
|
|
EffectLabel2::EffectLabel2(BaseWidget *parent, int padding)
|
|
|
|
: Button(parent)
|
|
|
|
, label_(this)
|
|
|
|
{
|
|
|
|
auto *hbox = new QHBoxLayout(this);
|
|
|
|
this->setLayout(hbox);
|
|
|
|
|
|
|
|
// this->label_.setAlignment(Qt::AlignCenter);
|
|
|
|
this->label_.setCentered(true);
|
|
|
|
|
2022-11-10 20:11:40 +01:00
|
|
|
hbox->setContentsMargins(0, 0, 0, 0);
|
2019-07-23 22:18:36 +02:00
|
|
|
// hbox.addSpacing(spacing);
|
|
|
|
hbox->addWidget(&this->label_);
|
|
|
|
// hbox.addSpacing(spacing);
|
|
|
|
}
|
|
|
|
|
|
|
|
Label &EffectLabel2::getLabel()
|
|
|
|
{
|
|
|
|
return this->label_;
|
|
|
|
}
|
|
|
|
|
2019-10-07 15:46:08 +02:00
|
|
|
} // namespace chatterino
|