feat: 添加控制中心修改系统时间(年月)时,任务栏日历图标上刷新

在刷新Icon中添加年月的判断

Log: 添加控制中心修改系统时间(年月)时,任务栏日历图标上刷新
Task: https://pms.uniontech.com/zentao/task-view-75885.html
Change-Id: I9761322a277be7e5c78482c1c8bc8855f9a85f9e
This commit is contained in:
yanghongwei 2021-05-08 10:00:43 +08:00
parent af4029f2d6
commit 2972f837fc
2 changed files with 5 additions and 7 deletions

View File

@ -60,7 +60,6 @@ AppItem::AppItem(const QGSettings *appSettings, const QGSettings *activeAppSetti
, m_drag(nullptr) , m_drag(nullptr)
, m_dragging(false) , m_dragging(false)
, m_retryTimes(0) , m_retryTimes(0)
, m_lastShowDay(0)
, m_iconValid(false) , m_iconValid(false)
, m_lastclickTimes(0) , m_lastclickTimes(0)
, m_appIcon(QPixmap()) , m_appIcon(QPixmap())
@ -116,10 +115,10 @@ AppItem::AppItem(const QGSettings *appSettings, const QGSettings *activeAppSetti
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, &AppItem::onThemeTypeChanged); connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, &AppItem::onThemeTypeChanged);
/** 日历 1S定时判断是否刷新icon的处理 */
connect(m_refershIconTimer, &QTimer::timeout, this, [ = ]() { connect(m_refershIconTimer, &QTimer::timeout, this, [ = ]() {
m_curDate = QDate::currentDate(); if (QDate::currentDate() != m_curDate) {
if (m_curDate.day() != m_lastShowDay) { m_curDate = QDate::currentDate();
m_lastShowDay = m_curDate.day();
refreshIcon(); refreshIcon();
} }
}); });

View File

@ -120,7 +120,6 @@ private:
bool m_dragging; bool m_dragging;
bool m_active; bool m_active;
int m_retryTimes; int m_retryTimes;
int m_lastShowDay;
bool m_iconValid; bool m_iconValid;
unsigned long m_lastclickTimes; unsigned long m_lastclickTimes;
@ -134,9 +133,9 @@ private:
QTimer *m_updateIconGeometryTimer; QTimer *m_updateIconGeometryTimer;
QTimer *m_retryObtainIconTimer; QTimer *m_retryObtainIconTimer;
QTimer *m_refershIconTimer; QTimer *m_refershIconTimer; // 当APP为日历时定时1S检测是否刷新ICON
QDate m_curDate; QDate m_curDate; // 保存当前icon的日期来判断是否需要更新日历APP的ICON
QFutureWatcher<QPixmap> *m_smallWatcher; QFutureWatcher<QPixmap> *m_smallWatcher;
QFutureWatcher<QPixmap> *m_largeWatcher; QFutureWatcher<QPixmap> *m_largeWatcher;