Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dock plugin calculated to an incorrect size #979

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading