mirror-chatterino2/src/widgets/helper/RippleEffectLabel.cpp

48 lines
1.1 KiB
C++
Raw Normal View History

2017-11-12 17:21:50 +01:00
#include "widgets/helper/rippleeffectlabel.hpp"
2017-12-31 00:50:07 +01:00
#include "singletons/thememanager.hpp"
2017-11-12 17:21:50 +01:00
#include "widgets/helper/splitheader.hpp"
2017-01-15 16:38:30 +01:00
#include <QBrush>
#include <QPainter>
2017-04-14 17:52:22 +02:00
namespace chatterino {
namespace widgets {
2017-01-18 21:30:23 +01:00
RippleEffectLabel::RippleEffectLabel(BaseWidget *parent, int spacing)
: RippleEffectButton(parent)
2017-09-22 00:50:43 +02:00
, label(this)
2017-01-15 16:38:30 +01:00
{
2017-09-22 00:50:43 +02:00
setLayout(&this->hbox);
2017-01-15 16:38:30 +01:00
2017-09-22 00:50:43 +02:00
this->label.setAlignment(Qt::AlignCenter);
2017-01-20 06:10:28 +01:00
2017-09-22 00:50:43 +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-06-19 18:55:45 +02:00
RippleEffectLabel2::RippleEffectLabel2(BaseWidget *parent, int padding)
: RippleEffectButton(parent)
, 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);
}
Label &RippleEffectLabel2::getLabel()
{
return this->label_;
}
} // namespace widgets
} // namespace chatterino