Skip to content

Commit

Permalink
fix: dock plugin calculated to an incorrect size
Browse files Browse the repository at this point in the history
set minSize only for uosai

log: as title
issue: linuxdeepin/developer-center#7127
  • Loading branch information
tsic404 committed Jan 30, 2024
1 parent 2b81011 commit ccedb2b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions frame/window/quickpluginwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,11 @@ void QuickDockItem::setPosition(Dock::Position position)
QWidget *itemWidget = m_pluginItem->itemWidget(m_itemKey);
if (itemWidget && m_mainLayout->indexOf(itemWidget) < 0) {
auto size= suitableSize();
auto minSize = std::min(size.height(), size.width());
itemWidget->setFixedSize(QSize(minSize, minSize));
if (pluginItem()->pluginName() == QStringLiteral("uosai")) {
auto minSize = std::min(size.height(), size.width());
size = QSize(minSize, minSize);
}
itemWidget->setFixedSize(size);
}
}
}
Expand Down Expand Up @@ -882,8 +885,12 @@ void QuickDockItem::showEvent(QShowEvent *event)
if (itemWidget && m_mainLayout->indexOf(itemWidget) < 0) {
itemWidget->show();
auto size= suitableSize();
auto minSize = std::min(size.height(), size.width());
itemWidget->setFixedSize(QSize(minSize, minSize));
if (pluginItem()->pluginName() == QStringLiteral("uosai")) {
auto minSize = std::min(size.height(), size.width());
size = QSize(minSize, minSize);
}
itemWidget->setFixedSize(size);
itemWidget->setFixedSize(size);
m_mainLayout->addWidget(itemWidget);
}
}
Expand Down

0 comments on commit ccedb2b

Please sign in to comment.