Skip to content

Commit

Permalink
fix: unnecessary scaling adjustments
Browse files Browse the repository at this point in the history
remove unnecessary scaling adjustments.

Log: Fix icon error on High-DPI.
Bug: https://pms.uniontech.com/bug-view-298677.html
  • Loading branch information
rb-union authored and deepin-bot[bot] committed Jan 10, 2025
1 parent c320a78 commit 5b71e9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions src/dde-dock-plugins/shotstart/iconwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,8 @@ void IconWidget::leaveEvent(QEvent *event)

const QPixmap IconWidget::loadSvg(const QString &fileName, const QSize &size) const
{
const auto ratio = devicePixelRatioF();

auto pixmapSize = QCoreApplication::testAttribute(Qt::AA_UseHighDpiPixmaps) ? size : (size * ratio);
// 缩放模式 设置为非使能状态时,调整转出的位图风格模式
// pixmapSize = size* ratio;
QPixmap pixmap = QIcon::fromTheme(fileName, m_icon).pixmap(pixmapSize, isEnabled() ? QIcon::Normal : QIcon::Disabled);
// High-DPI pixmap always support on Qt6
QPixmap pixmap = QIcon::fromTheme(fileName, m_icon).pixmap(size, isEnabled() ? QIcon::Normal : QIcon::Disabled);
return pixmap;
}

Expand Down
8 changes: 2 additions & 6 deletions src/dde-dock-plugins/shotstartrecord/recordiconwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,8 @@ void RecordIconWidget::leaveEvent(QEvent *event)

const QPixmap RecordIconWidget::loadSvg(const QString &fileName, const QSize &size) const
{
const auto ratio = devicePixelRatioF();

auto pixmapSize = QCoreApplication::testAttribute(Qt::AA_UseHighDpiPixmaps) ? size : (size * ratio);
// 缩放模式 设置为非使能状态时,调整转出的位图风格模式
// pixmapSize = size* ratio;
QPixmap pixmap = QIcon::fromTheme(fileName, m_icon).pixmap(pixmapSize, isEnabled() ? QIcon::Normal : QIcon::Disabled);
// High-DPI pixmap always support on Qt6
QPixmap pixmap = QIcon::fromTheme(fileName, m_icon).pixmap(size, isEnabled() ? QIcon::Normal : QIcon::Disabled);

return pixmap;
}
Expand Down

0 comments on commit 5b71e9b

Please sign in to comment.