added toggle for moderation mode

This commit is contained in:
fourtf
2018-01-17 16:52:51 +01:00
parent 01efa1f447
commit e694214243
17 changed files with 136 additions and 83 deletions
+26 -1
View File
@@ -10,7 +10,7 @@ namespace widgets {
RippleEffectButton::RippleEffectButton(BaseWidget *parent)
: BaseWidget(parent)
, pixmap(nullptr)
{
connect(&effectTimer, &QTimer::timeout, this, &RippleEffectButton::onMouseEffectTimeout);
@@ -23,11 +23,36 @@ void RippleEffectButton::setMouseEffectColor(boost::optional<QColor> color)
this->mouseEffectColor = color;
}
void RippleEffectButton::setPixmap(const QPixmap *_pixmap)
{
this->pixmap = const_cast<QPixmap *>(_pixmap);
this->update();
}
const QPixmap *RippleEffectButton::getPixmap() const
{
return this->pixmap;
}
void RippleEffectButton::paintEvent(QPaintEvent *)
{
QPainter painter(this);
painter.setRenderHint(QPainter::SmoothPixmapTransform);
this->fancyPaint(painter);
if (this->pixmap != nullptr) {
QRect rect = this->rect();
int xD = 6 * this->getDpiMultiplier();
rect.moveLeft(xD);
rect.setRight(rect.right() - xD - xD);
rect.moveTop(xD);
rect.setBottom(rect.bottom() - xD - xD);
painter.drawPixmap(rect, *this->pixmap);
}
}
void RippleEffectButton::fancyPaint(QPainter &painter)