reworked splitheader a bit

This commit is contained in:
fourtf
2018-07-04 13:05:54 +02:00
parent 4ea613503e
commit 19fdfaef42
8 changed files with 154 additions and 122 deletions
+18
View File
@@ -34,6 +34,18 @@ const QPixmap &RippleEffectButton::getPixmap() const
return this->pixmap_;
}
void RippleEffectButton::setDimPixmap(bool value)
{
this->dimPixmap_ = value;
this->update();
}
bool RippleEffectButton::getDimPixmap() const
{
return this->dimPixmap_;
}
void RippleEffectButton::setBorderColor(const QColor &color)
{
this->borderColor_ = color;
@@ -51,6 +63,10 @@ void RippleEffectButton::paintEvent(QPaintEvent *)
painter.setRenderHint(QPainter::SmoothPixmapTransform);
if (!this->pixmap_.isNull()) {
if (!this->mouseOver_ && this->dimPixmap_) {
painter.setOpacity(0.7);
}
QRect rect = this->rect();
int s = int(6 * this->getScale());
@@ -60,6 +76,8 @@ void RippleEffectButton::paintEvent(QPaintEvent *)
rect.setBottom(rect.bottom() - s - s);
painter.drawPixmap(rect, this->pixmap_);
painter.setOpacity(1);
}
this->fancyPaint(painter);