fix: 去掉设置图标向下取偶数的大小的代码

原代码本意是为了解决在调整任务栏大小时,调整图标大小一致的,但是代码本身无法调整一致大小的图标,反而造成鼠标在界面上移动时,图标大小会变化而抖动
的问题

Log: 修复打开多个应用,将任务栏位置调整至左边或者右边,鼠标在任务栏和桌面间移动,任务栏固定区域和应用区域图标抖动的问题
Bug: https://pms.uniontech.com/zentao/bug-view-40176.html
Change-Id: Ibb18d4e16eeecd09be7d2e8b407dac17a12a2e7d
Reviewed-on: http://gerrit.uniontech.com/c/dde-dock/+/983
Reviewed-by: <mailman@uniontech.com>
Reviewed-by: lizhongming <lizhongming@uniontech.com>
Tested-by: <mailman@uniontech.com>
This commit is contained in:
chenjun 2020-07-30 17:27:17 +08:00 committed by lizhongming
parent 89a4d80350
commit 554c324d14
2 changed files with 0 additions and 21 deletions

View File

@ -300,7 +300,6 @@ void MainPanelControl::updateAppAreaSonWidgetSize()
m_appAreaSonWidget->adjustSize();
moveAppSonWidget();
updateFixedAreaIcon();
}
void MainPanelControl::setPositonValue(Dock::Position position)
@ -556,7 +555,6 @@ bool MainPanelControl::eventFilter(QObject *watched, QEvent *event)
if (event->type() == QEvent::LayoutRequest) {
m_appAreaSonWidget->adjustSize();
resizeDockIcon();
updateFixedAreaIcon();
} else {
moveAppSonWidget();
}
@ -1086,20 +1084,3 @@ void MainPanelControl::resizeDesktopWidget()
if (DisplayMode::Fashion == m_dislayMode)
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);
}
}
}
}

View File

@ -102,8 +102,6 @@ private:
void calcuDockIconSize(int w, int h, PluginsItem *trashPlugin, PluginsItem *shutdownPlugin, PluginsItem *keyboardPlugin, PluginsItem *notificationPlugin);
void resizeDesktopWidget();
void updateFixedAreaIcon();
public slots:
void insertItem(const int index, DockItem *item);
void removeItem(DockItem *item);