diff --git a/frame/item/appitem.cpp b/frame/item/appitem.cpp index c76501212..320f0ed93 100644 --- a/frame/item/appitem.cpp +++ b/frame/item/appitem.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #define APP_DRAG_THRESHOLD 20 @@ -82,10 +83,6 @@ AppItem::AppItem(const QDBusObjectPath &entry, QWidget *parent) m_appIcon(QPixmap()), - m_horizontalIndicator(QPixmap(":/indicator/resources/indicator.png")), - m_verticalIndicator(QPixmap(":/indicator/resources/indicator_ver.png")), - m_activeHorizontalIndicator(QPixmap(":/indicator/resources/indicator_active.png")), - m_activeVerticalIndicator(QPixmap(":/indicator/resources/indicator_active_ver.png")), m_updateIconGeometryTimer(new QTimer(this)), m_retryObtainIconTimer(new QTimer(this)), @@ -129,6 +126,7 @@ AppItem::AppItem(const QDBusObjectPath &entry, QWidget *parent) connect(GSettingsByApp(), &QGSettings::changed, this, &AppItem::onGSettingsChanged); connect(GSettingsByDockApp(), &QGSettings::changed, this, &AppItem::onGSettingsChanged); + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, &AppItem::onThemeTypeChanged); } AppItem::~AppItem() @@ -240,6 +238,15 @@ void AppItem::paintEvent(QPaintEvent *e) QPoint p; QPixmap pixmap; QPixmap activePixmap; + if(DGuiApplicationHelper::DarkType == m_themeType){ + m_horizontalIndicator = QPixmap(":/indicator/resources/indicator_dark.svg"); + m_verticalIndicator = QPixmap(":/indicator/resources/indicator_dark_ver.svg"); + }else { + m_horizontalIndicator = QPixmap(":/indicator/resources/indicator.svg"); + m_verticalIndicator = QPixmap(":/indicator/resources/indicator_ver.svg"); + } + m_activeHorizontalIndicator = QPixmap(":/indicator/resources/indicator_active.svg"); + m_activeVerticalIndicator = QPixmap(":/indicator/resources/indicator_active_ver.svg"); switch (DockPosition) { case Top: pixmap = m_horizontalIndicator; @@ -699,3 +706,9 @@ bool AppItem::checkGSettingsControl() const return (setting->keys().contains("control") && setting->get("control").toBool()) || (GSettingsByApp()->keys().contains("control") && GSettingsByApp()->get("control").toBool()); } + +void AppItem::onThemeTypeChanged(DGuiApplicationHelper::ColorType themeType) +{ + m_themeType = themeType; + update(); +} diff --git a/frame/item/appitem.h b/frame/item/appitem.h index 776d72eba..0e06a435a 100644 --- a/frame/item/appitem.h +++ b/frame/item/appitem.h @@ -32,6 +32,7 @@ #include #include #include +#include #include @@ -95,6 +96,7 @@ private slots: void checkAttentionEffect(); void onGSettingsChanged(const QString& key); bool checkGSettingsControl() const; + void onThemeTypeChanged(DGuiApplicationHelper::ColorType themeType); private: TipsWidget *m_appNameTips; @@ -125,6 +127,7 @@ private: QFutureWatcher *m_smallWatcher; QFutureWatcher *m_largeWatcher; + DGuiApplicationHelper::ColorType m_themeType; static QPoint MousePressPos; }; diff --git a/frame/item/item.qrc b/frame/item/item.qrc index 83e1b9ec5..4384a0de0 100644 --- a/frame/item/item.qrc +++ b/frame/item/item.qrc @@ -1,9 +1,11 @@ - resources/indicator_active.png - resources/indicator.png - resources/indicator_ver.png - resources/indicator_active_ver.png + resources/indicator_dark.svg + resources/indicator.svg + resources/indicator_ver.svg + resources/indicator_active_ver.svg + resources/indicator_dark_ver.svg + resources/indicator_active.svg resources/arrow-up.svg diff --git a/frame/item/resources/indicator.png b/frame/item/resources/indicator.png deleted file mode 100644 index 907ba6ed6..000000000 Binary files a/frame/item/resources/indicator.png and /dev/null differ diff --git a/frame/item/resources/indicator.svg b/frame/item/resources/indicator.svg new file mode 100644 index 000000000..e4037f62f --- /dev/null +++ b/frame/item/resources/indicator.svg @@ -0,0 +1,3 @@ + + + diff --git a/frame/item/resources/indicator_active.png b/frame/item/resources/indicator_active.png deleted file mode 100644 index abc8dfb63..000000000 Binary files a/frame/item/resources/indicator_active.png and /dev/null differ diff --git a/frame/item/resources/indicator_active.svg b/frame/item/resources/indicator_active.svg new file mode 100644 index 000000000..e7f73e341 --- /dev/null +++ b/frame/item/resources/indicator_active.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/frame/item/resources/indicator_active_ver.png b/frame/item/resources/indicator_active_ver.png deleted file mode 100644 index 4fdfd4a66..000000000 Binary files a/frame/item/resources/indicator_active_ver.png and /dev/null differ diff --git a/frame/item/resources/indicator_active_ver.svg b/frame/item/resources/indicator_active_ver.svg new file mode 100644 index 000000000..5e7fc5718 --- /dev/null +++ b/frame/item/resources/indicator_active_ver.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/frame/item/resources/indicator_dark.svg b/frame/item/resources/indicator_dark.svg new file mode 100644 index 000000000..33ecb66c6 --- /dev/null +++ b/frame/item/resources/indicator_dark.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/frame/item/resources/indicator_dark_ver.svg b/frame/item/resources/indicator_dark_ver.svg new file mode 100644 index 000000000..1da9d5a38 --- /dev/null +++ b/frame/item/resources/indicator_dark_ver.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/frame/item/resources/indicator_ver.png b/frame/item/resources/indicator_ver.png deleted file mode 100644 index d3a4f2d3b..000000000 Binary files a/frame/item/resources/indicator_ver.png and /dev/null differ diff --git a/frame/item/resources/indicator_ver.svg b/frame/item/resources/indicator_ver.svg new file mode 100644 index 000000000..80a2bc9df --- /dev/null +++ b/frame/item/resources/indicator_ver.svg @@ -0,0 +1,3 @@ + + +