Skip to content

Commit

Permalink
sync: from linuxdeepin/dtkwidget
Browse files Browse the repository at this point in the history
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#608
  • Loading branch information
deepin-ci-robot committed Oct 8, 2024
1 parent d88429a commit bfaf86a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/widgets/dbounceanimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ bool DBounceAnimation::eventFilter(QObject *o, QEvent *e)
if (auto absscroll = dynamic_cast<QAbstractScrollArea *>(o)) {
if (auto wheelEvent = dynamic_cast<QWheelEvent *>(e)) {
if (absscroll->verticalScrollBar()->value() <= 0 || absscroll->verticalScrollBar()->value() >= absscroll->verticalScrollBar()->maximum()) {
d->m_deltaSum += wheelEvent->delta();
d->m_deltaSum += wheelEvent->pixelDelta().x() != 0 ? wheelEvent->pixelDelta().x() : wheelEvent->pixelDelta().y();
bounceBack(wheelEvent->angleDelta().x() == 0 ? Qt::Vertical : Qt::Horizontal);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/dmessagemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ImageLabel : public QLabel {
QPainter p(this);
p.setRenderHint(QPainter::Antialiasing);
p.setOpacity(m_opacity);
p.drawPixmap(rect().marginsRemoved(contentsMargins()), *pixmap());
p.drawPixmap(rect().marginsRemoved(contentsMargins()), pixmap(Qt::ReturnByValue));
};
private:
qreal m_opacity;
Expand Down
6 changes: 6 additions & 0 deletions src/widgets/dswitchbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ void DSwitchButton::paintEvent(QPaintEvent *e)
DStylePainter painter(this);
DStyleOptionButton opt;
initStyleOption(&opt);
if (isChecked() != d->checked) {
d->checked = isChecked();
DDciIcon icon = !d->checked ? DDciIcon::fromTheme("switch_on") : DDciIcon::fromTheme("switch_off");
d->player.setIcon(icon);
Q_EMIT checkedChanged(d->checked);
}
painter.drawControl(DStyle::CE_SwitchButton, opt);

painter.setRenderHint(QPainter::SmoothPixmapTransform);
Expand Down

0 comments on commit bfaf86a

Please sign in to comment.