mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
24 lines
473 B
C++
24 lines
473 B
C++
#include "hoverhighlighteffect.h"
|
|
#include "util/imagefactory.h"
|
|
|
|
#include <QPainter>
|
|
#include <QDebug>
|
|
|
|
HoverHighlightEffect::HoverHighlightEffect(QObject *parent)
|
|
: QGraphicsEffect(parent)
|
|
{
|
|
|
|
}
|
|
|
|
void HoverHighlightEffect::draw(QPainter *painter)
|
|
{
|
|
const QPixmap pix = sourcePixmap(Qt::DeviceCoordinates);
|
|
|
|
if (isEnabled())
|
|
{
|
|
painter->drawPixmap(0, 0, ImageFactory::lighterEffect(pix));
|
|
} else {
|
|
painter->drawPixmap(0, 0, pix);
|
|
}
|
|
}
|