reworked splitheader a bit
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -33,6 +33,9 @@ public:
|
||||
void setPixmap(const QPixmap &pixmap_);
|
||||
const QPixmap &getPixmap() const;
|
||||
|
||||
void setDimPixmap(bool value);
|
||||
bool getDimPixmap() const;
|
||||
|
||||
void setBorderColor(const QColor &color);
|
||||
const QColor &getBorderColor() const;
|
||||
|
||||
@@ -56,6 +59,7 @@ protected:
|
||||
private:
|
||||
QColor borderColor_;
|
||||
QPixmap pixmap_;
|
||||
bool dimPixmap_ = true;
|
||||
QPoint mousePos_;
|
||||
double hoverMultiplier_ = 0.0;
|
||||
QTimer effectTimer_;
|
||||
|
||||
Reference in New Issue
Block a user