fix: popupwindow misjudgment

content should not more width than screen otherwise popupwindows must be out of bounds screen

log: as title
This commit is contained in:
tsic404 2023-05-11 13:24:05 +08:00 committed by Tsic
parent 79cab3fac8
commit 83f264720c

View File

@ -136,7 +136,7 @@ void DockPopupWindow::show(const int x, const int y)
if (!screen)
return;
QRect screenRect = screen->geometry();
if (getContent()->width() > screenRect.width()) {
if (getContent()->width() <= screenRect.width()) {
displayPoint.setX(qMax(screenRect.x(), displayPoint.x()));
displayPoint.setX(qMin(screenRect.x() + screenRect.width() - getContent()->width(), displayPoint.x()));
}