mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00
fix: 固定区与应用区图标不一致
固定区图标所设值,与应用区图标自适应后调为一致 Log: 修复缩放任务栏时,启动器图标和应用图标大小不一致问题 Bug: https://pms.uniontech.com/zentao/bug-view-35028.html
This commit is contained in:
parent
8e97f166b9
commit
7f730c867f
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user