From dfacba910f68d02e236fd60e4d7ba2b11d234934 Mon Sep 17 00:00:00 2001 From: iaom Date: Thu, 25 Jan 2024 09:31:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=E8=A7=A3=E5=86=B3=E5=81=B6?= =?UTF-8?q?=E7=8E=B0=E6=90=9C=E7=B4=A2=E5=90=8E=E6=97=A0=E6=B3=95=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E9=80=89=E4=B8=AD=E6=9C=80=E4=BD=B3=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E9=A1=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/control/stack-pages/search-page-section.cpp | 4 +++- frontend/control/stack-pages/search-page-section.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/control/stack-pages/search-page-section.cpp b/frontend/control/stack-pages/search-page-section.cpp index 9f1c911..e50bec9 100644 --- a/frontend/control/stack-pages/search-page-section.cpp +++ b/frontend/control/stack-pages/search-page-section.cpp @@ -370,6 +370,7 @@ void ResultArea::setSelectionInfo(QString &pluginID) m_selectedPluginID = pluginID; if (m_selectedPluginID != m_bestListWidget->getWidgetName()) { m_bestListWidget->clearResultSelection(); + m_isClicked = true; } } @@ -464,11 +465,12 @@ void ResultArea::initConnections() m_detail_open_state = false; m_isSelected = false; m_selectedPluginID = ""; + m_isClicked = false; }); connect(m_bestListWidget, &BestListWidget::sizeChanged, this, &ResultArea::onWidgetSizeChanged); connect(m_bestListWidget, &BestListWidget::sizeChanged, this, [=] () { QModelIndex index = m_bestListWidget->getModlIndex(0, 0); - if (index.isValid() && (m_selectedPluginID == m_bestListWidget->getWidgetName() || m_selectedPluginID.isEmpty())) { + if (index.isValid() && !m_isClicked) { m_bestListWidget->setResultSelection(index); m_selectedPluginID = m_bestListWidget->getWidgetName(); m_isSelected = true; diff --git a/frontend/control/stack-pages/search-page-section.h b/frontend/control/stack-pages/search-page-section.h index bc0d266..00b1f73 100644 --- a/frontend/control/stack-pages/search-page-section.h +++ b/frontend/control/stack-pages/search-page-section.h @@ -94,6 +94,7 @@ private: bool m_isSelected = false; QString m_selectedPluginID; QPoint m_pressPoint; + bool m_isClicked =false; Q_SIGNALS: void startSearch(const QString &);