mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00
fix: 任务栏时间右键菜单时间格式显示错误 (#781)
当更改了时间显示格式后,需要更新下menu菜单的显示状态 Log: 修复任务栏时间右键菜单时间格式显示错误的问题 Resolve: https://github.com/linuxdeepin/developer-center/issues/3792 Influence: 任务栏时间插件右键菜单
This commit is contained in:
parent
ff7d85a556
commit
7320406161
@ -353,13 +353,13 @@ QFont DateTimeDisplayer::timeFont() const
|
||||
void DateTimeDisplayer::createMenuItem()
|
||||
{
|
||||
QAction *timeFormatAction = new QAction(this);
|
||||
if (m_timedateInter->use24HourFormat())
|
||||
timeFormatAction->setText(tr("12-hour time"));
|
||||
else
|
||||
timeFormatAction->setText(tr("24-hour time"));
|
||||
m_timedateInter->use24HourFormat() ? timeFormatAction->setText(tr("12-hour time"))
|
||||
: timeFormatAction->setText(tr("24-hour time"));
|
||||
|
||||
connect(timeFormatAction, &QAction::triggered, this, [ = ] {
|
||||
m_timedateInter->setUse24HourFormat(!m_timedateInter->use24HourFormat());
|
||||
m_timedateInter->use24HourFormat() ? timeFormatAction->setText(tr("12-hour time"))
|
||||
: timeFormatAction->setText(tr("24-hour time"));
|
||||
});
|
||||
m_menu->addAction(timeFormatAction);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user