mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
fix: 时间插件显示异常
任务栏参数变化时,时间插件没有同步刷新布局。 Log: 修复时间插件显示异常的问题。 Bug: https://pms.uniontech.com/zentao/bug-view-59013.html Bug: https://pms.uniontech.com/zentao/bug-view-60340.html Bug: https://pms.uniontech.com/zentao/bug-view-59126.html Change-Id: I6df9a6155dcff38758ef06b2ca12826761037fab
This commit is contained in:
parent
860b78cd5f
commit
acbf68cca3
@ -342,6 +342,9 @@ void MainPanelControl::insertItem(int index, DockItem *item)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
resizeDockIcon();
|
resizeDockIcon();
|
||||||
|
QTimer::singleShot(0, [ = ] {
|
||||||
|
updatePluginsLayout();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainPanelControl::removeItem(DockItem *item)
|
void MainPanelControl::removeItem(DockItem *item)
|
||||||
@ -869,9 +872,22 @@ void MainPanelControl::moveAppSonWidget()
|
|||||||
m_appAreaSonWidget->move(rect.x(), rect.y());
|
m_appAreaSonWidget->move(rect.x(), rect.y());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainPanelControl::updatePluginsLayout()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < m_pluginLayout->count(); ++i) {
|
||||||
|
QLayout *layout = m_pluginLayout->itemAt(i)->layout();
|
||||||
|
if (layout) {
|
||||||
|
PluginsItem *pItem = static_cast<PluginsItem *>(layout->itemAt(0)->widget());
|
||||||
|
if (pItem && pItem->sizeHint().width() != -1) {
|
||||||
|
pItem->updateGeometry();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MainPanelControl::itemUpdated(DockItem *item)
|
void MainPanelControl::itemUpdated(DockItem *item)
|
||||||
{
|
{
|
||||||
item->parentWidget()->adjustSize();
|
item->updateGeometry();
|
||||||
resizeDockIcon();
|
resizeDockIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@ public:
|
|||||||
void setPositonValue(Position position);
|
void setPositonValue(Position position);
|
||||||
void setDisplayMode(DisplayMode dislayMode);
|
void setDisplayMode(DisplayMode dislayMode);
|
||||||
void getTrayVisableItemCount();
|
void getTrayVisableItemCount();
|
||||||
|
void updatePluginsLayout();
|
||||||
|
|
||||||
MainPanelDelegate *delegate() const;
|
MainPanelDelegate *delegate() const;
|
||||||
void setDelegate(MainPanelDelegate *delegate);
|
void setDelegate(MainPanelDelegate *delegate);
|
||||||
|
@ -254,6 +254,7 @@ void MainWindow::resizeEvent(QResizeEvent *event)
|
|||||||
// 任务栏大小、位置、模式改变都会触发resize,发射大小改变信号,供依赖项目更新位置
|
// 任务栏大小、位置、模式改变都会触发resize,发射大小改变信号,供依赖项目更新位置
|
||||||
Q_EMIT panelGeometryChanged();
|
Q_EMIT panelGeometryChanged();
|
||||||
|
|
||||||
|
m_mainPanel->updatePluginsLayout();
|
||||||
m_shadowMaskOptimizeTimer->start();
|
m_shadowMaskOptimizeTimer->start();
|
||||||
|
|
||||||
return DBlurEffectWidget::resizeEvent(event);
|
return DBlurEffectWidget::resizeEvent(event);
|
||||||
|
@ -61,7 +61,6 @@ void DatetimeWidget::set24HourFormat(const bool value)
|
|||||||
m_24HourFormat = value;
|
m_24HourFormat = value;
|
||||||
update();
|
update();
|
||||||
|
|
||||||
adjustSize();
|
|
||||||
if (isVisible()) {
|
if (isVisible()) {
|
||||||
emit requestUpdateGeometry();
|
emit requestUpdateGeometry();
|
||||||
}
|
}
|
||||||
@ -86,7 +85,7 @@ void DatetimeWidget::setShortDateFormat(int type)
|
|||||||
default: m_shortDateFormat = "yyyy-MM-dd"; break;
|
default: m_shortDateFormat = "yyyy-MM-dd"; break;
|
||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
adjustSize();
|
|
||||||
if (isVisible()) {
|
if (isVisible()) {
|
||||||
emit requestUpdateGeometry();
|
emit requestUpdateGeometry();
|
||||||
}
|
}
|
||||||
@ -104,7 +103,7 @@ void DatetimeWidget::setShortTimeFormat(int type)
|
|||||||
default: m_shortTimeFormat = "hh:mm"; break;
|
default: m_shortTimeFormat = "hh:mm"; break;
|
||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
adjustSize();
|
|
||||||
if (isVisible()) {
|
if (isVisible()) {
|
||||||
emit requestUpdateGeometry();
|
emit requestUpdateGeometry();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user