diff --git a/frame/item/appitem.cpp b/frame/item/appitem.cpp index 9a9a2ec9d..496e62afe 100644 --- a/frame/item/appitem.cpp +++ b/frame/item/appitem.cpp @@ -55,8 +55,7 @@ AppItem::AppItem(const QDBusObjectPath &entry, QWidget *parent) m_draging(false), - m_smallIcon(QPixmap()), - m_largeIcon(QPixmap()), + m_appIcon(QPixmap()), m_horizontalIndicator(QPixmap(":/indicator/resources/indicator.png")), m_verticalIndicator(QPixmap(":/indicator/resources/indicator_ver.png")), @@ -272,7 +271,7 @@ void AppItem::paintEvent(QPaintEvent *e) } // icon - const QPixmap pixmap = DockDisplayMode == Efficient ? m_smallIcon : m_largeIcon; + const QPixmap &pixmap = m_appIcon; if (pixmap.isNull()) return; @@ -303,7 +302,7 @@ void AppItem::mouseReleaseEvent(QMouseEvent *e) m_itemScene->clear(); const auto ratio = qApp->devicePixelRatio(); const QRect r = rect(); - const QPixmap icon = DockDisplayMode == Efficient ? m_smallIcon : m_largeIcon; + const QPixmap &icon = m_appIcon; QGraphicsPixmapItem *item = m_itemScene->addPixmap(icon); item->setTransformationMode(Qt::SmoothTransformation); item->setPos(QPointF(r.center()) - QPointF(icon.rect().center()) / ratio); @@ -483,7 +482,7 @@ void AppItem::startDrag() m_draging = true; update(); - const QPixmap dragPix = DockDisplayMode == Dock::Fashion ? m_largeIcon : m_smallIcon; + const QPixmap &dragPix = m_appIcon; QDrag *drag = new QDrag(this); drag->setPixmap(dragPix); @@ -518,13 +517,9 @@ void AppItem::refershIcon() const int iconSize = qMin(width(), height()); if (DockDisplayMode == Efficient) - { - m_smallIcon = ThemeAppIcon::getIcon(icon, iconSize * 0.7); - m_largeIcon = ThemeAppIcon::getIcon(icon, iconSize * 0.9); - } else { - m_smallIcon = ThemeAppIcon::getIcon(icon, iconSize * 0.6); - m_largeIcon = ThemeAppIcon::getIcon(icon, iconSize * 0.8); - } + m_appIcon = ThemeAppIcon::getIcon(icon, iconSize * 0.7); + else + m_appIcon = ThemeAppIcon::getIcon(icon, iconSize * 0.8); update(); diff --git a/frame/item/appitem.h b/frame/item/appitem.h index a19645a45..4822d857a 100644 --- a/frame/item/appitem.h +++ b/frame/item/appitem.h @@ -91,8 +91,7 @@ private: bool m_active; WindowDict m_titles; QString m_id; - QPixmap m_smallIcon; - QPixmap m_largeIcon; + QPixmap m_appIcon; QPixmap m_horizontalIndicator; QPixmap m_verticalIndicator; QPixmap m_activeHorizontalIndicator; diff --git a/frame/item/dockitem.cpp b/frame/item/dockitem.cpp index a22a97cab..820c110e4 100644 --- a/frame/item/dockitem.cpp +++ b/frame/item/dockitem.cpp @@ -44,9 +44,7 @@ DockItem::DockItem(QWidget *parent) { DockPopupWindow *arrowRectangle = new DockPopupWindow(nullptr); arrowRectangle->setShadowBlurRadius(20); -// arrowRectangle->setBorderWidth(0); arrowRectangle->setRadius(6); -// arrowRectangle->setShadowDistance(0); arrowRectangle->setShadowYOffset(2); arrowRectangle->setShadowXOffset(0); arrowRectangle->setArrowWidth(18);