fix: 图标减少没有重算图标大小

在图标增加(减少)后根据剩余空间重新计算图标大小。

Log: 修复关闭特效后任务栏图标大小没有调整的问题。
Bug: https://pms.uniontech.com/zentao/bug-view-47755.html
Change-Id: I18ef66212b991aa4b51f350387ceedda717333a8
Reviewed-on: http://gerrit.uniontech.com/c/dde-dock/+/6516
Reviewed-by: <mailman@uniontech.com>
Reviewed-by: fanpengcheng <fanpengcheng@uniontech.com>
Tested-by: <mailman@uniontech.com>
This commit is contained in:
Zhang Qipeng 2020-09-28 13:19:09 +08:00 committed by zhangqipeng
parent 8c3c466abf
commit 5f2f70f480

View File

@ -233,7 +233,6 @@ void MainPanelControl::addFixedAreaItem(int index, QWidget *wdg)
wdg->setMaximumSize(width(),width());
}
m_fixedAreaLayout->insertWidget(index, wdg);
resizeDockIcon();
}
void MainPanelControl::addAppAreaItem(int index, QWidget *wdg)
@ -244,14 +243,12 @@ void MainPanelControl::addAppAreaItem(int index, QWidget *wdg)
wdg->setMaximumSize(width(),width());
}
m_appAreaSonLayout->insertWidget(index, wdg);
resizeDockIcon();
}
void MainPanelControl::addTrayAreaItem(int index, QWidget *wdg)
{
m_tray = static_cast<TrayPluginItem *>(wdg);
m_trayAreaLayout->insertWidget(index, wdg);
resizeDockIcon();
}
void MainPanelControl::addPluginAreaItem(int index, QWidget *wdg)
@ -261,8 +258,6 @@ void MainPanelControl::addPluginAreaItem(int index, QWidget *wdg)
QBoxLayout * boxLayout = new QBoxLayout(QBoxLayout::LeftToRight);
boxLayout->addWidget(wdg, 0, Qt::AlignCenter);
m_pluginLayout->insertLayout(index, boxLayout, 0);
resizeDockIcon();;
m_pluginAreaWidget->adjustSize();
}
void MainPanelControl::removeFixedAreaItem(QWidget *wdg)
@ -351,6 +346,7 @@ void MainPanelControl::insertItem(int index, DockItem *item)
default:
break;
}
resizeDockIcon();
}
void MainPanelControl::removeItem(DockItem *item)
@ -373,6 +369,7 @@ void MainPanelControl::removeItem(DockItem *item)
default:
break;
}
resizeDockIcon();
}
MainPanelDelegate *MainPanelControl::delegate() const