mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
fix: 修改对应日期后任务栏日期弹框显示错误
在时间插件去更新当前的时间时,需要同步去刷新日期和周,防止显示错误 Log: 修复修改对应日期后任务栏日期弹框显示错误的问题 Influence: 任务栏日期弹框 Bug: https://pms.uniontech.com/bug-view-147017.html Change-Id: Ia5375241b3708ba35a25c11985145e43ad53e931
This commit is contained in:
parent
1e08418fbf
commit
0591607674
@ -223,6 +223,9 @@ void DatetimePlugin::updateCurrentTimeString()
|
||||
auto lang = QLocale::system().language();
|
||||
bool isZhLocale = lang == QLocale::Chinese || lang == QLocale::Tibetan || lang == QLocale::Uighur;
|
||||
|
||||
// 实时刷新日期,防止日期显示错误
|
||||
m_centralWidget->updateDateTimeString();
|
||||
|
||||
// 如果系统语言环境为中文(包含藏语和维语),按照中文的显示格式去显示,否则按照当地的日期格式显示
|
||||
if (m_centralWidget->is24HourFormat()) {
|
||||
if (isZhLocale)
|
||||
|
@ -226,6 +226,9 @@ void DatetimeWidget::updateDateTimeString()
|
||||
|
||||
QString longTimeFormat = QString(tr("%1year%2month%3day")).arg(year).arg(month).arg(day);
|
||||
|
||||
// 实时更新周的日期显示
|
||||
updateWeekdayFormat();
|
||||
|
||||
switch (m_longDateFormatType) {
|
||||
case 0 :
|
||||
m_dateTime = longTimeFormat;
|
||||
|
@ -48,6 +48,7 @@ signals:
|
||||
|
||||
public slots:
|
||||
void set24HourFormat(const bool value);
|
||||
void updateDateTimeString();
|
||||
|
||||
private Q_SLOTS:
|
||||
void setShortDateFormat(int type);
|
||||
@ -57,7 +58,6 @@ private Q_SLOTS:
|
||||
|
||||
private:
|
||||
QSize curTimeSize() const;
|
||||
void updateDateTimeString();
|
||||
void updateWeekdayFormat();
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user