File tree Expand file tree Collapse file tree
plugins/dde-dock/datetime Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,14 +172,15 @@ const QString DatetimePlugin::itemContextMenu(const QString &itemKey)
172172 QList<QVariant> items;
173173
174174 QMap<QString, QVariant> settings;
175+ #if 0 // 隐藏时间设置:BUG-303071
175176 settings["itemId"] = "settings";
176177 if (m_centralWidget->is24HourFormat())
177178 settings["itemText"] = tr("12-hour time");
178179 else
179180 settings["itemText"] = tr("24-hour time");
180181 settings["isActive"] = true;
181182 items.push_back(settings);
182-
183+ # endif
183184 if (!QFile::exists (ICBC_CONF_FILE )) {
184185 QMap<QString, QVariant> open;
185186 open[" itemId" ] = " open" ;
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ void DatetimeWidget::updateDateTimeString()
113113 const auto position = qApp->property (PROP_POSITION ).value <Dock::Position>();
114114 QString timeStr, dateString;
115115 if (position == Dock::Bottom || position == Dock::Top) {
116- QString timeFormat = m_24HourFormat ? " hh:mm " : m_regionFormat->getShortTimeFormat ();
116+ QString timeFormat = m_regionFormat->getShortTimeFormat ();
117117 timeStr = locale.toString (current, timeFormat);
118118 dateString = current.toString (m_regionFormat->getShortDateFormat ());
119119
@@ -124,9 +124,12 @@ void DatetimeWidget::updateDateTimeString()
124124 QString apText = locale.toString (current, " AP" );
125125 m_apLabel->setText (apText);
126126
127- timeStr = current.toString (" h:mm" );
127+ QString timeFormat = m_regionFormat->getShortTimeFormat ();
128+ timeFormat.replace (" AP" , " " );
129+ timeFormat.replace (" " , " " );
130+ timeStr = current.toString (timeFormat);
128131 } else {
129- timeStr = current.toString (" hh:mm " );
132+ timeStr = current.toString (m_regionFormat-> getShortTimeFormat () );
130133 }
131134
132135 m_timeLabel->setText (timeStr);
You can’t perform that action at this time.
0 commit comments