From 04e5bc107159c60ec52098dcf0f1105092d5c296 Mon Sep 17 00:00:00 2001 From: dengzhongyuan Date: Thu, 13 Nov 2025 13:45:51 +0800 Subject: [PATCH] fix: improve FindWidget position update logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Refactor position update in FindWidget to account for parent window dimensions. - Ensure correct positioning relative to the parent window or fallback to screen geometry if no parent is present. This change enhances the usability of the FindWidget by ensuring it appears correctly in relation to its parent window. bug: https://pms.uniontech.com/bug-view-339997.html --- reader/widgets/FindWidget.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reader/widgets/FindWidget.cpp b/reader/widgets/FindWidget.cpp index 35a9b94a..7246828c 100644 --- a/reader/widgets/FindWidget.cpp +++ b/reader/widgets/FindWidget.cpp @@ -46,8 +46,7 @@ void FindWidget::setDocSheet(DocSheet *sheet) void FindWidget::updatePosition() { qCDebug(appLog) << "Updating find widget position, yOffset:" << m_yOff; - QRect screenGeometry = QGuiApplication::primaryScreen()->geometry(); - this->move(screenGeometry.width() - this->width() - 10, m_yOff + 10); + this->move(m_parentWidget->width() - this->width() - 10, m_yOff + 10); this->show(); this->raise();