diff --git a/frame/panel/mainpanelcontrol.cpp b/frame/panel/mainpanelcontrol.cpp index 8e029b9d1..fc8cb5365 100755 --- a/frame/panel/mainpanelcontrol.cpp +++ b/frame/panel/mainpanelcontrol.cpp @@ -300,6 +300,7 @@ void MainPanelControl::updateAppAreaSonWidgetSize() m_appAreaSonWidget->adjustSize(); moveAppSonWidget(); + updateFixedAreaIcon(); } void MainPanelControl::setPositonValue(Dock::Position position) @@ -555,7 +556,7 @@ bool MainPanelControl::eventFilter(QObject *watched, QEvent *event) if (event->type() == QEvent::LayoutRequest) { m_appAreaSonWidget->adjustSize(); resizeDockIcon(); - + updateFixedAreaIcon(); } else { moveAppSonWidget(); } @@ -1086,3 +1087,19 @@ void MainPanelControl::resizeDesktopWidget() m_desktopWidget->setFixedSize(0, 0); } +void MainPanelControl::updateFixedAreaIcon() +{ + QLayoutItem *appLayoutItem = m_appAreaSonLayout->itemAt(0); + if (appLayoutItem) { + QWidget *appWidget = appLayoutItem->widget(); + if (appWidget) { + int w = appWidget->width(); + int h = appWidget->height(); + for (int i = 0; i < m_fixedAreaLayout->count(); ++ i) { + // 取最近较小偶数, 去抖 + m_fixedAreaLayout->itemAt(i)->widget()->setFixedSize((w | 1) - 1, (h | 1) - 1); + } + } + } +} + diff --git a/frame/panel/mainpanelcontrol.h b/frame/panel/mainpanelcontrol.h index 0b0b6dd26..51d5b69ba 100755 --- a/frame/panel/mainpanelcontrol.h +++ b/frame/panel/mainpanelcontrol.h @@ -100,7 +100,10 @@ private: void paintEvent(QPaintEvent *event) override; void resizeDockIcon(); void calcuDockIconSize(int w, int h, PluginsItem *trashPlugin, PluginsItem *shutdownPlugin, PluginsItem *keyboardPlugin, PluginsItem *notificationPlugin); - void resizeDesktopWidget(); + void resizeDesktopWidget(); + + void updateFixedAreaIcon(); + public slots: void insertItem(const int index, DockItem *item); void removeItem(DockItem *item);